zaquestion / lab

Lab wraps Git or Hub, making it simple to clone, fork, and interact with repositories on GitLab
https://zaquestion.github.io/lab
Creative Commons Zero v1.0 Universal
1.11k stars 102 forks source link

lab ci artifacts ignores `branch` argument #750

Closed davidvandebunte closed 3 years ago

davidvandebunte commented 3 years ago

I'm not sure if I'm totally missing something, but it seems like lab ci artifacts ignores the branch argument and always pull the artifacts from the latest job. I'm using completion to fill in the branch name.

For example I have a branch feat_a that completes with artifacts, then push a branch feat_b that generates artifacts. If I run:

lab ci artifacts upstream feat_a

Then lab downloads the artifacts for feat_b.

Incidentally, the job name is not ignored. So the following will pull the artifacts from the specified job_name rather than the last job:

lab ci artifacts upstream :job_name

The branch argument seems to be parsed and checked against the remote in some cases. So if feat_a doesn't exist on the remote:

$ lab ci artifacts upstream feat_a
(no error, downloads wrong artifacts)
$ lab ci artifacts upstream feat_a:job_name
2021/10/07 16:41:56 ERROR: ci_artifacts.go:67: GET https://...: 404 {message: 404 Commit Not Found}
bmeneg commented 3 years ago

@davidvandebunte thanks for the report. I'm going to check this behavior and should have an answer soon. If that's really a bug I'll prepare the fix asap.

bmeneg commented 3 years ago

@davidvandebunte as soon as #751 is integrated, the issue should be fixed.