Skip to content

feat: Add organization region selectors#37

Merged
JSChronicles merged 4 commits into
mainfrom
feature/region_selector
May 3, 2026
Merged

feat: Add organization region selectors#37
JSChronicles merged 4 commits into
mainfrom
feature/region_selector

Conversation

@JSChronicles
Copy link
Copy Markdown
Owner

Description

Adds organization region selectors for YAML configs.

  • Supports regions: ["all"] for organization configs.
  • Supports glob selectors like us-*, including mixed glob and explicit regions.
  • Keeps accounts: configs explicit-region only.
  • Resolves selectors against discovered AWS region statuses and executes only enabled regions.
  • Warns for matched disabled/unavailable regions.
  • Rejects glob selectors that match no known region.
  • Leaves max_parallel_regions behavior unchanged.

Implementation Notes

  • Added src/anvil/regions.py for selector detection, bootstrap region selection, and selector resolution.
  • Changed organization preflight to discover and cache region statuses.
  • Uses a concrete bootstrap region for org discovery when YAML starts with all or a glob.
  • Updated schema descriptions/examples with branch-specific regions semantics.
  • Moved detailed README output examples into docs/README.md.
  • Updated task contract docs to show actions: ActionRecorder.

Checklist

  • Python format, lint, and tests (ruff and pytest) were successful.
  • Pre-commit hooks passed locally.
  • Documentation updated if needed.
  • Unit tests added or updated.

Clarify region-selection behavior and task interface across docs and examples.

Added a Region Selection section to YAML validation reference and README, noting that organizations can use explicit regions, `all`, globs, or mixed selectors while account configs require explicit region names.

Expanded docs/README.md with detailed CLI examples (auth, graph, run output) and moved large output examples out of the top-level README.

Updated task contract docs to show ActionRecorder usage, stricter typing for metadata, actions parameter type, and that sessions are scoped to account+region.

Minor example YAMLs updated with comments demonstrating region selector rules.
Introduce a new anvil.regions module to manage region selectors, globs and AWS region opt-in statuses.

Add resolution logic (resolve_region_selectors), bootstrap region selection for preflight calls, and helpers to classify selectors.

Update TargetDescriptor validation to forbid mixing 'all' with other regions and to reject selectors for ACCOUNTS branch.

Replace discovery of a simple enabled-region list with discover_region_statuses returning a dict of region -> opt-in status; OrganizationResolver and runner plumbing now pass and consume this map and resolve selectors against it.

Update JSON schemas to document selectors for orgs and restrict account configs to explicit regions.

Add and adjust tests to cover selector expansion, error cases, warnings for unavailable regions, and use of bootstrap region during preflight.
@JSChronicles JSChronicles merged commit 4587dca into main May 3, 2026
7 checks passed
@JSChronicles JSChronicles deleted the feature/region_selector branch May 3, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant