Repository navigation
[FEAT] Add new resource for repository vulnerability alerts - #3166
stevehipwell merged 16 commits into
Conversation
|
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
fb54b9b to
5b5d40c
Compare
stevehipwell
left a comment
There was a problem hiding this comment.
This is looking good.
5b5d40c to
8ba3a26
Compare
8ba3a26 to
7ea9d1a
Compare
|
@deiga could you please rebase? |
7ea9d1a to
9791700
Compare
stevehipwell
left a comment
There was a problem hiding this comment.
This looks good, just two minor nits which I think are worth fixing for readability and because I think this resource will be one we can use as an example for people contributing.
9791700 to
4f3c392
Compare
stevehipwell
left a comment
There was a problem hiding this comment.
This PR looks great, I just have a concern about string matching on an error message (we know errors aren't consistent across GHAS), especially one that isn't explicit about the cause. If we think it's valuable to provide a custom error message, which I'm personally not sure about, then we ought to use the API to get a definitive answer.
c41ad75 to
cb0ee23
Compare
Signed-off-by: Timo Sand <[email protected]>
Signed-off-by: Timo Sand <[email protected]>
Signed-off-by: Timo Sand <[email protected]>
…ions#3166) * Add resource for repository vulnerability alerts Signed-off-by: Timo Sand <[email protected]> * Mark `vulnerability_alerts` in `github_repository` as deprecated Signed-off-by: Timo Sand <[email protected]> * Update formatting Signed-off-by: Timo Sand <[email protected]> * Update import after rebase Signed-off-by: Timo Sand <[email protected]> * Correct file names Signed-off-by: Timo Sand <[email protected]> * Address review comments Signed-off-by: Timo Sand <[email protected]> * Simplify `SetId` Signed-off-by: Timo Sand <[email protected]> * Comment out `owner` until we can support it better Signed-off-by: Timo Sand <[email protected]> * Refactor to use `ConfigStateChecks` Signed-off-by: Timo Sand <[email protected]> * Update import ID to only repository name Signed-off-by: Timo Sand <[email protected]> * Improves tests Signed-off-by: Timo Sand <[email protected]> * Updates docs Signed-off-by: Timo Sand <[email protected]> * Add clearer error for user when trying to add to an archived repository Signed-off-by: Timo Sand <[email protected]> * Re-order `SetId` Signed-off-by: Timo Sand <[email protected]> * Simplify archived repo handling Signed-off-by: Timo Sand <[email protected]> * Fix behaviour on archived repository Signed-off-by: Timo Sand <[email protected]> --------- Signed-off-by: Timo Sand <[email protected]>
Declares the Pages configuration on the vivarium repository via the provider's nested `pages` block with `build_type = "workflow"`. The actual build/deploy is still driven by `.github/workflows/deploy-docs.yml` (`actions/configure-pages` + `actions/deploy-pages`); putting the enablement itself under IaC means drift (e.g. a UI toggle disabling the site) is detectable on the next `tofu plan` rather than silently breaking the deploy. Required a tweak to `lifecycle.ignore_changes`. The previous `all` was a broad guard against the signoff-bug-induced PATCH 422 (`integrations/ github` v6.x hardcodes `web_commit_signoff_required=false`), but that also blanket-ignored the `pages` block. Switched to an explicit per- attribute list that covers every existing repo attr *except* `pages`. The provider reaches Pages via a separate `/pages` API call, so it is unaffected by the broken repo PATCH. Revert to `ignore_changes = [web_commit_signoff_required]` once v6.12+ ships (integrations/terraform-provider-github#3166). Org-level prerequisite (`members_can_create_public_pages = true`) was landed earlier in aletheia-works/.github.
Declares the Pages configuration on the vivarium repository via the provider's nested `pages` block with `build_type = "workflow"`. The actual build/deploy is still driven by `.github/workflows/deploy-docs.yml` (`actions/configure-pages` + `actions/deploy-pages`); putting the enablement itself under IaC means drift (e.g. a UI toggle disabling the site) is detectable on the next `tofu plan` rather than silently breaking the deploy. Required a tweak to `lifecycle.ignore_changes`. The previous `all` was a broad guard against the signoff-bug-induced PATCH 422 (`integrations/ github` v6.x hardcodes `web_commit_signoff_required=false`), but that also blanket-ignored the `pages` block. Switched to an explicit per- attribute list that covers every existing repo attr *except* `pages`. The provider reaches Pages via a separate `/pages` API call, so it is unaffected by the broken repo PATCH. Revert to `ignore_changes = [web_commit_signoff_required]` once v6.12+ ships (integrations/terraform-provider-github#3166). Org-level prerequisite (`members_can_create_public_pages = true`) was landed earlier in aletheia-works/.github.
Declares the Pages configuration on the vivarium repository via the provider's nested `pages` block with `build_type = "workflow"`. The actual build/deploy is still driven by `.github/workflows/deploy-docs.yml` (`actions/configure-pages` + `actions/deploy-pages`); putting the enablement itself under IaC means drift (e.g. a UI toggle disabling the site) is detectable on the next `tofu plan` rather than silently breaking the deploy. Required a tweak to `lifecycle.ignore_changes`. The previous `all` was a broad guard against the signoff-bug-induced PATCH 422 (`integrations/ github` v6.x hardcodes `web_commit_signoff_required=false`), but that also blanket-ignored the `pages` block. Switched to an explicit per- attribute list that covers every existing repo attr *except* `pages`. The provider reaches Pages via a separate `/pages` API call, so it is unaffected by the broken repo PATCH. Revert to `ignore_changes = [web_commit_signoff_required]` once v6.12+ ships (integrations/terraform-provider-github#3166). Org-level prerequisite (`members_can_create_public_pages = true`) was landed earlier in aletheia-works/.github.
…ions#3166) * Add resource for repository vulnerability alerts Signed-off-by: Timo Sand <[email protected]> * Mark `vulnerability_alerts` in `github_repository` as deprecated Signed-off-by: Timo Sand <[email protected]> * Update formatting Signed-off-by: Timo Sand <[email protected]> * Update import after rebase Signed-off-by: Timo Sand <[email protected]> * Correct file names Signed-off-by: Timo Sand <[email protected]> * Address review comments Signed-off-by: Timo Sand <[email protected]> * Simplify `SetId` Signed-off-by: Timo Sand <[email protected]> * Comment out `owner` until we can support it better Signed-off-by: Timo Sand <[email protected]> * Refactor to use `ConfigStateChecks` Signed-off-by: Timo Sand <[email protected]> * Update import ID to only repository name Signed-off-by: Timo Sand <[email protected]> * Improves tests Signed-off-by: Timo Sand <[email protected]> * Updates docs Signed-off-by: Timo Sand <[email protected]> * Add clearer error for user when trying to add to an archived repository Signed-off-by: Timo Sand <[email protected]> * Re-order `SetId` Signed-off-by: Timo Sand <[email protected]> * Simplify archived repo handling Signed-off-by: Timo Sand <[email protected]> * Fix behaviour on archived repository Signed-off-by: Timo Sand <[email protected]> --------- Signed-off-by: Timo Sand <[email protected]>
…ions#3166) * Add resource for repository vulnerability alerts Signed-off-by: Timo Sand <[email protected]> * Mark `vulnerability_alerts` in `github_repository` as deprecated Signed-off-by: Timo Sand <[email protected]> * Update formatting Signed-off-by: Timo Sand <[email protected]> * Update import after rebase Signed-off-by: Timo Sand <[email protected]> * Correct file names Signed-off-by: Timo Sand <[email protected]> * Address review comments Signed-off-by: Timo Sand <[email protected]> * Simplify `SetId` Signed-off-by: Timo Sand <[email protected]> * Comment out `owner` until we can support it better Signed-off-by: Timo Sand <[email protected]> * Refactor to use `ConfigStateChecks` Signed-off-by: Timo Sand <[email protected]> * Update import ID to only repository name Signed-off-by: Timo Sand <[email protected]> * Improves tests Signed-off-by: Timo Sand <[email protected]> * Updates docs Signed-off-by: Timo Sand <[email protected]> * Add clearer error for user when trying to add to an archived repository Signed-off-by: Timo Sand <[email protected]> * Re-order `SetId` Signed-off-by: Timo Sand <[email protected]> * Simplify archived repo handling Signed-off-by: Timo Sand <[email protected]> * Fix behaviour on archived repository Signed-off-by: Timo Sand <[email protected]> --------- Signed-off-by: Timo Sand <[email protected]>
…ions#3166) * Add resource for repository vulnerability alerts Signed-off-by: Timo Sand <[email protected]> * Mark `vulnerability_alerts` in `github_repository` as deprecated Signed-off-by: Timo Sand <[email protected]> * Update formatting Signed-off-by: Timo Sand <[email protected]> * Update import after rebase Signed-off-by: Timo Sand <[email protected]> * Correct file names Signed-off-by: Timo Sand <[email protected]> * Address review comments Signed-off-by: Timo Sand <[email protected]> * Simplify `SetId` Signed-off-by: Timo Sand <[email protected]> * Comment out `owner` until we can support it better Signed-off-by: Timo Sand <[email protected]> * Refactor to use `ConfigStateChecks` Signed-off-by: Timo Sand <[email protected]> * Update import ID to only repository name Signed-off-by: Timo Sand <[email protected]> * Improves tests Signed-off-by: Timo Sand <[email protected]> * Updates docs Signed-off-by: Timo Sand <[email protected]> * Add clearer error for user when trying to add to an archived repository Signed-off-by: Timo Sand <[email protected]> * Re-order `SetId` Signed-off-by: Timo Sand <[email protected]> * Simplify archived repo handling Signed-off-by: Timo Sand <[email protected]> * Fix behaviour on archived repository Signed-off-by: Timo Sand <[email protected]> --------- Signed-off-by: Timo Sand <[email protected]>
…ction, delete `UnifyTickerTool` and `UnifyFootball-Infrastructure` (#10) * chore(deps): ⬆️ GitHub Actions to their latest stable releases - actions/checkout v6 -> v7.0.1 - hashicorp/setup-terraform v4 -> v4.0.1 - actions/github-script v8 -> v9.0.0 Pins move to full vX.Y.Z tags. None of the inputs these workflows use changed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(deps): ⬆️ mathieudutour/github-tag-action v6.2 -> v7.0.0 v7 no longer calculates a version when no eligible commit exists since the last tag (for example a workflow_dispatch re-run on an already released main), so `new_tag` can now be empty. The migration guide asks downstream steps to guard on it, so the GitHub release step only runs when a tag was calculated. The other v7 changes do not affect this workflow: `default_bump: major` stays the fallback, `main` is still a release branch, and `dry_run: true` keeps tagging to ncipollo/release-action. Migration guide: https://github.com/mathieudutour/github-tag-action/blob/v7.0.0/docs/migrating-to-v7.md Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(deps): ⬆️ integrations/github provider 6.11.1 -> 6.13.0 The committed lock file still pinned 6.2.2 (CI's `terraform init -upgrade` has been papering over it), so it is regenerated for 6.13.0 with hashes for linux_amd64 (CI, HCP Terraform runs), darwin_amd64 and darwin_arm64. Release notes: - https://github.com/integrations/terraform-provider-github/releases/tag/v6.12.0 - https://github.com/integrations/terraform-provider-github/releases/tag/v6.12.1 - https://github.com/integrations/terraform-provider-github/releases/tag/v6.13.0 Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix: 🛡️ manage vulnerability alerts with github_repository_vulnerability_alerts `vulnerability_alerts` on `github_repository` is deprecated since provider 6.12.0 and will be removed in a future version. Each managed repository now gets a `github_repository_vulnerability_alerts` resource driven by the same `enable_vulnerability_alerts` flag. - The repository attribute is Optional + Computed, so dropping it from the config causes no diff on the existing repositories. - The new resources are created on the next apply. Creating one calls the same enable endpoint the attribute used, so the live setting does not change. - Dependabot security updates now depend on the alerts resource: GitHub only enables them when Dependabot alerts are on, and both resources would otherwise be created in parallel for a new repository. Docs: https://registry.terraform.io/providers/integrations/github/6.13.0/docs/resources/repository_vulnerability_alerts Provider PR: integrations/terraform-provider-github#3166 Co-Authored-By: Claude Opus 5.5 <[email protected]> * repo: 🗑️ delete `UnifyTickerTool` Removes the repository from the managed list. The next apply destroys `github_repository.managed_repositories["UnifyTickerTool"]` (no `archive_on_destroy`, so GitHub deletes it) together with its collaborators and Dependabot security updates resources. The repository holds only the BaseTemplate initial commit (created and last pushed 2025-10-31). Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix: 🔐 declare secret scanning push protection on repositories with secret scanning GitHub keeps push protection enabled on the public BaseTemplate, but the config only declared `secret_scanning`, so every plan since at least 2026-03-23 tried to set `secret_scanning_push_protection` back to null. Repositories with `enable_secret_scanning = "enabled"` now declare push protection as enabled too, which matches the live setting and ends the perpetual in-place update. Co-Authored-By: Claude Opus 5.5 <[email protected]> * repo: 🗑️ delete `UnifyFootball-Infrastructure` Removes the repository from the managed list. The next apply destroys `github_repository.managed_repositories["UnifyFootball-Infrastructure"]` (no `archive_on_destroy`, so GitHub deletes it) together with its collaborators and Dependabot security updates resources. Its vulnerability alerts resource is never created, as it leaves the list in the same change. The repository holds only the initial commit (created and last pushed 2024-09-05); the UnifyFootball infrastructure lives in UnifyFootball's own `infrastructure/` folder. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Resolves #3038
Before the change?
github_repositoryresource.After the change?
vulnerability_alertsin thegithub_repositoryresource are marked as deprecatedPull request checklist
Schema migrations have been created if needed (example)Does this introduce a breaking change?
Please see our docs on breaking changes to help!