Skip to content

Combine member updates and guarded deletes - #265

Draft
galargh wants to merge 16 commits into
masterfrom
galargh/combine-pr-263-264
Draft

galargh wants to merge 16 commits into
masterfrom
galargh/combine-pr-263-264

Conversation

@galargh

@galargh galargh commented Aug 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Combines the work from:

Includes these follow-up improvements:

  • Keep Fix PR comments focused on access changes, with overflow protection and a link to the full access report in workflow summaries/artifacts.
  • Generate the full report as a side effect of the shared describe-access-changes helper; restore the manual Access Report workflow and fix its metadata initialization.
  • Explain direct and team repository grants, identify members with no effective repository access, and label full reports as the expected post-apply configuration.
  • Isolate Fix config artifacts from access-report artifacts during the Push job.
  • Show Plan/Apply source commits, PRs, rendered plans, and artifacts, and explain allow-destroy routing before requesting protected environments.
  • Require ALLOW_DESTROY=true before enabling destructive plans/applies; reject member removals that retain team membership or direct private repository access in both Plan and Apply.
  • Only after those checks pass, warn on Plan and block Apply when removing organization membership while retaining direct public repository access. Publish recovery instructions in classification summaries and Plan comments.
  • Add a temporary manual workflow to convert a batch of active members to outside collaborators through the GitHub API, using a copyable username list from the Plan warning. It requires the guarded write-allow-destroy environment and Members write permission, and does not run Terraform, Sync, or create a PR. It validates all memberships before conversion and reports partial failures.
  • Explain conversion -> Sync -> updated PR -> fresh Plan recovery, including the risk that Sync overwrites merged but unapplied desired changes. Document removal of the workaround after provider #3608 is released, adopted, and membership state is migrated.
  • Use the configured GitHub App for Update Members commits/PRs, resolve the actual bot user ID for commit attribution, and support a draft run that only reports proposed changes.
  • Update changelog, setup documentation, and regression tests, including the access changes action upgrade requirement to avoid nested details rendering.

Provider Compatibility

This does not enable downgrade_to from integrations/terraform-provider-github#3608. The current provider does not preserve retained repository access when deleting organization membership. The manual conversion workflow and Apply guard provide an interim solution without a custom provider build.

Validation

  • pnpm --dir scripts install --frozen-lockfile
  • pnpm --dir scripts test: 79 passing tests
  • pnpm --dir scripts run build
  • pnpm --dir scripts run lint
  • pnpm --dir scripts run format
  • git diff --check
  • Compiled access-report helper generates a report in a fresh Node process using local fixtures.
  • Workflow shell tests cover bot attribution, the conversion guard, active versus pending membership, and conversion API failure without issuing live API mutations.

Before merge, a controlled live conversion -> Sync -> fresh Plan smoke test is recommended to verify the target organization's App permissions and enterprise policies. No live conversion was performed for this update.

@galargh
galargh force-pushed the galargh/combine-pr-263-264 branch from 33f67ae to f439e18 Compare November 22, 2026 12:02
@galargh
galargh force-pushed the galargh/combine-pr-263-264 branch from f439e18 to 8618920 Compare November 22, 2026 12:09
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.

1 participant