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

feat(TPG>=4.78)!: add cloud storage subscription support #145

Merged
merged 9 commits into from
Oct 25, 2023

Conversation

lahuang4
Copy link
Contributor

I tried running tests by changing skip: true to skip: false in examples/bigquery/test.yaml, but I'm getting errors along the lines of:

Error: No value for required variable

on variables.tf line 17:
17: variable "project_id" {

The root module input variable "project_id" is not set, and has no default
value. Use a -var or -var-file command line argument to provide a value for
this variable.}

Not sure how to get this to run correctly, would appreciate any tips. But it seems like all the tests are in this state, not just my newly-added cloud_storage test.

@lahuang4 lahuang4 requested a review from a team as a code owner August 16, 2023 21:30
@apeabody apeabody changed the title feat: add cloud storage subscription support feat!: add cloud storage subscription support Aug 17, 2023
@apeabody apeabody changed the title feat!: add cloud storage subscription support feat(TPG>=4.78)!: add cloud storage subscription support Aug 17, 2023
@apeabody
Copy link
Contributor

/gcbrun

@apeabody
Copy link
Contributor

Hi @bharathkkb Do you happen to recall why the test referenced above was skipped? https://github.com/terraform-google-modules/terraform-google-pubsub/blob/master/examples/kms/test.yaml#L20

@tcoyze
Copy link
Contributor

tcoyze commented Aug 23, 2023

Hi @lahuang4, you should be able to pass that error by running (for example):

terraform plan -var "project_id=<your google cloud project id>"

Thank you for contributing! 👍

@github-actions
Copy link

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Stale label Oct 22, 2023
@lahuang4
Copy link
Contributor Author

Oops, I've let this linger too long. Can't seem to figure out how to remove the Stale label; maybe commenting will do the trick to keep the PR alive.

@apeabody apeabody removed the Stale label Oct 23, 2023
@lahuang4
Copy link
Contributor Author

OK, I couldn't figure out how to pass the variables to the integration tests in the end (I tried tcoyze@'s suggestion but maybe I am triggering the tests incorrectly because the vars were not persisting to the test run), but I've run the new Cloud Storage example myself by running terraform apply and seeing the correct result!

I've left the newly added test.yaml annotated as skip: true for now.

While running the example I decided that it may be useful to have the bucket name passed in as a variable -- due to the global Cloud Storage bucket namespace it's likely that any placeholder we put in the example is going to be taken already, and the same bucket name is used both in the google_storage_bucket object and the cloud_storage_subscriptions object.

This is ready for review now!

@apeabody
Copy link
Contributor

/gcbrun

@apeabody
Copy link
Contributor

Hi @lahuang4 - From the lint

Checking for documentation generation
diff -r '--exclude=.terraform' '--exclude=.kitchen' '--exclude=autogen' '--exclude=*.tfvars' '--exclude=*metadata.yaml' /workspace/examples/cloud_storage/README.md /tmp/tmp.pwvq4L4jPc/generate_docs/workspace/examples/cloud_storage/README.md
10d9
< | project\_id | The project ID to manage the Pub/Sub resources | `string` | n/a | yes |
11a11
> | project\_id | The project ID to manage the Pub/Sub resources | `string` | n/a | yes |
17d16
< | project\_id | The project ID |
18a18
> | project\_id | The project ID |
Error: Documentation generation has not been run, please run the
'make docker_generate_docs' command and commit the above changes.

Copy link
Contributor

@apeabody apeabody left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @lahuang4! - A few notes below for now :)

test/setup/versions.tf Outdated Show resolved Hide resolved
test/setup/versions.tf Outdated Show resolved Hide resolved
examples/cloud_storage/versions.tf Outdated Show resolved Hide resolved
examples/cloud_storage/test.yaml Outdated Show resolved Hide resolved
examples/bigquery/test.yaml Outdated Show resolved Hide resolved
@apeabody
Copy link
Contributor

/gcbrun

@apeabody
Copy link
Contributor

/gcbrun

@apeabody
Copy link
Contributor

/gcbrun

@apeabody
Copy link
Contributor

/gcbrun

@apeabody
Copy link
Contributor

/gcbrun

1 similar comment
@apeabody
Copy link
Contributor

/gcbrun

@apeabody
Copy link
Contributor

/gcbrun

@apeabody apeabody merged commit 95863ab into terraform-google-modules:master Oct 25, 2023
4 checks passed
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.

3 participants