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

Adds resource BitbucketServerConfig to CloudBuild. #7083

Merged
merged 5 commits into from
Feb 16, 2023

Conversation

mariomachado94
Copy link
Contributor

Adds resource BitbucketServerConfig to CloudBuild.

  • Custom code is added to support connected_connected repositories field via separate API calls

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

`google_cloudbuild_bitbucket_server_config`

@modular-magician
Copy link
Collaborator

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

I've detected that you're a community contributor. @trodge, a repository maintainer, has been assigned to assist you and help review your changes.

❓ First time contributing? Click here for more details

Your assigned reviewer will help review your code by:

  • Ensuring it's backwards compatible, covers common error cases, etc.
  • Summarizing the change into a user-facing changelog note.
  • Passes tests, either our "VCR" suite, a set of presubmit tests, or with manual test runs.

You can help make sure that review is quick by running local tests and ensuring they're passing in between each push you make to your PR's branch. Also, try to leave a comment with each push you make, as pushes generally don't generate emails.

If your reviewer doesn't get back to you within a week after your most recent change, please feel free to leave a comment on the issue asking them to take a look! In the absence of a dedicated review dashboard most maintainers manage their pending reviews through email, and those will sometimes get lost in their inbox.


@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1363 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1363 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 211 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 4 files changed, 113 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2391
Passed tests 2137
Skipped tests: 248
Failed tests: 6

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccFirebaserulesRelease_BasicRelease|TestAccDatastreamStream_datastreamStreamFullExample|TestAccContainerCluster_withInvalidGatewayApiConfigChannel|TestAccDatastreamStream_datastreamStreamBasicExample|TestAccDatastreamStream_update|TestAccCloudBuildBitbucketServerConfig_cloudbuildBitbucketServerConfigExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccDatastreamStream_datastreamStreamFullExample[Debug log]
TestAccContainerCluster_withInvalidGatewayApiConfigChannel[Debug log]
TestAccDatastreamStream_datastreamStreamBasicExample[Debug log]
TestAccDatastreamStream_update[Debug log]
TestAccCloudBuildBitbucketServerConfig_cloudbuildBitbucketServerConfigExample[Debug log]

All tests passed
View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1416 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1416 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 211 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 4 files changed, 113 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2430
Passed tests 2175
Skipped tests: 254
Failed tests: 1

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccFirebaserulesRelease_BasicRelease

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]

All tests passed
View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1503 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1503 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 211 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 8 files changed, 264 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2432
Passed tests 2175
Skipped tests: 254
Failed tests: 3

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccRegionInstanceGroupManager_stateful|TestAccContainerCluster_failedCreation|TestAccCloudBuildBitbucketServerConfig_cloudbuildBitbucketServerConfigPeeredNetworkExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccContainerCluster_failedCreation[Debug log]
TestAccCloudBuildBitbucketServerConfig_cloudbuildBitbucketServerConfigPeeredNetworkExample[Debug log]

Tests failed during RECORDING mode:
TestAccRegionInstanceGroupManager_stateful[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

Copy link
Contributor

@trodge trodge left a comment

Choose a reason for hiding this comment

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

LGTM, adding Shuya for a second review.

@trodge trodge requested review from megan07 and shuyama1 and removed request for megan07 January 26, 2023 23:29
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1503 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1503 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 211 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 8 files changed, 264 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2455
Passed tests 2196
Skipped tests: 255
Failed tests: 4

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccFrameworkProviderMeta_setModuleName|TestAccRegionInstanceGroupManager_stateful|TestAccDataSourceDnsRecordSet_basic|TestAccApigeeAddonsConfig_apigeeAddonsTestExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFrameworkProviderMeta_setModuleName[Debug log]
TestAccDataSourceDnsRecordSet_basic[Debug log]
TestAccApigeeAddonsConfig_apigeeAddonsTestExample[Debug log]

Tests failed during RECORDING mode:
TestAccRegionInstanceGroupManager_stateful[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

description: |
Immutable. The resource name for the webhook secret's secret version. Once this field has been set, it cannot be changed.
If you need to change it, please create another BitbucketServerConfig.
- !ruby/object:Api::Type::Time
Copy link
Member

Choose a reason for hiding this comment

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

We can omit the fields that may not be useful for Terraform users

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, removing createTime.

Comment on lines 138 to 140
name: 'BitbucketServerRepositoryId'
description: |
BitbucketServerRepositoryId identifies a specific repository hosted on a Bitbucket Server.
Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove these two lines. Don't think they will get generated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yes, you are right. I assume you mean name as well? It looks like name and description are not generated. Removing both.

Immutable. API Key that will be attached to webhook. Once this field has been set, it cannot be changed.
If you need to change it, please create another BitbucketServerConfig.
- !ruby/object:Api::Type::Array
name: 'connectedRepositories'
Copy link
Member

Choose a reason for hiding this comment

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

I understand that we probably not able to add tests for this field in our CI. Got a quick question regarding your local test:

  1. Have you tested the update functionality of this field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did. I had to be sure to add custom code in the preupdate to remove this field from the field mask, as well as to then update it with custom code. Then made sure to test edge cases, 0 -> 1, many as well as update many, 1 -> 0, as well as a few other permutations.

description: |
Time when the config was created.
- !ruby/object:Api::Type::String
name: 'username'
Copy link
Member

Choose a reason for hiding this comment

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

Just want to confirm the behavior of this field. If we don't specify this field explicitly, will the API return a value for this field?

Copy link
Contributor Author

@mariomachado94 mariomachado94 Feb 8, 2023

Choose a reason for hiding this comment

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

No, it needs this field from the user, it will return an error if not specified (it is the bitbucket server user name to be used by our api).

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I missed required: true setting somehow and thought it was an optional field, and that's why I asked the question. Thanks for confirming though!

Comment on lines 1 to 7
terraform {
required_providers {
google = {}
}
}

provider "google" {}
Copy link
Member

Choose a reason for hiding this comment

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

any reason we need to set these explicitly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope. Good catch, removing them.

@shuyama1
Copy link
Member

shuyama1 commented Feb 8, 2023

/gcbrun

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1472 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1472 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 211 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 8 files changed, 256 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2465
Passed tests 2204
Skipped tests: 256
Failed tests: 5

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccFirebaserulesRelease_BasicRelease|TestAccApigeeAddonsConfig_apigeeAddonsTestExample|TestAccFrameworkProviderMeta_setModuleName|TestAccDataSourceDnsRecordSet_basic|TestAccDataSourceDnsManagedZone_basic

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccApigeeAddonsConfig_apigeeAddonsTestExample[Debug log]
TestAccFrameworkProviderMeta_setModuleName[Debug log]
TestAccDataSourceDnsRecordSet_basic[Debug log]

Tests failed during RECORDING mode:
TestAccDataSourceDnsManagedZone_basic[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Only some nitpicks and questions. Sorry for missing some of these in the previous review.

mmv1/products/cloudbuild/api.yaml Outdated Show resolved Hide resolved
mmv1/products/cloudbuild/api.yaml Outdated Show resolved Hide resolved
mmv1/products/cloudbuild/terraform.yaml Show resolved Hide resolved
@mariomachado94 mariomachado94 requested a review from a team as a code owner February 13, 2023 18:21
@shuyama1
Copy link
Member

/gcbrun

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1472 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1472 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 211 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 8 files changed, 256 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2470
Passed tests 2210
Skipped tests: 256
Failed tests: 4

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccFrameworkProviderMeta_setModuleName|TestAccApigeeAddonsConfig_apigeeAddonsTestExample|TestAccDataSourceDnsRecordSet_basic|TestAccDataSourceDnsManagedZone_basic

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFrameworkProviderMeta_setModuleName[Debug log]
TestAccApigeeAddonsConfig_apigeeAddonsTestExample[Debug log]
TestAccDataSourceDnsRecordSet_basic[Debug log]

Tests failed during RECORDING mode:
TestAccDataSourceDnsManagedZone_basic[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

@shuyama1
Copy link
Member

/gcbrun

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1472 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1472 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 211 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 8 files changed, 256 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2472
Passed tests 2211
Skipped tests: 256
Failed tests: 5

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccFirebaserulesRelease_BasicRelease|TestAccApigeeAddonsConfig_apigeeAddonsTestExample|TestAccFrameworkProviderMeta_setModuleName|TestAccDataSourceDnsRecordSet_basic|TestAccDataSourceDnsManagedZone_basic

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccApigeeAddonsConfig_apigeeAddonsTestExample[Debug log]
TestAccFrameworkProviderMeta_setModuleName[Debug log]
TestAccDataSourceDnsRecordSet_basic[Debug log]

Tests failed during RECORDING mode:
TestAccDataSourceDnsManagedZone_basic[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Thank you for the work!

@shuyama1
Copy link
Member

Back to @trodge for final approval!

@trodge trodge merged commit 9fb5a77 into GoogleCloudPlatform:main Feb 16, 2023
kubalaguna pushed a commit to kubalaguna/magic-modules that referenced this pull request Feb 27, 2023
…rm#7083)

* Adds resource BitbucketServerConfig to CloudBuild.

* Adds example bitbucket config with peered_network and ssl_ca fields being used

* Minor code refactor. Removing unnecessary code for Cloud Build BitbucketServerConfig

* Update doc description mmv1/products/cloudbuild/api.yaml

Co-authored-by: Shuya Ma <[email protected]>

* Update doc description mmv1/products/cloudbuild/api.yaml

Co-authored-by: Shuya Ma <[email protected]>

---------

Co-authored-by: Mario Machado <[email protected]>
Co-authored-by: Shuya Ma <[email protected]>
ericayyliu pushed a commit to ericayyliu/magic-modules that referenced this pull request Jul 26, 2023
…rm#7083)

* Adds resource BitbucketServerConfig to CloudBuild.

* Adds example bitbucket config with peered_network and ssl_ca fields being used

* Minor code refactor. Removing unnecessary code for Cloud Build BitbucketServerConfig

* Update doc description mmv1/products/cloudbuild/api.yaml

Co-authored-by: Shuya Ma <[email protected]>

* Update doc description mmv1/products/cloudbuild/api.yaml

Co-authored-by: Shuya Ma <[email protected]>

---------

Co-authored-by: Mario Machado <[email protected]>
Co-authored-by: Shuya Ma <[email protected]>
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.

4 participants