feat(headers): rename X-Galileo-SDK → Splunk-AO-SDK and update value prefix (HYBIM-809)#86
feat(headers): rename X-Galileo-SDK → Splunk-AO-SDK and update value prefix (HYBIM-809)#86etserend wants to merge 1 commit into
Conversation
…prefix (HYBIM-809) - Update codegen template to emit Splunk-AO-SDK instead of X-Galileo-SDK - Change header value prefix from galileo-python/ to splunk-ao/ in headers_data.py - Regenerate all API client files from updated template (rebased on #83) - Update patch_http_validation_error.py regex to match new generator output - Unskip test_api_headers.py and update all galileo-python/ assertions to splunk-ao/ - Update test_traces_client_headers.py header value assertion to splunk-ao/ Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
462cf14 to
355cf7d
Compare
fercor-cisco
left a comment
There was a problem hiding this comment.
🤖 This review was generated by the Astra agent (claude-opus-4-8). It may contain mistakes.
Verdict: needs_discussion — Header rename itself is correct and complete, but the PR bundles a massive, undisclosed codegen-format regeneration (1229 files) that inflates the diff and raises a reproducibility concern.
General Comments
- 🟠 major (design): Scope mismatch. The PR description says this renames the SDK header across ~208 API client files, but the actual diff is 1229 files / +28,375 / -27,358. The bulk of it is an unrelated regeneration of every model in
src/splunk_ao/resources/models/: each was rewritten fromUnion[A, B]to PEP 604A | Bsyntax withfrom __future__ import annotationsadded. That output difference comes from theopenapi-python-clientversion in the author's local environment differing from what producedmain— but the generator is still pinned atopenapi-python-client = "^0.26.1"inpyproject.tomlandpoetry.lockis not in this PR. Consequences: (1) the header rename — the actual intent — is buried in ~55k lines of noise, making meaningful review impractical; (2) reproducibility drift: the next person who runsauto-generate-api-client.shwith the pinned toolchain may regenerate output that reverts all of this, producing another giant diff. Please either split the codegen-format change into its own PR (and pin the generator version that produces it so regen is stable), or regenerate using the toolchain already pinned in the repo so this PR contains only the header rename. At minimum, confirm with the team that the format flip is intended and update the PR description to disclose it. - 🟡 minor (testing): The PR was validated with
ruff checkonly onsrc/splunk_ao/utils/headers_data.pyandcodegen_templates/, but the edited test files were not linted (see unusedimport pytestin tests/test_api_headers.py). Runruff check tests/before merge to confirm the test edits don't fail CI lint.
Follow-ups
Suggested follow-up work that could be tracked as Shortcut stories:
scripts/patch_http_validation_error.py:20-21: The usage docstring still references the pre-rebrand pathsrc/galileo/resources/models/http_validation_error.py. The actual invocation inscripts/auto-generate-api-client.shtargetssrc/splunk_ao/resources/.... Update the docstring example to the new path to avoid confusion (pre-existing, not introduced by this PR).src/splunk_ao/config.py:34-34:config_filename = "galileo-python-config.json"still uses the old branding for the on-disk config file. Not in scope for the header rename, but worth tracking as part of the broader Galileo→Splunk-AO rebrand.
| @@ -2,8 +2,6 @@ | |||
|
|
|||
| import pytest | |||
There was a problem hiding this comment.
🟡 minor (testing): import pytest is now unused — the only prior use was the @pytest.mark.skip decorator this PR removed. This will trip ruff/flake8 F401 if the test suite is linted in CI. Remove the import.
| import pytest | |
| from importlib.metadata import PackageNotFoundError |
🤖 Generated by the Astra agent
Independent review of the codegen diffI verified the Astra review's claims against the local branch. Summary: the header rename is correct and complete, the bulk is mechanical reformatting, but there's a real generator-version mismatch and one real lint failure. Header rename (the actual intent) — correct ✅
The bulk (1224 of 1229 files) is pure codegen reformatting
Root cause: generator version mismatch (confirmed, and worse than described)
That version jump is what flipped the output to PEP 604. Consequence: anyone who runs Real lint failure (confirmed)Removing RecommendationCleanest fix: bump the pin to match reality — set (Analysis by Claude Code, verified against the branch locally.) |
Summary
X-Galileo-SDKtoSplunk-AO-SDKon all client requestsgalileo-python/tosplunk-ao/to match the rebranded package namecodegen_templates/endpoint_module.py.jinja) as the single source of truth, then regenerates all 208 API client filestests/test_api_headers.py(was markedskippending this PR)The server already accepts both header names for backward compatibility (HYBIM-729).
Changes
codegen_templates/endpoint_module.py.jinjaX-Galileo-SDK→Splunk-AO-SDKsrc/splunk_ao/utils/headers_data.pygalileo-python/→splunk-ao/src/splunk_ao/resources/(208 files)scripts/patch_http_validation_error.pytests/test_api_headers.pypytest.mark.skip; update assertionstests/test_traces_client_headers.pyNote on
patch_http_validation_error.pyThe
openapi-python-clientgenerator changed its output format for theHTTPValidationError.from_dictmethod (wrapped the loop inif _detail is not UNSET:instead of using_detail or []). The patch script regex was updated to match the new pattern — this is unrelated to the header rename but was a blocker for runningauto-generate-api-client.sh.Test plan
poetry run pytest tests/test_api_headers.py tests/test_traces_client_headers.py -v— 7 passedpoetry run ruff check src/splunk_ao/utils/headers_data.py codegen_templates/— cleanUpstream ticket: HYBIM-809
🤖 Generated with Claude Code