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

Move protos to their own directory for more consistency between different language bindings #180

Merged
merged 5 commits into from
Apr 11, 2023

Conversation

marcelamelara
Copy link
Contributor

@marcelamelara marcelamelara commented Mar 29, 2023

This creates a directory structure for all protos. The main goal is to have a directory structure that mirrors the package name/structure we want the different language bindings to have (per #172 (comment)). This also seems like the most sustainable solution to the issue described here.

Cons: The proto package name is changing from what we tagged in v1.0! This will be a breaking change in case there's anyone who is already using our protos. Need to discuss how to handle this divergence from our tagged v1.0 package name.

Blocking #172

@marcelamelara marcelamelara requested a review from a team March 29, 2023 16:28
@marcelamelara marcelamelara force-pushed the reorg-protos branch 2 times, most recently from 8a6b972 to 4a1e8f3 Compare March 30, 2023 23:49
@marcelamelara marcelamelara marked this pull request as ready for review March 30, 2023 23:56
docs/protos.md Outdated Show resolved Hide resolved
protos/in_toto_attestation/predicates/vsa/v0_2/vsa.proto Outdated Show resolved Hide resolved

import "google/protobuf/struct.proto";

option go_package = "github.com/in-toto/attestation/go/spec/v1.0";
option go_package = "github.com/in-toto/attestation/go/v1";
Copy link
Contributor

Choose a reason for hiding this comment

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

Why drop the .0?

We dropped the .0 from the type string because any new fields are supposed to be backwards compatible unless or else they need to increment the major number. However we may want to make backwards compatible changes to these messages, which would rev the minor version, even though the major version and type string would be unchanged.

So I think it's appropriate to keep .0 here so that we can introduce 1.1 in the future with new fields.

Or maybe, the argument goes, if it really is backwards compatible, then producers of the v1 proto would be unaffected by new fields and could just transparently take the new definition. Is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if it really is backwards compatible, then producers of the v1 proto would be unaffected by new fields and could just transparently take the new definition. Is that right?

Yes, this is the intent. I do realize now that we probably want to document basic protos rules to facilitate this:

  • no field re-ordering within a major version
  • no field type changes within a major version
  • no required fields

Would this work? Also, is there a way to encode the current proto spec version into the definition?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah that makes sense. Maybe we can just link to this https://protobuf.dev/programming-guides/proto3/#updating ?

is there a way to encode the current proto spec version into the definition?

What do you mean by proto spec version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean by proto spec version?

The statement spec is currently at version 1.0, so is there a way to encode/validate this version number in the corresponding proto? I suspect the answer is no.

Copy link
Contributor

@TomHennen TomHennen Apr 3, 2023

Choose a reason for hiding this comment

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

Oh I see. That's something I had wanted to use cuelang.org and vet for. Theoretically you could create cuelang definitions to validate all the rules in the spec. It would be nice to have them for all predicates. If you're still looking for project ideas for that event you're organizing I meant to add that to the list. :)

@marcelamelara marcelamelara requested review from TomHennen, adityasaky and a team April 6, 2023 22:06
Copy link
Member

@adityasaky adityasaky left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@pxp928 pxp928 left a comment

Choose a reason for hiding this comment

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

LGTM. Had a question about the double makefiles but that was already answered in the previous comments.

marcelamelara and others added 5 commits April 11, 2023 14:15
Signed-off-by: Marcela Melara <[email protected]>

Add versioned subdirectory to vsa predicate proto

Signed-off-by: Marcela Melara <[email protected]>

Remove minor version from protos directory structure; update go package name

Signed-off-by: Marcela Melara <[email protected]>

Add disclaimer to documentation about protos stability pre v1.1; add how to

Signed-off-by: Marcela Melara <[email protected]>

Update directory structure and imports

Signed-off-by: Marcela Melara <[email protected]>
@marcelamelara marcelamelara merged commit 6f15f1a into in-toto:main Apr 11, 2023
@marcelamelara marcelamelara deleted the reorg-protos branch May 10, 2023 21:04
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.

5 participants