Skip to content

🐛 fix(config): synchronize runtime-written github tri-state settings with client hook reads - #12283

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-12279
Oct 16, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-12279

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Race

The dashboard GitHub settings save (applyGitHubConfigUpdate, and the governor save for self_authorization_hold) writes cfg.GitHub.GraphQLPRBatch, GraphQLPRBatchPageSize, PRDetailTTLS, AppAuthoredPRs, AppSignedCommits and SelfAuthorizationHold at runtime under the dashboard-local githubConfigMu. GitHub client hooks (src/cmd/hive/github_client_config.go) read the same fields through live closures on client goroutines with no lock, which is a data race that -race reports.

Fix

Follows the existing repoPauseMu / writeSurfaceMu pattern in pkg/config:

  • New githubLiveMu RWMutex plus Config.UpdateGitHubLive(func(*GitHubConfig)) for writers.
  • Lock-guarded live accessors (GitHubGraphQLPRBatchEnabled, GitHubGraphQLPRBatchPageSize, GitHubPRDetailTTL, GitHubAppAuthoredPRsEnabled, GitHubAppSignedCommitsEnabled, GitHubSelfAuthorizationHoldEnabledAtLevel). Each one copies only the guarded fields under RLock and delegates to the existing GitHubConfig value methods, so the resolved values stay the same.
  • The dashboard writers (api_config.go, api_governor.go) now go through UpdateGitHubLive. The client hooks, SelfAuthorizationHoldEnabledForRepoAtLevel and EffectiveAIAuthor read through the locked accessors.

Tests

src/pkg/config/github_live_test.go:

  • A concurrent writer/reader test that -race fails on if either side skips the lock.
  • A parity test that pins each locked accessor to the value method it wraps.

Closes #12279

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

…with client hook reads

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <scanner@hive.kubestellar.io>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 16, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kellyaa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#12158 ✨ review: add review.shadow to record would_have_held for the review gate same files src/pkg/config/config.go

@hivecommons-hive
hivecommons-hive Bot merged commit 7bc97b9 into v5 Oct 16, 2026
70 of 71 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-12279 branch October 16, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review backlog (correctness): New runtime-written github tri-state pointers are read lock-free by client hooks

0 participants