Skip to content

pluginrpc-gen: align generator with generated#49920

Merged
thaJeztah merged 1 commit intomoby:masterfrom
mmorel-35:fix-nakedret
Jun 30, 2025
Merged

pluginrpc-gen: align generator with generated#49920
thaJeztah merged 1 commit intomoby:masterfrom
mmorel-35:fix-nakedret

Conversation

@mmorel-35
Copy link
Copy Markdown
Contributor

- What I did

Updated pluginrpc-gen so its behavior is aligned with the generated version in volume/drivers/proxy.go

- How I did it

Updated code and regenerate it.
Notice that pluginrpc-gen does not handle package {{ .Name }} // import "{{fullPackageName}}" generation

- How to verify it

go build . in pluginrpc-gen package an then execute pluginrpc-gen --type volumeDriver --name VolumeDriver -i volume/drivers/extpoint.go -o volume/drivers/proxy.go

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

@mmorel-35 mmorel-35 force-pushed the fix-nakedret branch 10 times, most recently from 92ac3a1 to 1ef9003 Compare May 4, 2025 10:10
@mmorel-35
Copy link
Copy Markdown
Contributor Author

mmorel-35 commented May 4, 2025

@thaJeztah ,
This will also allow to enable https://github.com/moby/moby/pull/49870/files#diff-6179837f7df53a6f05c522b6b7bb566d484d5465d9894fb04910dd08bb40dcc9R51 because of the // Generated code by * which is not correct according to strict generated exclusions in golangci-lint documentation:

exclusions:
    # Mode of the generated files analysis.
    #
    # - `strict`: sources are excluded by strictly following the Go generated file convention.
    #    Source files that have lines matching only the following regular expression will be excluded: `^// Code generated .* DO NOT EDIT\.$`
    #    This line must appear before the first non-comment, non-blank text in the file.
    #    https://go.dev/s/generatedcode
    # - `lax`: sources are excluded if they contain lines like `autogenerated file`, `code generated`, `do not edit`, etc.
    # - `disable`: disable the generated files exclusion.
    #
    # Default: strict
    generated: lax

@thaJeztah
Copy link
Copy Markdown
Member

Oh! I recall I looked at this once as well, and ISTR there was some discussion, but I really need to refresh my memory;

@mmorel-35 mmorel-35 force-pushed the fix-nakedret branch 7 times, most recently from cc32dd9 to f78ece4 Compare May 20, 2025 06:30
@thaJeztah
Copy link
Copy Markdown
Member

Kicked CI; looks like we're hitting GitHub's new rate-limits 😓

@thaJeztah
Copy link
Copy Markdown
Member

@cpuguy83 PTAL - I recall you had some reservations on updating this code; #46274

Copy link
Copy Markdown
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

Mostly seems fine, except for it looks like the generator is producing some not quite correct code.

I"m not sure about the short/long as the value this accepts.
I'd think supporting a duration string would be ideal... but I guess it really doesn't matter. We could support both... or just what is here and extend as needed.

Comment thread volume/drivers/proxy.go Outdated
@mmorel-35 mmorel-35 force-pushed the fix-nakedret branch 4 times, most recently from fff3777 to 3b71494 Compare May 20, 2025 22:20
Comment thread volume/drivers/proxy.go Outdated
// generated code - DO NOT EDIT
// Code generated by pluginrpc-gen. DO NOT EDIT.

package drivers // import "github.com/docker/docker/volume/drivers"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Except the // import "github.com/docker/docker/volume/drivers"
Everything is directly generated by pluginrpc-gen

@mmorel-35 mmorel-35 requested review from cpuguy83 and thaJeztah May 20, 2025 22:23
Comment thread pkg/plugins/pluginrpc-gen/template.go
@mmorel-35 mmorel-35 force-pushed the fix-nakedret branch 2 times, most recently from ccbe306 to 3477465 Compare May 21, 2025 06:45
@mmorel-35 mmorel-35 marked this pull request as draft May 21, 2025 06:51
@mmorel-35 mmorel-35 force-pushed the fix-nakedret branch 2 times, most recently from 0330c7f to 24cab3a Compare May 21, 2025 09:16
@mmorel-35 mmorel-35 marked this pull request as ready for review May 21, 2025 09:18
@mmorel-35 mmorel-35 force-pushed the fix-nakedret branch 7 times, most recently from bd795de to 5948632 Compare May 26, 2025 05:47
@mmorel-35 mmorel-35 requested a review from cpuguy83 June 24, 2025 05:43
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@thaJeztah thaJeztah merged commit 650ab23 into moby:master Jun 30, 2025
301 of 307 checks passed
@mmorel-35 mmorel-35 deleted the fix-nakedret branch June 30, 2025 15:00
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