Skip to content

feat: add dynamic context sync from SSO account/role inventory - #239

Closed
youngjinjung-linq wants to merge 1 commit into
DevopsArtFactory:mainfrom
youngjinjung-linq:feature/issue-135-context-sync
Closed

feat: add dynamic context sync from SSO account/role inventory#239
youngjinjung-linq wants to merge 1 commit into
DevopsArtFactory:mainfrom
youngjinjung-linq:feature/issue-135-context-sync

Conversation

@youngjinjung-linq

Copy link
Copy Markdown

Summary

Implements #135: contexts can now be generated and refreshed from SSO-visible accounts and roles instead of being managed only by hand.

  • New unic context sync [base-context] command. When only one SSO base context exists the argument can be omitted; with several, the command lists the candidates.
  • For every SSO-visible account/role pair without a configured context, sync adds a concrete SSO context named <base>-<account-id>-<role> (same naming as context setup), inheriting the base context's regions.
  • Generated contexts are marked with sync_source: <base-context> in config.yaml, keeping them distinguishable from manually managed contexts.
  • Sync never rewrites existing contexts (manual or synced) — matching pairs are reported as kept.
  • Sync-managed contexts whose account/role disappeared from SSO are reported as orphans and removed only with --prune; the current context selection is cleared if it pointed at a pruned entry.
  • --dry-run prints the full plan (add:/orphan: lines plus a summary) without writing config.
  • SSO login reuses the existing AWS CLI token cache and prompts only when needed, same as context setup.

Testing

  • go test ./... passes: plan building (add/keep/orphan classification), apply with and without --prune, config RemoveContexts, CLI flag pass-through, dry-run, and base-context resolution errors are covered.
  • make build passes.

Docs

  • README: context sync usage, behavior notes, and the sync_source optional field documented.
  • docs/architecture.en.md / docs/architecture.ko.md: internal/cli command list updated.

Closes #135

Add `unic context sync [base-context]` which lists the accounts and
roles visible to an SSO base context and adds a sync-managed concrete
context for each new pair, inheriting the base context's regions.
Generated contexts carry a `sync_source` marker so they stay
distinguishable from manual ones: existing contexts are never
rewritten, and sync-managed contexts whose account/role disappeared
from SSO are reported as orphans and removed only with --prune.
--dry-run prints the plan without writing config.

Closes DevopsArtFactory#135

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BFhLrnpVxivu62cC3k9NZB
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@youngjinjung-linq, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 773123bc-6fb6-4d8e-a2d8-db9533fc73a9

📥 Commits

Reviewing files that changed from the base of the PR and between 744b139 and f42f5ce.

📒 Files selected for processing (8)
  • README.md
  • docs/architecture.en.md
  • docs/architecture.ko.md
  • internal/auth/sync.go
  • internal/auth/sync_test.go
  • internal/cli/context.go
  • internal/cli/context_sync_test.go
  • internal/config/config.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@YoungJinJung

Copy link
Copy Markdown
Contributor

Recreated as #253 from an in-repo branch under the maintainer account; this PR is superseded.

@youngjinjung-linq
youngjinjung-linq deleted the feature/issue-135-context-sync branch August 13, 2026 23:52
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.

feat: Add dynamic context sync from AWS sources

2 participants