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

ci_trace: fix args filter wrt branch name #751

Closed bmeneg closed 2 years ago

bmeneg commented 2 years ago

The CI args handler is considering only the branch name when the user passes it with the job name in the format <remote> <branch>:<jobname> or with an empty <jobname> like <remote> <branch>:. In all other subcommands, the branch name can be used after the remote name without any additional suffix (the colom in this case ':'). This patch fixes it and adds the ability to the user call CI subcommands with <remote> <branch>.

This patch also adds some comments to the code where this filtering happens, since the code, even though small, is quite dense wrt the number of possibilities.

Signed-off-by: Bruno Meneguele bmeneg@redhat.com

Fixes #750

codecov[bot] commented 2 years ago

Codecov Report

Merging #751 (d64d135) into master (7540b64) will increase coverage by 0.09%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #751      +/-   ##
==========================================
+ Coverage   54.72%   54.82%   +0.09%     
==========================================
  Files          77       77              
  Lines        5608     5611       +3     
==========================================
+ Hits         3069     3076       +7     
+ Misses       2258     2255       -3     
+ Partials      281      280       -1     
Impacted Files Coverage Δ
cmd/ci_artifacts.go 92.30% <ø> (ø)
cmd/ci_trace.go 70.78% <100.00%> (+1.01%) :arrow_up:
cmd/fork.go 63.15% <0.00%> (+5.26%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7540b64...d64d135. Read the comment docs.