Skip to content

fix(cli): expose the required job artifact path - #3455

Open
UmutAlisoglu wants to merge 1 commit into
python-gitlab:mainfrom
UmutAlisoglu:codex/cli-job-artifact-path
Open

UmutAlisoglu wants to merge 1 commit into
python-gitlab:mainfrom
UmutAlisoglu:codex/cli-job-artifact-path

Conversation

@UmutAlisoglu

Copy link
Copy Markdown

Changes

The project-job artifact action has a required path argument in the Python API, but its CLI registration never exposes it. The help omits --path, passing it is rejected, and omitting it leaves the action without a required argument.

Register path as required and add an example beside the existing ZIP-download command:

gitlab project-job artifact --project-id 1 --id 10 --path reports/result.xml > result.xml

Fixes #1926. The Python API and archive-download action are unchanged.

Documentation and testing

Four new tests fail before the change and pass afterward. They cover required-argument validation and mocked CLI dispatch/HTTP downloads for simple, nested, and space-containing paths, preserving binary response bytes.

On Windows / Python 3.13.7:

  • Full unit suite: 724 passed, 5 skipped.
  • Repository-wide Black, isort, Flake8 and mypy pass; mypy checks 255 files. Pylint: 10/10.
  • Strict Sphinx build (-n -W --keep-going) passes.
  • Wheel and sdist build successfully; twine check passes for both.
  • Conventional commit validation and diff check pass.

The tox package-check wrapper cannot parse this checkout path containing spaces, so its equivalent build/twine commands were run directly. Docker-based tests against a live GitLab instance were not run; HTTP calls in the new tests use responses mocks.

AI assistance was used for implementation and tests. Signed off.

@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.94%. Comparing base (51eb17e) to head (061422b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3455      +/-   ##
==========================================
+ Coverage   95.78%   95.94%   +0.16%     
==========================================
  Files         100      100              
  Lines        6172     6172              
==========================================
+ Hits         5912     5922      +10     
+ Misses        260      250      -10     
Flag Coverage Δ
api_func_v4 83.91% <100.00%> (ø)
cli_func_v4 78.79% <100.00%> (ø)
unit 90.94% <100.00%> (+0.61%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
gitlab/v4/objects/jobs.py 86.04% <100.00%> (+3.48%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI argument to download individual job artifact

1 participant