Skip to content

feat(#646): manage github repo configuration in the pulumi program - #704

Merged
zgeoff merged 1 commit into
mainfrom
646-github-config
Jul 20, 2026
Merged

feat(#646): manage github repo configuration in the pulumi program#704
zgeoff merged 1 commit into
mainfrom
646-github-config

Conversation

@zgeoff

@zgeoff zgeoff commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Description

Closes #646

Manages the zgeoff/vers repo configuration — labels, the main protection ruleset, the production environment, and Actions variables — declaratively in the vers-infra Pulumi program, so the schema the issue-hygiene rules assume is reviewed and drift-checked instead of living as console state.

  • Labels use the authoritative IssueLabels resource: console-added labels read as drift.
  • Existing resources were imported into stack state; pulumi up confirms zero resource changes.
  • Default provider reads GITHUB_TOKEN (fine-grained PAT, vers-ci vault) resolved by op run; owner comes from github:owner stack config.
  • The service-auth public key value lives in encrypted stack config, not source.
  • Console-managed by design: milestones (delivery state, not schema), Actions secrets (values unreadable via API; manage Actions secrets in the Pulumi workspace from a backfilled vault #705 backfills the vault and adopts them), and the delivery board (Projects v2 provider support immature).
  • No repo webhooks exist, so none are declared.
  • Issue-hygiene guidelines now name the program as the label registry.

Testing

  • bun run typecheck passes
  • bun run test passes
  • bun run lint passes
  • New tests added for new functionality

Context

Infra changes are covered by the infra-drift preview (expect-no-changes against prod state) rather than unit tests.

@socket-security

socket-security Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​pulumi/​github@​6.14.0991009196100

View full report

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 71c2a308-5941-458b-a1bb-208f18f4ae17

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The Pulumi workspace adds GitHub repository management for labels, milestones, branch rules, environments, and Actions variables. It configures provider credentials and repository ownership, updates CI token loading, and documents the infrastructure and issue-hygiene workflow.

Changes

GitHub infrastructure configuration

Layer / File(s) Summary
Provider and stack configuration
infra/package.json, package.json, infra/tsconfig.json, infra/.env.example, infra/Pulumi.prod.yaml, infra/README.md
The GitHub provider, repository owner, source inclusion, token reference, and required PAT permissions are configured and documented.
Declarative repository resources
infra/github.ts, infra/index.ts, AGENTS.md, agents/project.md
Pulumi defines protected labels, milestones, main-branch rules, the production environment, and Actions variables, then re-exports resource identifiers and directs registry changes through the program.
CI credential wiring
.github/workflows/infra-drift.yml
The stack credential-loading step exposes GITHUB_TOKEN to the Pulumi preview job.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • zgeoff/vers#659: Introduced the infrastructure drift workflow that this change extends.
  • zgeoff/vers#663: Updated the same credential-loading setup to use vers-ci secrets.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning For [#646], most scope is covered, but Actions secrets are still console-managed rather than declared in Pulumi. Add Pulumi-managed Actions secret resources by name and scope, backed by 1Password values, so secrets are reviewed like the rest of the repo config.
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The changes stay focused on GitHub repo configuration, docs, and supporting infra updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly summarizes the main change: managing GitHub repository configuration in Pulumi.
Description check ✅ Passed The description is directly related to the changeset and explains the repo configuration work in Pulumi.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 646-github-config

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

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

🍹 preview on vers-infra/prod

Pulumi report
   Previewing update (prod):
Downloading plugin cloudflare-6.17.0: starting
Downloading plugin github-6.14.0: starting
Downloading plugin github-6.14.0: done
Installing plugin github-6.14.0: starting
Downloading plugin terraform-provider-1.2.0: starting
Downloading plugin cloudflare-6.17.0: done
Installing plugin cloudflare-6.17.0: starting
Installing plugin github-6.14.0: done
Downloading plugin terraform-provider-1.2.0: done
Installing plugin terraform-provider-1.2.0: starting
@ previewing update....
Installing plugin cloudflare-6.17.0: done
Installing plugin terraform-provider-1.2.0: done

@ previewing update....
~  pulumi:pulumi:Stack vers-infra-prod refreshing 
~  pulumi:pulumi:Stack vers-infra-prod refreshing 
~  axiom:index:Dataset vers-logs refreshing 
~  axiom:index:Dataset vers-traces refreshing 
~  pulumi:providers:axiom axiom refreshing 
~  github:index:RepositoryRuleset main-protection refreshing 
~  github:index:RepositoryEnvironment production refreshing 
~  cloudflare:index:DnsRecord resend-return-path-mx refreshing 
~  cloudflare:index:DnsRecord resend-dmarc refreshing 
~  axiom:index:Token vers-production refreshing 
~  cloudflare:index:DnsRecord resend-dkim refreshing 
~  cloudflare:index:DnsRecord www refreshing 
~  github:index:ActionsVariable vite-umami-website-id refreshing 
~  axiom:index:Dataset vers-metrics refreshing 
~  axiom:index:Token vers-mcp refreshing 
~  axiom:index:Dashboard vers-services-baseline refreshing 
~  pulumi:providers:axiom axiom refresh 
~  axiom:index:Notifier vers-alarms refreshing 
~  cloudflare:index:DnsRecord resend-return-path-spf refreshing 
~  github:index:IssueLabels vers refreshing 
@ previewing update....
~  cloudflare:index:DnsRecord resend-return-path-mx refresh 
~  cloudflare:index:DnsRecord resend-dmarc refresh 
~  cloudflare:index:DnsRecord apex refreshing 
~  github:index:ActionsEnvironmentVariable vite-sentry-dsn refreshing 
~  cloudflare:index:DnsRecord resend-dkim refresh 
~  github:index:ActionsEnvironmentVariable service-auth-public-key refreshing 
~  cloudflare:index:DnsRecord www refresh 
~  axiom:index:Monitor vers-replay-poke-failed refreshing 
~  axiom:index:Dataset vers-traces refresh 
~  axiom:index:Dataset vers-logs refresh 
~  axiom:index:Monitor vers-5xx-responses refreshing 
~  github:index:RepositoryEnvironment production refresh 
~  axiom:index:Dataset vers-metrics refresh 
~  axiom:index:Notifier vers-alarms refresh 
~  cloudflare:index:DnsRecord apex refresh 
~  axiom:index:Monitor vers-replay-poke-failed refresh 
~  axiom:index:Monitor vers-5xx-responses refresh 
~  axiom:index:Token vers-mcp refresh 
~  axiom:index:Dashboard vers-services-baseline refresh 
~  axiom:index:Token vers-production refresh 
~  github:index:ActionsVariable vite-umami-website-id refresh 
~  github:index:RepositoryRuleset main-protection refresh 
~  github:index:IssueLabels vers refresh 
@ previewing update....
~  github:index:ActionsEnvironmentVariable vite-sentry-dsn refresh 
~  cloudflare:index:DnsRecord resend-return-path-spf refresh 
~  github:index:ActionsEnvironmentVariable service-auth-public-key refresh 
   pulumi:pulumi:Stack vers-infra-prod running 
@ previewing update....
   pulumi:providers:axiom axiom  
   cloudflare:index:DnsRecord resend-dkim  
   cloudflare:index:DnsRecord resend-return-path-spf  
   axiom:index:Dataset vers-logs  
   axiom:index:Dataset vers-metrics  
   axiom:index:Token vers-mcp  
   axiom:index:Dashboard vers-services-baseline  
   axiom:index:Token vers-production  
   axiom:index:Dataset vers-traces  
   axiom:index:Notifier vers-alarms  
   github:index:RepositoryRuleset main-protection  
@ previewing update....
   github:index:IssueLabels vers  
   github:index:RepositoryEnvironment production  
   cloudflare:index:DnsRecord resend-dmarc  
   github:index:ActionsVariable vite-umami-website-id  
   cloudflare:index:DnsRecord www  
   cloudflare:index:DnsRecord resend-return-path-mx  
   cloudflare:index:DnsRecord apex  
   axiom:index:Monitor vers-5xx-responses  
   axiom:index:Monitor vers-replay-poke-failed  
   github:index:ActionsEnvironmentVariable service-auth-public-key  
   github:index:ActionsEnvironmentVariable vite-sentry-dsn  
   pulumi:pulumi:Stack vers-infra-prod  
Resources:
   23 unchanged

   

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@infra/github.ts`:
- Around line 242-248: Refactor github.ts to expose one primary GitHub
repository configuration export immediately after the imports, followed by
private resource declarations and helpers. Remove the seven individual exports
including labelCount, milestoneTitles, and the *Name outputs, then expose those
stack-level values from infra/index.ts instead. Rename the module to reflect its
single primary export and update all consumers accordingly.
- Around line 151-164: Update the RepositoryMilestone configuration in the
milestoneDefinitions mapping to use the configured stack owner instead of the
hardcoded 'zgeoff' value, reusing the existing owner configuration symbol used
by the GitHub provider setup.
- Around line 195-207: Update the productionEnvironment RepositoryEnvironment
declaration to explicitly configure its protection rules: define the intended
branch policy, required reviewers, wait timer, self-review prevention, and
administrator-bypass behavior. Preserve the existing production environment
name, repository association, and protect setting while replacing reliance on
provider defaults with explicit values.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8288568b-f18b-42b8-b770-2423beac94ee

📥 Commits

Reviewing files that changed from the base of the PR and between 90e728d and 6c2038f.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock, !bun.lock
📒 Files selected for processing (11)
  • .github/workflows/infra-drift.yml
  • AGENTS.md
  • agents/project.md
  • infra/.env.example
  • infra/Pulumi.prod.yaml
  • infra/README.md
  • infra/github.ts
  • infra/index.ts
  • infra/package.json
  • infra/tsconfig.json
  • package.json

Comment thread infra/github.ts Outdated
Comment thread infra/github.ts
Comment thread infra/github.ts
Declares the zgeoff/vers labels, main-protection ruleset, production
environment, and Actions variables as @pulumi/github resources, wires the
provider PAT through op run and the infra-drift workflow, and points the
issue-hygiene guidelines at the program as the label registry. The
service-auth public key value enters through encrypted stack config, not
source. Milestones, Actions secrets, and the delivery board stay
console-managed: milestones are delivery state rather than schema, secret
values cannot be read back, and Projects v2 lacks mature provider support.
@zgeoff
zgeoff force-pushed the 646-github-config branch from db4ca32 to 986d440 Compare July 20, 2026 08:53
@zgeoff
zgeoff merged commit 5859859 into main Jul 20, 2026
8 checks passed
@zgeoff
zgeoff deleted the 646-github-config branch July 20, 2026 08:57
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.

manage GitHub repo configuration as code in the Pulumi workspace

1 participant