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

[BUG] resolveDeprecatedIndex() isn't functioning. #116

Closed
ogoshikazuki opened this issue Apr 12, 2024 · 3 comments · Fixed by #117
Closed

[BUG] resolveDeprecatedIndex() isn't functioning. #116

ogoshikazuki opened this issue Apr 12, 2024 · 3 comments · Fixed by #117
Labels
Bug Something isn't working

Comments

@ogoshikazuki
Copy link

Description

resolveDeprecatedIndex() isn't functioning.
In my project, the version of the buf module in protovalidate was fixed to commit 998a6885b3f74d08847b9c24571fdf08 in buf.lock.
Commit 998a6885b3f74d08847b9c24571fdf08 has an old extension field number of 51071.
Even so, protovalidate-go was functioning up to v0.3.2, but stopped working from v0.3.3.
I suspect the cause is in #57.

Steps to Reproduce

  1. In buf.yaml, you would include the following:
deps:
  - buf.build/bufbuild/protovalidate:998a6885b3f74d08847b9c24571fdf08
  1. buf mod update
  2. buf generate
  3. protovalidate-go functions with v0.3.2 but does not function with v0.3.3.

Expected Behavior

Even if the buf module version of protovalidate is old, protovalidate-go@v0.3.3 and later will function.

Actual Behavior

When the version of the buf module in protovalidate is commit 998a6885b3f74d08847b9c24571fdf08 and protovalidate-go is at v0.3.3, protovalidate-go does not function.

Screenshots/Logs

Nothing.

Environment

  • Operating System: macOS
  • Version: macOS 14.3.1
  • Compiler/Toolchain: Go1.22.2
  • Protobuf Compiler & Version: buf v1.28.1
  • Protoc-gen-validate Version: v0.3.3 and later
  • Protovalidate Version: commit 998a6885b3f74d08847b9c24571fdf08

Possible Solution

I suspect the cause is in #57.

Additional Context

Nothing.

@ogoshikazuki ogoshikazuki added the Bug Something isn't working label Apr 12, 2024
@rodaine
Copy link
Member

rodaine commented Apr 12, 2024

Hey, @ogoshikazuki! Thanks for the great bug report. Wrote up a quick patch that should fix the issue!

rodaine added a commit that referenced this issue Apr 16, 2024
In #57, the resolver was improved to handle dynamically created
descriptors and inconsistent types but silently broke resolving the
deprecated version of the protovalidate extension (introduced in
[protovalidate
v0.2.0](bufbuild/protovalidate@v0.1.15...v0.2.0)).
This patch dries up the resolver a bit and fixes the (albeit deprecated)
behavior.

Fixes #116
@ogoshikazuki
Copy link
Author

@rodaine
When do you plan to release this?

@rodaine
Copy link
Member

rodaine commented Apr 22, 2024

Released! https://github.com/bufbuild/protovalidate-go/releases/tag/v0.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants