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

Fix bug: diff being detected for source_repo_repository even when there are no changes #3786

Merged

Conversation

jcanseco
Copy link
Member

This patch fixes a bug in source_repo_repository where a diff was always being generated for the TypeSet field pubsub_configs since its Set hashing function was not accounting for the fact that pubsub_configs[].topic can contain either a topic's name or relative path.

To reproduce, apply the following Terraform configuration, then run terraform plan right after. Notice how terraform plan detects a diff even when nothing was actually changed.

provider "google" {
  project = "my-project-test"
}

resource "google_pubsub_topic" "topic" {
  name = "my-topic-test"
}

resource "google_sourcerepo_repository" "repo" {
  name             = "my-repo-test"
  pubsub_configs {
    topic           = google_pubsub_topic.topic.name
    message_format  = "JSON"
  }
}

Release Note Template for Downstream PRs (will be copied)

sourcerepo: fixed perma-diff in `google_sourcerepo_repository`

…re are no changes

This patch fixes a bug in source_repo_repository where a diff was always
being generated for the TypeSet field `pubsub_configs` since its Set
hashing function was not accounting for the fact that
`pubsub_configs[].topic` can contain either a topic's name or relative
path.
@google-cla google-cla bot added the cla: yes label Jul 27, 2020
@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@danawillow, please review this PR or find an appropriate assignee.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 20 insertions(+))
Terraform Beta: Diff ( 1 file changed, 20 insertions(+))
TF Conversion: Diff ( 1 file changed, 20 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=135982"

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccFolderIamAuditConfig_multiple You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=135989"

Copy link
Contributor

@danawillow danawillow left a comment

Choose a reason for hiding this comment

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

Thanks Jazel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants