Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
stevehipwell opened this issue Dec 3, 2024 · 8 comments · May be fixed by #2501
Open
1 task done
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented

Comments

@stevehipwell
Copy link
Contributor

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
@stevehipwell stevehipwell added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Dec 3, 2024
@github-project-automation github-project-automation bot moved this to 🆕 Triage in 🧰 Octokit Active Dec 3, 2024
@stevehipwell
Copy link
Contributor Author

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.

@stevehipwell stevehipwell 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 Dec 4, 2024
@stevehipwell
Copy link
Contributor Author

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.

@stevehipwell stevehipwell linked a pull request Dec 5, 2024 that will close this issue
4 tasks
@nickfloyd nickfloyd moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Dec 23, 2024
@acouvreur
Copy link
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.

@stevehipwell
Copy link
Contributor Author

@acouvreur acceptance tests on this branch?

@acouvreur
Copy link
Contributor

My feature branch from main

@stevehipwell
Copy link
Contributor Author

@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.

@acouvreur
Copy link
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 😀

@stevehipwell
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants