Commit 5cfe77d
committed
refactor: use params for all other URL constructions
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: #4801 parent f2d9742 commit 5cfe77d
File tree
5 files changed
+32
-13
lines changed- openqabot
- loader
- tests
5 files changed
+32
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
70 | 75 | | |
71 | 76 | | |
72 | | - | |
| 77 | + | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
77 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
78 | 89 | | |
79 | | - | |
| 90 | + | |
80 | 91 | | |
81 | 92 | | |
82 | 93 | | |
| |||
199 | 210 | | |
200 | 211 | | |
201 | 212 | | |
202 | | - | |
| 213 | + | |
203 | 214 | | |
204 | 215 | | |
205 | 216 | | |
| |||
330 | 341 | | |
331 | 342 | | |
332 | 343 | | |
333 | | - | |
| 344 | + | |
334 | 345 | | |
335 | 346 | | |
336 | | - | |
| 347 | + | |
337 | 348 | | |
338 | 349 | | |
339 | 350 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
230 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
231 | 234 | | |
232 | 235 | | |
233 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
145 | 148 | | |
146 | 149 | | |
147 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
305 | 307 | | |
306 | 308 | | |
307 | 309 | | |
| |||
0 commit comments