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

protoc: support identifiers as reserved names in addition to string literals (only in editions) #13471

Closed

Conversation

jhump
Copy link
Contributor

@jhump jhump commented Aug 8, 2023

This addresses #13440.

@mkruskal-google, I saw you are assigned the above issue. I hope it's okay that I took a stab at it.

@jhump jhump requested a review from a team as a code owner August 8, 2023 19:51
@jhump jhump requested review from sbenzaquen and removed request for a team August 8, 2023 19:51
@mkruskal-google mkruskal-google added protoc 🅰️ safe for tests Mark a commit as safe to run presubmits over labels Aug 8, 2023
@mkruskal-google mkruskal-google self-requested a review August 8, 2023 20:19
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Aug 8, 2023
@mkruskal-google
Copy link
Member

Np, thanks Joshua!

@mkruskal-google
Copy link
Member

After discussing this a bit with the team, I think we can make this a stronger condition. Under editions, we can require the new syntax, since there's a simple no-op transformation for prototiller to upgrade to during the edition migration

@jhump
Copy link
Contributor Author

jhump commented Aug 8, 2023

After discussing this a bit with the team, I think we can make this a stronger condition. Under editions, we can require the new syntax, since there's a simple no-op transformation for prototiller to upgrade to during the edition migration

Ah, very good idea! I'll have that change pushed pretty soon.

@jhump
Copy link
Contributor Author

jhump commented Aug 8, 2023

@mkruskal-google, I think this is ready for another look. Editions now requires identifiers. The error message for when a user gets it backwards (e.g. tries to use an identifier in proto2 or proto3 or a string literal in editions) should be very clear now, too.

@mkruskal-google mkruskal-google added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Aug 9, 2023
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Aug 9, 2023
@mkruskal-google
Copy link
Member

Awesome lgtm, thanks for the contribution!

copybara-service bot pushed a commit that referenced this pull request Aug 10, 2023
…iterals (only in editions) (#13471)

This addresses #13440.

@mkruskal-google, I saw you are assigned the above issue. I hope it's okay that I took a stab at it.

Closes #13471

COPYBARA_INTEGRATE_REVIEW=#13471 from jhump:jh/reserved-names-support-identifiers a23f18e
FUTURE_COPYBARA_INTEGRATE_REVIEW=#13471 from jhump:jh/reserved-names-support-identifiers a23f18e
PiperOrigin-RevId: 555559034
copybara-service bot pushed a commit that referenced this pull request Aug 10, 2023
…iterals (only in editions) (#13471)

This addresses #13440.

@mkruskal-google, I saw you are assigned the above issue. I hope it's okay that I took a stab at it.

Closes #13471

COPYBARA_INTEGRATE_REVIEW=#13471 from jhump:jh/reserved-names-support-identifiers a23f18e
FUTURE_COPYBARA_INTEGRATE_REVIEW=#13471 from jhump:jh/reserved-names-support-identifiers a23f18e
PiperOrigin-RevId: 555559034
copybara-service bot pushed a commit that referenced this pull request Aug 10, 2023
…iterals (only in editions) (#13471)

This addresses #13440.

@mkruskal-google, I saw you are assigned the above issue. I hope it's okay that I took a stab at it.

Closes #13471

COPYBARA_INTEGRATE_REVIEW=#13471 from jhump:jh/reserved-names-support-identifiers a23f18e
FUTURE_COPYBARA_INTEGRATE_REVIEW=#13471 from jhump:jh/reserved-names-support-identifiers a23f18e
PiperOrigin-RevId: 555559034
jhump added a commit to bufbuild/protocompile that referenced this pull request Aug 23, 2023
…es (#176)

This implements the use of identifiers, instead of string literals, in
`reserved` statements. This new syntax is for editions; proto2 and
proto3 continue to use string literals for backwards compatibility.

This effectively ports protocolbuffers/protobuf#13471
to protocompile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants