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

tools: auto insert the generated field and messaged from a new proto field #2511

Merged
merged 6 commits into from
Sep 6, 2024

Conversation

jingyih
Copy link
Collaborator

@jingyih jingyih commented Aug 15, 2024

The insertion is mechanical, based on go file parsing.

This PR is rebased on #2425, which is AI-based inseration.

Future work:

  • Update mappers (should be able to update mappers by rerunning the mapper generator)
  • Update tests and docs, etc

@jingyih jingyih force-pushed the insert_field branch 2 times, most recently from 8073bb4 to 570dc6f Compare August 15, 2024 00:54
@jingyih
Copy link
Collaborator Author

jingyih commented Aug 15, 2024

How do we fix merge conflict on go.work? @yuwenma

Conflicting files

dev/tools/controllerbuilder/go.mod
dev/tools/controllerbuilder/go.sum
go.work.sum

@jingyih jingyih force-pushed the insert_field branch 4 times, most recently from b7c1cc8 to a5f2c13 Compare August 15, 2024 20:57
@jingyih
Copy link
Collaborator Author

jingyih commented Aug 27, 2024

/assign @jasonvigil @justinsb

Copy link
Collaborator

@jasonvigil jasonvigil left a comment

Choose a reason for hiding this comment

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

This is cool 👍

ast.Inspect(file, func(n ast.Node) bool {
switch node := n.(type) {
case *ast.GenDecl:
if node.Tok != token.TYPE || len(node.Specs) == 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like || len(node.Specs) == 0 is unnecessary?

@jasonvigil
Copy link
Collaborator

/approve

Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jasonvigil

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

revert changes made by the update tool. update go mod.
@jingyih
Copy link
Collaborator Author

jingyih commented Sep 6, 2024

Rebased

@jasonvigil
Copy link
Collaborator

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Sep 6, 2024
@google-oss-prow google-oss-prow bot merged commit 1ed7c14 into GoogleCloudPlatform:master Sep 6, 2024
15 checks passed
@yuwenma yuwenma added this to the 1.122 milestone Oct 25, 2024
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.

4 participants