Repository navigation
fix(tempo): only collect and extract the team of a team scope - #9319
Merged
Merged
Conversation
collect-teams fetched every team of the Tempo instance with
connection-wide raw params, and extract_teams turned each of them into
a TempoTeam scope with ScopeConfigId 0. Since the batch save deletes
rows by raw params first, one team scope's pipeline re-created every
team scope of the connection: teams that were never selected became
scopes and the selected ones lost their scope config.
- Scope the team raw data and extracted rows per team ({ConnectionId,
TeamId}, like TempoTeam.ScopeParams and the worklog collector).
- collect-teams: request only the scope's team with teamIds, and drop
the updatedFrom filter, which GET /4/teams doesn't support, along
with the incremental collector state, so each run replaces the raw
rows instead of appending them again.
- extract_teams: skip other teams and keep the existing scope config.
Closes apache#9318
Generated-by: Claude Code (Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Shivam Sharma <192242476+ShivamSharma43@users.noreply.github.com>
This was referenced Nov 3, 2026
klesh
approved these changes
Nov 6, 2026
klesh
left a comment
Contributor
There was a problem hiding this comment.
LGTM
Thanks for your contribution.
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.
Summary
_tool_tempo_teamsis both the scope table and the output ofextract_teams, but the team subtasks worked on the whole connection:collect-teamsfetched every team of the Tempo instance with raw params{"ConnectionId":1,"TeamId":0}, andextract_teamsturned each one into aTempoTeamwithScopeConfigId0. The extractor's batch save deletes rows with the same raw params before inserting, so one team scope's pipeline re-created every team scope of the connection:scope_config_idreset to 0);Changes (
backend/plugins/tempo/tasks):team_collector.go: raw params are now{ConnectionId, TeamId}, matchingTempoTeam.ScopeParams()and the worklog collector, so extracting one team scope only replaces that team's row. The request filters on the scope's team withteamIds. TheupdatedFromparameter is dropped becauseGET /4/teamsdoesn't support it (the Tempo OpenAPI spec listsoffset,limit,teamMembers,name,teamIds). The collector is now a plainApiCollector, so each run replaces the raw rows; before, an incremental run fetched all teams again and appended them.team_extractor.go: skips teams other than the scope's team (whenteamIdis set) and keeps thescope_config_idof existing team scopes.teamIdoption (plain connection-level task), all teams are still collected and extracted, as before.Rows that earlier runs added with the old connection-wide params are left untouched (they can't be told apart from scopes the user added on purpose), so no migration. Users can remove the unwanted teams from the connection's data scopes, and they won't come back.
Does this close any open issues?
Closes #9318
Screenshots
N/A
Other Information
TestBuildTeamQuery(teamIdsset, noupdatedFrom) andTestExtractTeam(other teams skipped, scope config kept).TestTeamScopeExtraction: two team scopes with scope configs, team 71 extracted. Team 71 is refreshed and keepsscope_config_id = 3, and team 17 is untouched. It fails onmain.go test ./plugins/tempo/...and the tempo e2e tests (E2E_DB_URLon a local PostgreSQL 18): pass.go vet,gofmtandgolangci-lint run ./plugins/tempo/...: clean.extract_teams.pr-type/bug-fix.Generated-by:trailer per the ASF generative tooling guidance.🤖 Generated with Claude Code