Skip to content

fix: stabilize scm observer dispatch#2531

Open
VenkataSakethDakuri wants to merge 1 commit into
AgentWrapper:mainfrom
VenkataSakethDakuri:agent/fix-scm-observer-dispatch
Open

fix: stabilize scm observer dispatch#2531
VenkataSakethDakuri wants to merge 1 commit into
AgentWrapper:mainfrom
VenkataSakethDakuri:agent/fix-scm-observer-dispatch

Conversation

@VenkataSakethDakuri

@VenkataSakethDakuri VenkataSakethDakuri commented Jul 8, 2026

Copy link
Copy Markdown
Contributor
  • Make SCM observer dispatch order deterministic so lifecycle notifications are stable across polls.
  • Order observations by session, then PR number, then key to avoid randomized map iteration.

@whoisasx whoisasx 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.

Thanks for making the lifecycle dispatch order deterministic. The sorting direction itself looks fine, but there is one regression in the same patch: tracked PR repo reconstruction now drops Owner/Name, while the GitHub provider still needs those fields for REST/GraphQL calls.

Once that tuple is normalized correctly again, this should be good to go.

return ports.SCMRepo{}, false
}
return ports.SCMRepo{Provider: pr.Provider, Host: pr.Host, Owner: owner, Name: name, Repo: pr.Repo}, true
return ports.SCMRepo{Provider: pr.Provider, Host: pr.Host, Repo: pr.Repo}, true

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 regresses tracked PR refreshes because the GitHub provider still builds REST/GraphQL requests from SCMRepo.Owner and SCMRepo.Name. Returning only Provider, Host, and Repo means a persisted PR such as upstream/api can later be refreshed with empty owner/name fields, so guard/fetch/review calls target an invalid repository and the observer stops updating that PR. Can we keep parsing pr.Repo into owner/name here, or centralize that normalization before provider calls?

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