Repository navigation
fix: Encode ConfigApplyStatus query parameters - #4718
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4718 +/- ##
==========================================
- Coverage 98.64% 98.64% -0.01%
==========================================
Files 204 204
Lines 19154 19159 +5
==========================================
+ Hits 18895 18899 +4
- Misses 259 260 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Encode run_id with url.QueryEscape, preserving escaping and omission of empty values while removing an unreachable addOptions error branch.
|
Updated to remove the unreachable error branch. Local coverage is now 100%; tests and lint pass. 🙂 |
Actually, we have |
Thanks for the pointer! I’ll switch back to addOptions and cover the error path with testBadOptions! |
Use the shared query encoder for ConfigApplyStatus to match other enterprise endpoints, retaining run_id query encoding and an empty GET body.
|
Hi, @gmlewis. Restored addOptions in 91ef32a for consistency. I couldn’t trigger this error branch with Tests and lint pass locally. |
|
Ah, sorry I led you astray, but let's please keep this version and I'll investigate locally. |
No worries at all! I’ve been using I’ll also keep looking into the patch coverage issue on my side and share anything useful I find. Thanks for taking the time to investigate! |
Not-Dhananjay-Mishra
left a comment
There was a problem hiding this comment.
LGTM.
Just for your information, ConfigApplyOptions is also passed as the request body to ConfigApply. Since this may undergo a breaking change in the future, as it is passed by pointer, we can simply change the json tag to url tag at that time and get rid of the internal query building logic.
Thanks for the review! Makes sense to revisit this when ConfigApplyOptions gets refactored. Happy to help with that or other fixes too. Feel free to point me to anything I could pick up! 🙂 |
ConfigApplyStatussendsrun_idin a JSON request body, but the GHES API defines it as a query parameter. Encode it in the URL and send an empty GET body, preserving the existing method signature andConfigApplyJSON behavior.Validation:
script/fmt.sh,script/test.sh, andscript/lint.sh(includingscript/generate.sh --check). Regression tests cover ordinary and escaped run IDs, nil/empty options, and an empty GET body.