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: Simplify the controller registration step via tooling #3459

Merged

Conversation

yuwenma
Copy link
Collaborator

@yuwenma yuwenma commented Jan 7, 2025

Change description

Fixes #

Tests you have done

  • Run make ready-pr to ensure this PR is ready for review.
  • Perform necessary E2E testing for changed resources.

return scaffold.Scaffold(serviceName, o.ProtoName, cArgs)
err1 := scaffold.GenerateController(serviceName, o.ProtoName, cArgs)
err2 := scaffold.RegisterController(serviceName, o.ProtoName)
if err1 != nil || err2 != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I think you can just always return errors.Join(err1, err2)

modelPath := strings.TrimSuffix(bi.Main.Path, currRelPath)

importPath := filepath.Join(modelPath, directControllerRelPath, service)
added := astutil.AddNamedImport(fset, f, "_", importPath)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Very cool!

@google-oss-prow google-oss-prow bot added the lgtm label Jan 8, 2025
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb

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

The pull request process is described here

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

@google-oss-prow google-oss-prow bot merged commit c58ff17 into GoogleCloudPlatform:master Jan 8, 2025
17 checks passed
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.

2 participants