refactor: use params for all other URL constructions#482
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #482 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 97 97
Lines 9690 9690
Branches 514 514
=========================================
Hits 9690 9690 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4395e26 to
19b0972
Compare
Motivation: Consistently use the 'params' argument for URL query parameters across the codebase to avoid manual string manipulation and ensure proper encoding. Design Choices: - Refactored `get_json` and `get_json_list` in `openqabot/loader/gitea.py` to support `params` and updated callers. - Updated `get_aggregate_settings_data` in `openqabot/loader/qem.py` to pass parameters via `params`. - Refactored `get_older_jobs` in `openqabot/openqa.py` to use positional arguments for params as expected by `openqa_client`. - Updated relevant test mocks in `tests/test_giteasync.py` and `tests/test_loader_qem.py`. Benefits: - Code consistency and readability. - Robust handling of query parameters across different modules. Related issue: openSUSE#480
19b0972 to
5cfe77d
Compare
|
This pull request, with head sha This pull request will be automatically closed by GitHub.As soon as GitHub detects that the sha It is possible for this pull request to remain open if this detection does not happen, this usually happens when a force-push is done on this branch |
Motivation:
Consistently use the 'params' argument for URL query parameters
across the codebase to avoid manual string manipulation and ensure
proper encoding.
Design Choices:
get_jsonandget_json_listinopenqabot/loader/gitea.pyto support
paramsand updated callers.get_aggregate_settings_datainopenqabot/loader/qem.pytopass parameters via
params.get_older_jobsinopenqabot/openqa.pyto use positionalarguments for params as expected by
openqa_client.tests/test_giteasync.pyandtests/test_loader_qem.py.Benefits: