Skip to content

feat(headers): rename X-Galileo-SDK → Splunk-AO-SDK and update value prefix (HYBIM-809)#86

Merged
etserend merged 8 commits into
mainfrom
feat/HYBIM-809-rename-sdk-header
Jul 24, 2026
Merged

feat(headers): rename X-Galileo-SDK → Splunk-AO-SDK and update value prefix (HYBIM-809)#86
etserend merged 8 commits into
mainfrom
feat/HYBIM-809-rename-sdk-header

Conversation

@etserend

@etserend etserend commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Renames the outgoing SDK HTTP header key from X-Galileo-SDK to Splunk-AO-SDK on all client requests
  • Updates the header value prefix from galileo-python/ to splunk-ao/ to match the rebranded package name
  • Updates codegen template (codegen_templates/endpoint_module.py.jinja) as the single source of truth, then regenerates all 208 API client files
  • Unskips tests/test_api_headers.py (was marked skip pending this PR)

The server already accepts both header names for backward compatibility (HYBIM-729).

Changes

File Change
codegen_templates/endpoint_module.py.jinja X-Galileo-SDKSplunk-AO-SDK
src/splunk_ao/utils/headers_data.py value prefix galileo-python/splunk-ao/
src/splunk_ao/resources/ (208 files) regenerated from updated template
scripts/patch_http_validation_error.py updated regex to match new generator output
tests/test_api_headers.py remove pytest.mark.skip; update assertions
tests/test_traces_client_headers.py update header value assertion
tests/test_logger_batch.py, tests/test_openai_agents.py update stale LogStreamsAgentStreams mock patch targets (merge-artifact correction from the LogStream→AgentStream rename in #100)

Note on patch_http_validation_error.py

The openapi-python-client generator changed its output format for the HTTPValidationError.from_dict method (wrapped the loop in if _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 running auto-generate-api-client.sh.

Test plan

  • poetry run pytest tests/test_api_headers.py tests/test_traces_client_headers.py -v — 7 passed
  • poetry run ruff check src/splunk_ao/utils/headers_data.py codegen_templates/ — clean
  • CI full test suite

Upstream ticket: HYBIM-809

🤖 Generated with Claude Code

@etserend
etserend force-pushed the feat/HYBIM-809-rename-sdk-header branch from 462cf14 to 355cf7d Compare July 16, 2026 18:17
@etserend
etserend marked this pull request as ready for review July 16, 2026 21:58

@fercor-cisco fercor-cisco left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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 from Union[A, B] to PEP 604 A | B syntax with from __future__ import annotations added. That output difference comes from the openapi-python-client version in the author's local environment differing from what produced main — but the generator is still pinned at openapi-python-client = "^0.26.1" in pyproject.toml and poetry.lock is 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 runs auto-generate-api-client.sh with 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 check only on src/splunk_ao/utils/headers_data.py and codegen_templates/, but the edited test files were not linted (see unused import pytest in tests/test_api_headers.py). Run ruff 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 path src/galileo/resources/models/http_validation_error.py. The actual invocation in scripts/auto-generate-api-client.sh targets src/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.

Comment thread tests/test_api_headers.py Outdated
@fercor-cisco

Copy link
Copy Markdown
Collaborator

Independent review of the codegen diff

I 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 ✅

  • Template: X-Galileo-SDKSplunk-AO-SDK
  • Value prefix: galileo-python/splunk-ao/ in headers_data.py
  • Propagated to all API files; 0 files still contain X-Galileo-SDK, 243 now contain Splunk-AO-SDK
  • Tests unskipped and assertions updated

The bulk (1224 of 1229 files) is pure codegen reformatting

  • 983 model files each got from __future__ import annotations added
  • 18,566 Union references removed, 0 added → wholesale Union[A, B] → PEP 604 A | B conversion
  • No logic changes in sampled files — just type-annotation syntax. types.py module-level X | Y assignments are runtime-safe since requires-python = ">=3.11".

Root cause: generator version mismatch (confirmed, and worse than described)

  • pyproject.toml pins openapi-python-client = "^0.26.1" → resolves to >=0.26.1,<0.27.0
  • poetry.lock pins exactly 0.26.1
  • The environment that produced this PR runs 0.29.0 — outside both the caret range and the lockfile

That version jump is what flipped the output to PEP 604. Consequence: anyone who runs auto-generate-api-client.sh with the pinned toolchain (0.26.1) will regenerate the old Union[...] output and revert all ~28k lines. poetry.lock/pyproject.toml are not in this PR, so the repo's declared toolchain and the committed generated code are now inconsistent. The patch_http_validation_error.py regex change is a symptom of the same bump (0.29.0 changed the from_dict output shape) — it's correct, but only unblocks generation for 0.29.0.

Real lint failure (confirmed)

Removing pytestmark = pytest.mark.skip(...) from tests/test_api_headers.py left import pytest as the only remaining reference — it's now unused. ruff check tests/test_api_headers.py reports F401 (I ran it locally). CI lint will fail. The PR's test plan only ran ruff on src/...headers_data.py and codegen_templates/, so tests/ was missed.

Recommendation

Cleanest fix: bump the pin to match reality — set pyproject.toml to ^0.29.0 (or tighter) and refresh poetry.lock, and include both in this PR. That makes the large diff intentional and reproducible instead of accidental drift. If keeping this PR small is preferred, regenerate with 0.26.1 so the diff is only the header rename, and split the syntax modernization into its own PR. Either way, drop the unused import pytest.

(Analysis by Claude Code, verified against the branch locally.)

@etserend

etserend commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Fixed both issues from the review:

  • Removed unused import pytest from test_api_headers.py
  • Fixed stale src/galileo/ path in patch_http_validation_error.py docstring

On the large diff: The Union → PEP 604 and from __future__ import annotations changes come from openapi-python-client 0.29.0, which is being pinned in PR #94. Once #94 merges, the toolchain and the generated code in this PR will be in sync. Merging #86 before #94 (or together) avoids regenerating everything twice.

etserend and others added 2 commits July 20, 2026 12:47
…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>
…(HYBIM-809)

- Drop unused `import pytest` from test_api_headers.py (F401, flagged by reviewer)
- Update patch_http_validation_error.py docstring example path from
  src/galileo/ to src/splunk_ao/ (pre-existing stale reference)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@etserend
etserend force-pushed the feat/HYBIM-809-rename-sdk-header branch from e004d4c to 3e0242e Compare July 20, 2026 17:47
@etserend
etserend requested a review from fercor-cisco July 21, 2026 19:00
@fercor-cisco

Copy link
Copy Markdown
Collaborator

Review feedback status — addressed ✅

Checked the current branch state against the Astra review from 2026-07-17. Follow-up commit 3e0242e plus a re-regeneration handled the feedback:

Review finding Status Evidence
🟠 major — Scope mismatch: 1229 files with an undisclosed Union[A,B]A | B regeneration of every model Fixed Diff is now 245 files (down from 1229); 0 resources/models/ files remain. Regenerated with the repo-pinned toolchain, so only the header rename + intended files remain.
🟡 minor — Unused import pytest in tests/test_api_headers.py (F401) Fixed Import is now from importlib.metadata import PackageNotFoundError — the suggested replacement.
🟡 minor — Lint tests/ before merge Addressed The flagged F401 import was removed.
🔵 follow-up — Stale docstring path src/galileo/resources/... in patch_http_validation_error.py Fixed Now reads src/splunk_ao/resources/models/http_validation_error.py.
🔵 follow-up — config.py still uses galileo-python-config.json ⚠️ Not done — explicitly flagged as out of scope for the header rename; candidate for separate rebrand tracking, not a merge blocker.

All blocking and actionable comments are resolved. The one untouched item (config.py config filename) was called out by the reviewer as out of scope.

🤖 Generated with Claude Code

etserend and others added 3 commits July 23, 2026 16:13
…lunk-ao-config.json (HYBIM-809)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…r rename

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@fercor-cisco fercor-cisco left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 This review was generated by the Astra agent (claude-opus-4-8). It may contain mistakes.

Verdict: request_changes — Header rename is correct and complete, but the diff includes an undisclosed, out-of-scope config-filename change that silently orphans existing on-disk config and contradicts the migration docs.

General Comments

  • 🟡 minor (design): Scope: the PR description states this PR is purely the X-Galileo-SDKSplunk-AO-SDK header rename (HYBIM-809), but the diff also contains two unrelated changes that aren't mentioned: (1) src/splunk_ao/config.py renames the on-disk config filename (see line comment), and (2) tests/test_logger_batch.py / tests/test_openai_agents.py change the mock target LogStreamsAgentStreams. The test-mock change is a legitimate correction (the source already imports AgentStreams), but bundling undisclosed changes into a mechanical codegen PR makes review harder and risks shipping behavior changes unnoticed. Please either call these out explicitly in the description or split them out.

Follow-ups

Suggested follow-up work that could be tracked as Shortcut stories:

  • scripts/patch_http_validation_error.py:40-64: The _LOOP_RE regex is now hard-coded to the openapi-python-client 0.29+ output shape (if _detail is not UNSET: block). This couples the repo's post-generation patch step to generator 0.29+. Per the earlier PR discussion, the toolchain pin (pyproject.toml/poetry.lock) is being bumped to 0.29.0 in PR #94 but is not part of this PR. Ensure #94 lands together with or before this so the declared toolchain and the committed generated code stay reproducible; otherwise regenerating with the currently-pinned 0.26.1 will revert the output and break this patch script (exit 2, template drift).

Comment thread src/splunk_ao/config.py Outdated
…on to splunk-ao-config.json (HYBIM-809)"

This reverts commit 2c43a8c.
Comment thread src/splunk_ao/config.py

# Config file for this project.
config_filename: str = "splunk-ao-config.json"
config_filename: str = "galileo-python-config.json"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll create a ticket for us to rename this as well.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etserend
etserend merged commit 60928d5 into main Jul 24, 2026
13 checks passed
@etserend
etserend deleted the feat/HYBIM-809-rename-sdk-header branch July 24, 2026 15:04
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants