Skip to content

pluginrpc-gen: align generator with generated #49920

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mmorel-35
Copy link
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
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
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
Member

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

@thaJeztah
Copy link
Member

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

Copy link
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.

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

package drivers // import "github.com/docker/docker/volume/drivers"
Copy link
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
@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 6 times, most recently from 8661489 to bd795de Compare May 22, 2025 09:27
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
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.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy