Skip to content

Remove NeedsExpansion from syncer state.#703

Open
ggreer wants to merge 1 commit intomainfrom
ggreer/remove-needs-expansion
Open

Remove NeedsExpansion from syncer state.#703
ggreer wants to merge 1 commit intomainfrom
ggreer/remove-needs-expansion

Conversation

@ggreer
Copy link
Copy Markdown
Contributor

@ggreer ggreer commented Feb 24, 2026

Now that grant expansion annotations are moved into their own column, we don't need to keep track of this. It's cheap to check whether any grants need expanding, so always do it unless the syncer has been told otherwise.

Summary by CodeRabbit

  • Refactor
    • Simplified internal synchronization logic and state management for improved efficiency.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6748b17 and 9d6b33d.

📒 Files selected for processing (2)
  • pkg/sync/state.go
  • pkg/sync/syncer.go
💤 Files with no reviewable changes (1)
  • pkg/sync/state.go

Walkthrough

The changes remove the needsExpansion feature from the public State interface and internal state struct. The syncer is refactored to eliminate dependency on this flag, replacing flag-based logic with earlier checkpointing and reliance on the dontExpandGrants flag for controlling grant expansion behavior.

Changes

Cohort / File(s) Summary
State struct cleanup
pkg/sync/state.go
Removed NeedsExpansion() and SetNeedsExpansion() methods from the State interface, deleted the needsExpansion field from the state struct, and removed the NeedsExpansion field from serializedToken. Eliminated all marshal/unmarshal code paths referencing this field.
Syncer control flow refactoring
pkg/sync/syncer.go
Removed needs_expansion flag exposure from the resumed sync log. Replaced flag-based logic in InitOp path with early checkpointing when onlyExpandGrants is true. Simplified grant-expansion gating to only check dontExpandGrants instead of state flag. Removed logic that set the flag when encountering GrantExpandable annotations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A flag hops away, no longer needed,
State grows lighter as code is weeded,
Checkpoints arrive now, swift and keen,
Control flows simpler, pure, and clean! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: removing the NeedsExpansion flag from syncer state, which is the primary focus of the changeset across both modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ggreer/remove-needs-expansion

Comment @coderabbitai help to get the list of available commands and usage tips.

@kans
Copy link
Copy Markdown
Contributor

kans commented Feb 24, 2026

I think we want this functionality
in #662.

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