Skip to content

feat: add Go types for CloudBuildTrigger#6926

Merged
cheftako merged 4 commits into
GoogleCloudPlatform:masterfrom
codebot-robot:issue_6923
Mar 8, 2026
Merged

feat: add Go types for CloudBuildTrigger#6926
cheftako merged 4 commits into
GoogleCloudPlatform:masterfrom
codebot-robot:issue_6923

Conversation

@codebot-robot

Copy link
Copy Markdown
Collaborator

This PR adds the Go types and generate.sh script for CloudBuildTrigger as requested in Issue #6923.

It ensures that:

  • The generate.sh file generates types for google.devtools.cloudbuild.v1.
  • The new Go struct exactly matches the original CustomResourceDefinition, meaning check_crd_equivalence accepts it.
  • status.observedGeneration is correctly typed as *int64.
  • generate-mapper builds without issues, including some custom mappings where needed.

This PR was generated by the gemini-3-flash-preview model.

Fixes #6923

This commit introduces the necessary Go types and generate.sh
for CloudBuildTrigger in apis/cloudbuild/v1beta1/ to migrate the resource
from the Terraform controller to the direct controller.

The schema matches the existing CRD exactly to ensure backward compatibility.

Issue GoogleCloudPlatform#6923

@codebot-robot codebot-robot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed CI failure by adding missing copyright headers and updating the year to 2026 for CloudBuildTrigger mappings.

@codebot-robot

Copy link
Copy Markdown
Collaborator Author

--- INVESTIGATION REPORT ---
Run ID: 22734550626
Name: ci-presubmit
Cause: Code Error
Details: tests/apichecks TestMissingRefs failed because the workerPool field in CloudBuildTrigger lost its description when Go types were generated, causing the heuristic to stop flagging it as a potential reference.
Action Taken: Restored the description for workerPool in apis/cloudbuild/v1beta1/buildtrigger_types.go and regenerated the CRD.

Run ID: 22733797950
Name: Presubmit
Cause: Code Error
Details: pkg/controller/direct/cloudbuild/trigger_mappings.go was missing a license header.
Action Taken: This was fixed in commit e8f9837512ac578bc1bf159947492c102c7e5400. I verified that all files now have correct license headers.

@cheftako cheftako left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please only change the copyright year on new files.

See the License for the specific language governing permissions and
limitations under the License.
*/
// Copyright 2026 Google LLC

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

pkg/controller/direct/cloudbuild/workerpool_mappings.go is not a new file. As such we should not be changing the copyright year on this file. Please change it back to 2024.

@codebot-robot codebot-robot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reverted the copyright year in back to 2024 as it is not a new file. Verified that new files added in this PR maintain the 2026 copyright year.

@codebot-robot codebot-robot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reverted the copyright year in pkg/controller/direct/cloudbuild/workerpool_mappings.go back to 2024 as it is not a new file. Verified that new files added in this PR maintain the 2026 copyright year.

@cheftako cheftako left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks Codebot!

@cheftako cheftako added this pull request to the merge queue Mar 8, 2026
@google-oss-prow google-oss-prow Bot added the lgtm label Mar 8, 2026
@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheftako

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codebot-robot codebot-robot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the approval! I've verified that all review comments are addressed, including reverting the copyright year for existing files and ensuring the CloudBuildTrigger types are correctly generated and equivalent to the CRD.

Merged via the queue into GoogleCloudPlatform:master with commit ec56916 Mar 8, 2026
167 checks passed
@xiaoweim xiaoweim added this to the 1.147 milestone Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create generate.sh and types.go files for CloudBuild Trigger

3 participants