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

Implement storage and api for gate survey questions #4709

Merged

Conversation

jrobbins
Copy link
Collaborator

@jrobbins jrobbins commented Jan 17, 2025

This should resolve #4695. It is the first part of support self-certification of review gates. Basically, each review team can define some survey questions to screen feature owner review requests. If the answers to those questions indicate that the change is not a risk, then the feature owner will be able to click a button to get approval for that gate rather than wait for human review.

In this PR:

  • Define a new sub-model of Gate to hold survey question answers.
  • Add the survey answers to the converter logic and response openapi models when doing a GET on a Gate.
  • Add a SurveyAnswers openapi model to the requests that edit a gate.
  • Add logic to the GatesAPI to set either the existing assignee field or the new survey question answers field.
  • Add logic to determine when a gate is eligible for self certification based on the Privacy team survey questions.
  • Also, change the gate editing request type from POST to PATCH because that is more appropriate for editing, but keep backward compatibility by still handling POST for now.

@jrobbins jrobbins linked an issue Jan 17, 2025 that may be closed by this pull request
@@ -0,0 +1,55 @@
# Copyright 2025 Google Inc.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Time flies!

from internals.review_models import Gate, SurveyAnswers


def update_survey_answers(gate: Gate, new_answers: OASurveyAnswers):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Optional nit: This file could be named self_certify_helpers.py since it contains no classes and consists only of helper functions

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, it would seem odd to have an X_helpers file without having the X file first. I'll stick with the shorter name for now, but keep _helpers in mind.

@jrobbins jrobbins merged commit 66e03ca into main Jan 22, 2025
7 checks passed
@jrobbins jrobbins deleted the 4695-implement-storage-and-api-for-gate-survey-questions branch January 22, 2025 18:37
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.

Implement storage and API for gate survey questions
2 participants