Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make local backend work with cli exec #4102

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

6543
Copy link
Member

@6543 6543 commented Sep 11, 2024

Currently if you try to exec a pipeline via the cli tool and use the local backend, all files are missing.
This will detect this specific case and use the new added option in the local backend to specify a execution directory upfront.


Sponsored by Kithara Software GmbH

@6543 6543 added enhancement improve existing features cli backend/local labels Sep 11, 2024
@woodpecker-bot
Copy link
Collaborator

Deploying preview to https://woodpecker-ci-woodpecker-pr-4102.surge.sh

Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 0% with 26 lines in your changes missing coverage. Please review.

Project coverage is 26.94%. Comparing base (b1cf44a) to head (06e5a2a).

Files with missing lines Patch % Lines
pipeline/backend/local/local.go 0.00% 22 Missing ⚠️
cli/exec/exec.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4102      +/-   ##
==========================================
- Coverage   26.98%   26.94%   -0.04%     
==========================================
  Files         394      394              
  Lines       27395    27414      +19     
==========================================
- Hits         7393     7388       -5     
- Misses      19302    19326      +24     
  Partials      700      700              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@6543
Copy link
Member Author

6543 commented Sep 12, 2024

@anbraten if you know an better way to do:

woodpecker-cli.exe exec --backend-engine local --pipeline-event push --commit-branch main

to test local backend via cli in windows / linux please tell :)

@anbraten
Copy link
Member

Will do some testing. Fyi #3967 might be quite interesting for you.

@6543
Copy link
Member Author

6543 commented Sep 12, 2024

Yes thus might allow more :)

Should i hide the flag and undocument it so we have it working now and can improve it later?

@anbraten
Copy link
Member

The usage of the local property was somehow not compatible with the local backend. This fixes it for me so I was able to run:

go run ../cmd/cli/ exec --pipeline-event push --commit-branch main --backend-engine local --local

https://github.com/woodpecker-ci/woodpecker/compare/main...anbraten:local-path?expand=1

@6543
Copy link
Member Author

6543 commented Sep 30, 2024

I looked at your solution, this has 2 problems:

  1. the 'repo-path' is now (miss-)used at the local backend even if it never was registered there (the lib we have do handle that but its outside of our convention)
  2. artifacts that should not be there like temporary exec files are now stored inside the current repo, witch differs completly on how the backend is executed with server&agent combi
  3. the bug mentioned in 2. affects docker backend if exec via cli now too (because of the removed volume)

the only thing i could addopt in my patch from your suggestion would be 1. witch breaks the convention ...
... not sure if this makes maintaining this harder...

@6543
Copy link
Member Author

6543 commented Sep 30, 2024

what i could do and did, is to hide that option from the user: 7101cdb

@6543 6543 requested a review from anbraten September 30, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend/local cli enhancement improve existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants