Skip to content

[BUG]: The github_repository resource churns on vulnerability_alerts if not explicitly set #2489

Closed

Description

@stevehipwell

Expected Behavior

When creating a new repository with the github_repository resource, this should not churn if vulnerability_alerts is not set.

Actual Behavior

If vulnerability_alerts is not set it will constantly churn.

Terraform Version

n/a

Affected Resource(s)

  • github_repository

Terraform Configuration Files

resource "github_repository" "test" {
  name         = "test"
}

Steps to Reproduce

Apply the above resource and then run a plan.

This issue is being caused by a missing Computed: true value on the schema. I'll open a PR to fix this, but long term this attribute should be deprecated and handled by it's own resource.

Debug Output

No response

Panic Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    Status: TriageThis is being looked at and prioritized
    Type: BugSomething isn't working as documented
    on Dec 3, 2024
  2. stevehipwell commented on Dec 3, 2024

    @stevehipwell
    CollaboratorAuthor

    It also looks like if a repository is created with an explicit value for vulnerability_alerts that doesn't match the default it will also churn.

  3. changed the title [-][BUG]: Repository data source churns on `vulnerability_alerts` if not explicitly set[/-] [+][BUG]: The `github_repository` resource churns on `vulnerability_alerts` if not explicitly set[/+] on Dec 4, 2024
  4. stevehipwell commented on Dec 4, 2024

    @stevehipwell
    CollaboratorAuthor

    The code to fix this is currently in #2476 but I'm planning on opening a seperate PR for this change before that gets merged.

  5. moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Activeon Dec 23, 2024
  6. acouvreur commented on Feb 11, 2025

    @acouvreur
    Contributor

    I'm having this issue running acceptance tests:

     data_source_github_repository_autolink_references_test.go:44: Step 1/2 error: After applying this test step, the plan was not empty.
            stdout:
            
            
            Terraform used the selected providers to generate the following execution
            plan. Resource actions are indicated with the following symbols:
              ~ update in-place
            
            Terraform will perform the following actions:
            
              # github_repository.test will be updated in-place
              ~ resource "github_repository" "test" {
                    id                          = "tf-acc-test-uzqg7"
                    name                        = "tf-acc-test-uzqg7"
                  - vulnerability_alerts        = true -> null
                    # (35 unchanged attributes hidden)
            
                    # (1 unchanged block hidden)
                }
            
            Plan: 0 to add, 1 to change, 0 to destroy.
    
  7. stevehipwell commented on Feb 11, 2025

    @stevehipwell
    CollaboratorAuthor

    @acouvreur acceptance tests on this branch?

  8. acouvreur commented on Feb 11, 2025

    @acouvreur
    Contributor

    My feature branch from main

  9. stevehipwell commented on Feb 11, 2025

    @stevehipwell
    CollaboratorAuthor

    @acouvreur I'm confused as to what you're saying? This PR is intended to fix the flaky tests, so if you've got a branch from main it will have the issues this PR fixes present.

  10. acouvreur commented on Feb 11, 2025

    @acouvreur
    Contributor

    @acouvreur I'm confused as to what you're saying? This PR is intended to fix the flaky tests, so if you've got a branch from main it will have the issues this PR fixes present.

    I'm sorry about the confusion, I wanted to point out that this issue is still happening and is preventing me from contributing properly.

    So it was more something like: "this issue is still relevant and happens to me, can confirm."

    I'm just showing support for this PR 😀

  11. stevehipwell commented on Feb 11, 2025

    @stevehipwell
    CollaboratorAuthor

    Sorry @acouvreur I thought you'd commented on the PR to fix this (#2501). FYI PR #2476 makes all of the automation tests work correctly.

  12. Lekensteyn commented on Mar 7, 2025

    @Lekensteyn

    Hey @stevehipwell, could you clarify what kind of churn you are seeing? What does the plan output look like?

  13. stevehipwell commented on Mar 7, 2025

    @stevehipwell
    CollaboratorAuthor

    @Lekensteyn I covered how to reproduce in the description as well as what I'm seeing. You can also look at my PR to fix it.

  14. moved this from 🔥 Backlog to ✅ Done in 🧰 Octokit Activeon Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: BugSomething isn't working as documented

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions