Skip to content

feat(api): add support for order_by filter in runner jobs#3337

Merged
nejch merged 1 commit intopython-gitlab:mainfrom
malmor:feature/support-order-by-for-runner-jobs
Feb 26, 2026
Merged

feat(api): add support for order_by filter in runner jobs#3337
nejch merged 1 commit intopython-gitlab:mainfrom
malmor:feature/support-order-by-for-runner-jobs

Conversation

@malmor
Copy link
Contributor

@malmor malmor commented Jan 29, 2026

This commits adds to the work done in 1. After reading the docs 2 again, you must define order_by when using sort, so this commits adds this as an additional filter.

Changes

Added support for order_by filter when fetching runner jobs.

Documentation and testing

Please consider whether this PR needs documentation and tests. This is not required, but highly appreciated:

@malmor
Copy link
Contributor Author

malmor commented Jan 29, 2026

Hey @nejch,
I did not read the docs carefully enough - yesterday's PR only works in combination with a second filter 🤦

Sort jobs in asc or desc order (default: desc). If sort is specified, order_by must be specified as well

Sorry for the additional effort!

This commits adds to the work done in [1]. After reading the
docs [2] again, you must define order_by when using sort, so
this commits adds this as an additional filter.

[1]: python-gitlab#3336
[2]: https://docs.gitlab.com/api/runners/#list-all-jobs-processed-by-a-runner

Signed-off-by: malmor <[email protected]>
@nejch nejch force-pushed the feature/support-order-by-for-runner-jobs branch from 212b128 to 511d0b5 Compare February 26, 2026 10:05
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.75%. Comparing base (0bfaa6b) to head (511d0b5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3337   +/-   ##
=======================================
  Coverage   95.75%   95.75%           
=======================================
  Files          98       98           
  Lines        6054     6054           
=======================================
  Hits         5797     5797           
  Misses        257      257           
Flag Coverage Δ
api_func_v4 83.64% <100.00%> (+0.04%) ⬆️
cli_func_v4 78.67% <100.00%> (ø)
unit 90.17% <100.00%> (ø)

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

Files with missing lines Coverage Δ
gitlab/v4/objects/runners.py 98.48% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nejch
Copy link
Member

nejch commented Feb 26, 2026

Thanks @malmor no worries, and sorry I also totally missed this! Thank you 🙇

@nejch nejch merged commit d5dc73d into python-gitlab:main Feb 26, 2026
18 checks passed
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.

2 participants