Skip to content

feat(annotation-queues): add annotation queue SDK support (HYBIM-882)#103

Open
etserend wants to merge 3 commits into
mainfrom
feat/HYBIM-882-port-e34a5b1
Open

feat(annotation-queues): add annotation queue SDK support (HYBIM-882)#103
etserend wants to merge 3 commits into
mainfrom
feat/HYBIM-882-port-e34a5b1

Conversation

@etserend

Copy link
Copy Markdown
Contributor

Summary

Ports upstream commit e34a5b19 from rungalileo/galileo-python with all galileo→splunk_ao rebrand translations applied.

Changes

  • src/splunk_ao/annotation_queues.py — New 1175-line module: AnnotationQueues SDK class, AnnotationQueue, AnnotationField, AnnotationQueueUser, AnnotationQueueRecordSelector dataclasses, and 16 standalone functions (create_annotation_queue, get_annotation_queue, list_annotation_queues, update_annotation_queue, delete_annotation_queue, share_annotation_queue, add_records_to_annotation_queue, etc.)
  • src/splunk_ao/__init__.py — Export all 22 new annotation queue symbols
  • src/splunk_ao/integration.py — Switch dispatch from IntegrationNameIntegrationProvider; use integration_db.provider field (upstream refactor)
  • src/splunk_ao/project.py — Remove stale created_by docstring references (server-managed field)
  • src/splunk_ao/provider.py — Rename _get_integration_name_get_integration_provider, add LLMIntegration import for models endpoint
  • Hand-placed generated files (not produceable by regen workflow — backend spec dropped /annotation_queues/query):
    • resources/api/annotation_queue/query_annotation_queues_annotation_queues_query_post.py
    • resources/models/list_annotation_queue_params.py
  • tests/test_integration.py — Update create_mock_integration to set mock.provider alongside mock.name (required by the integration_db.provider-based dispatch introduced in this port)

Upstream reference

rungalileo/galileo-python@e34a5b19 — feat: Add Annotation Queue SDK

Test results

1667 passed, 140 skipped — 0 failures

🤖 Generated with Claude Code

etserend and others added 3 commits July 20, 2026 14:00
Port upstream commit e34a5b19 from rungalileo/galileo-python.

- Add src/splunk_ao/annotation_queues.py — full AnnotationQueues SDK class
  with create/get/list/update/delete/share/query operations, AnnotationField
  management, and record add/remove/search support
- Export all AnnotationQueue* symbols from splunk_ao/__init__.py
- integration.py: switch from IntegrationName → IntegrationProvider,
  use provider_name from integration_db.provider field
- project.py: remove stale created_by docstring references (server-managed)
- provider.py: rename _get_integration_name → _get_integration_provider,
  add LLMIntegration import for models endpoint

Note: query_annotation_queues_annotation_queues_query_post generated module
is missing from resources/ — needs regen workflow run to produce it from
the existing openapi.yaml definition.

Upstream: rungalileo/galileo-python@e34a5b1

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…on test mock

Hand-place generated API/model files that the regen workflow cannot produce
because the live backend OpenAPI spec no longer exposes /annotation_queues/query:
- resources/api/annotation_queue/query_annotation_queues_annotation_queues_query_post.py
- resources/models/list_annotation_queue_params.py (+ register in models/__init__.py)

Fix test_integration.py mock: set mock.provider alongside mock.name so
_to_provider() can dispatch to the correct Provider subclass (introduced when
porting e34a5b19 which switched dispatch to integration_db.provider).

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

- integration.py: rename _get_integration_by_name param integration_name → integration_provider
- provider.py: rename UnconfiguredProvider.__init__ param integration_name → integration_provider
- project.py: restore missing type_ field sync in save()
- annotation_queues.py: replace Galileo platform reference in AnnotationQueue docstring
@etserend
etserend force-pushed the feat/HYBIM-882-port-e34a5b1 branch from 4c132d0 to 3a79d96 Compare July 20, 2026 22:28
@etserend
etserend marked this pull request as ready for review July 20, 2026 22:34
@fercor-cisco

Copy link
Copy Markdown
Collaborator

🤖 This review was auto-generated by Claude Code and reviewed by a human before posting.

Assessment: faithful port of the production code, with two issues to resolve before merge

This PR ports upstream galileo-python commit e34a5b1 ("feat: Add annotation queue SDK support (#623)"). I compared the hand-ported business-logic files patch-for-patch (the autogenerated resources/ client + openapi.yaml are excluded here and flow in via the separate "Update API Client" automation PRs).

✅ What's faithful (no behavior change)

File Assessment
annotation_queues.py (+1175) Byte-identical to upstream after galileosplunk_ao renames — zero non-rename diffs.
__init__.py (+44) Exact port of the new annotation-queue exports + __all__ entries.
provider.py Faithful: _get_integration_name_get_integration_provider, IntegrationNameIntegrationProvider, LLMIntegration(integration_provider.value) wrapping — all match upstream.
integration.py Faithful: _to_provider keys off integration_db.provider instead of str(name); convenience lookup matches on _get_integration_provider().value; display name preserved separately.

⚠️ Issue 1 — project.py: a behavior change misattributed to this commit

The PR adds the response.type_ sync block to Project.save():

if not isinstance(response.type_, Unset):
    attrs["type"] = response.type_

This block does not belong to e34a5b1. In e34a5b1 it is unchanged context. git log -S shows it was introduced on 2026-03-26 by commit 5d473ed ("feat: implement Project.save() and Dataset.save() (#503)") — ~3.5 months earlier.

What e34a5b1 actually changed in save() was a single line (the request body):

- body = ProjectUpdate(name=self.name, type_=self.type)
+ body = ProjectUpdate(name=self.name)

…and on the splunk-ao side that line was already correct on main. So:

body = ProjectUpdate(...) response.type_ sync block
galileo @ e34a5b1 name=self.name present since March (5d473ed)
splunk-ao main (pre-PR) name=self.name ✅ already missing
splunk-ao PR branch name=self.name (untouched) added by this PR

The net effect is that this PR back-fills a change from 5d473ed (an earlier commit in the sequence) while labeling it as part of the e34a5b1 port. Project.save() now updates the local type attribute from the server response — a genuine behavior change that did not exist on main, introduced under the wrong commit's banner and without the 5d473ed test that would validate it.

This also reveals that the commit sequence is already out of order upstream of this PR: main has the post-e34a5b1 body but lacks the older March block, which means an earlier port skipped or partially cherry-picked 5d473ed. Recommendation: move the response.type_ block (and ideally the rest of 5d473ed + its tests) into a separate port ordered before this one, and keep this PR to e34a5b1's actual delta.

⚠️ Issue 2 — the test port is incomplete

Upstream e34a5b1 added substantial test coverage that this PR omits:

  1. Missing test_annotation_queues.py (1053 lines). 1175 lines of new production code ship with zero accompanying tests.
  2. test_integration.py incomplete. Upstream (+71) added a regression test test_property_matches_provider_when_display_name_differs that specifically guards the provider-slug-vs-display-name behavior change in integration.py. It was not ported. Upstream also reworked create_mock_integration to take distinct provider and name params; the PR instead just adds mock.provider = name, so name and provider are always identical in the mocks — which defeats the point of the upstream refactor and can't exercise the new code path.
  3. test_project.py not ported. Upstream added assertions that the ProjectUpdate body serializes to exactly {"name": ...}.

🔸 Minor

  • UnconfiguredProvider._integration_name_integration_provider (private str attr) is renamed in this PR but not touched by e34a5b1. Internal and self-consistent, so no behavior change — just a divergence from the source diff.

Bottom line

Production-code behavior for the annotation-queue feature is a faithful, safe port. But before merge: (1) the project.py response.type_ change should be split out and attributed to 5d473ed, and (2) the omitted tests — especially test_annotation_queues.py and the display_name_differs regression test — should be ported so the new behavior is actually covered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants