Repository navigation
internal: move the user-agent engine tag to the callers of PullResourcesState - #6808
Merged
Merged
Conversation
…rcesState Move the `useragent.InContext(ctx, "engine", ...)` call out of `PullResourcesState` and into each of its three callers — `process.go`, `dashboard.go`, and `genie_space.go` — where it now runs immediately after the function returns and its error check passes. The placement is behavior-preserving: `PullResourcesState` makes no outgoing API calls after setting the tag (only a local `atomicfile.Write`), so the same requests that carried the engine dimension before still carry it, and the same early requests that predate state resolution still lack it. The `acceptance/bundle/user_agent` suite confirms this: all goldens are unchanged. `PullResourcesState` was the wrong home for this concern — it is a state-reading helper, not the right place to decide what tags future API calls should carry. The callers own the context lifecycle and are the natural place to annotate it. No new acceptance tests are added for the generate commands: both `dashboard --resource` and `genie-space --resource` require a previously deployed state to record meaningful requests, which demands heavy cloud setup and is out of scope for a local-only regression test. Deploy UA coverage already exists in `acceptance/bundle/user_agent/simple`. Co-authored-by: Isaac <no-reply@databricks.com>
…rom PullResourcesState PullResourcesState no longer mutates the context (the engine user-agent tag moved to its callers), so it returns only *StateDesc now. The dashboard and genie-space generate commands had byte-identical state-loading blocks; extract them into one helper so the engine tag is set in a single place. Co-authored-by: Isaac <no-reply@databricks.com>
denik
enabled auto-merge
September 23, 2026 10:09
Collaborator
Integration test reportCommit: 097f400
Top 3 slowest tests (at least 2 minutes):
|
janniklasrose
approved these changes
Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
The user-agent
enginedimension used to be set insidePullResourcesState. Move it to the callers (bundle deploy/planin process.go and the twobundle generateresource paths), so the engine tag lives next to where the resolved engine is known.Follow-on cleanups from that move:
PullResourcesStateno longer mutates the context, so it now returns only*StateDescinstead of(context.Context, *StateDesc).generate dashboardandgenerate genie-spacehad byte-identical state-loading blocks (initialize, resolve engine, pull state, tag engine, load). Extracted into oneloadStateForGeneratehelper so the tag is set in a single place.Why
Prep for #6749 (move terraform→direct state migration before deploy): that PR needs the engine tag set from the resolved (post-migration) engine, so consolidating the tagging off main keeps its diff focused on the behavior change.
Tests
Behavior-preserving.
acceptance/bundle/user_agentasserts theengine/tag on every recorded request for both engines; it plus thegenerateandstatesuites and the generate unit tests pass with no golden changes.This pull request and its description were written by Isaac.