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

Add proto validation for Projects #4909

Merged
merged 2 commits into from
Nov 7, 2024
Merged

Add proto validation for Projects #4909

merged 2 commits into from
Nov 7, 2024

Conversation

rdimitrov
Copy link
Member

Summary

Ref https://github.com/stacklok/minder-stories/issues/94

Change Type

Mark the type of change your PR introduces:

  • 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

Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.

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.

@rdimitrov rdimitrov self-assigned this Nov 7, 2024
@rdimitrov rdimitrov requested a review from a team as a code owner November 7, 2024 17:25
@coveralls
Copy link

coveralls commented Nov 7, 2024

Coverage Status

coverage: 54.763%. remained the same
when pulling 7bf7e26 on validate-projects
into 3eaf97a on main.

@@ -2317,7 +2317,14 @@ message UpdateProjectRequest {
];

// description is the description of the project to update.
Copy link
Member

Choose a reason for hiding this comment

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

This is uninterpreted text, right (not Markdown)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, also confirmed it with Giuseppe 👍

@@ -2336,7 +2343,14 @@ message ProjectPatch {
];

// description is the description of the project to update.
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed it 👍

string description = 3 [
(buf.validate.field).string = {
pattern: "[[:space:][:punct:][:word:]]*",
min_len: 1,
Copy link
Member

Choose a reason for hiding this comment

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

If min_len is 0, you don't need the ignore annotation.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed it 👍

// subject is the subject to which the role is assigned.
string subject = 2;
string subject = 2 [
(buf.validate.field).string = {uuid: true},
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure these are always UUIDs, but they may happen to be UUIDs for now. I think it's okay to leave this as-is at the moment.

@rdimitrov rdimitrov merged commit 74db684 into main Nov 7, 2024
25 checks passed
@rdimitrov rdimitrov deleted the validate-projects branch November 7, 2024 21:35
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