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 messages only used to generate Go structs out of minder.proto #3830

Merged
merged 5 commits into from
Jul 11, 2024

Conversation

jhrozek
Copy link
Contributor

@jhrozek jhrozek commented Jul 10, 2024

Summary

This was brought up in PR #3797. We already have several messages that only
exist to generate Go structures out of them and use them with reflection. When
we add the profile selector messages, we'll have even more and our proto file
is going to become messy.

Instead, let's split out a new proto file and use it to store all the messages
that are really just a way to express Go structs.

Fixes: #3829

Change Type

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

make test

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

@jhrozek jhrozek requested a review from a team as a code owner July 10, 2024 12:40
@coveralls
Copy link

coveralls commented Jul 10, 2024

Coverage Status

coverage: 53.056% (+0.004%) from 53.052%
when pulling 880c702 on jhrozek:internal_proto
into a441c32 on stacklok:main.

@jhrozek
Copy link
Contributor Author

jhrozek commented Jul 10, 2024

Hold this - @dmjb had a good point that we should try getting rid of the structs first and foremost.

blkt
blkt previously approved these changes Jul 10, 2024
Copy link
Contributor

@blkt blkt left a comment

Choose a reason for hiding this comment

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

Minor comment.

pkg/api/openapi/internal.swagger.json Show resolved Hide resolved
@jhrozek
Copy link
Contributor Author

jhrozek commented Jul 11, 2024

Hold this - @dmjb had a good point that we should try getting rid of the structs first and foremost.

I think we can actually review and merge this PR. @dmjb mentioned he wanted to get rid of the structs which is a good idea, but we'll need the internal proto file to include the selector messages anyway (the CEL evaluator works much easier with protobuf messages).

It doesn't really matter whether we remove the messages that this PR moves to the internal proto file from the original proto file or the internal one and having the internal proto file created would enable us to move the selector messages there.

dmjb
dmjb previously approved these changes Jul 11, 2024
Adds a new proto file under the internal/ directory tree and modifies
the `buf.work.yaml` file so that the new internal/proto directory is a
module.

Resolves: mindersec#3829
Uses the newly added Go structs that are generated out of the
internal.proto file.
…file

This commit just removes the now no longer used messages from the public
minder.v1 module.
@jhrozek jhrozek merged commit df6cf1c into mindersec:main Jul 11, 2024
22 checks passed
dmjb pushed a commit that referenced this pull request Jul 12, 2024
…3830)

* Move protobuf messages only used internal to an internal proto file

Adds a new proto file under the internal/ directory tree and modifies
the `buf.work.yaml` file so that the new internal/proto directory is a
module.

Resolves: #3829

* Flip Minder code to use the Go structs from the internal proto file

Uses the newly added Go structs that are generated out of the
internal.proto file.

* Remove the structs we moved to internal proto file from the v1 proto file

This commit just removes the now no longer used messages from the public
minder.v1 module.

* Only check proto files in the proto subdir for backwards compatibility

* Exclude internal/proto from code coverage
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.

Split messages that are only used to generate Go structs from minder.proto
4 participants