Conversation
yuechao-qin
reviewed
Jan 21, 2026
Collaborator
yuechao-qin
left a comment
There was a problem hiding this comment.
Some questions/comments. Great work getting secrets working quickly!
| current_time = _get_current_time() | ||
| secret = session.get(bts.Secret, (user_id, secret_id)) | ||
| if secret: | ||
| if not raise_if_exists: |
Collaborator
There was a problem hiding this comment.
Suggested change
| if not raise_if_exists: | |
| if raise_if_exists: |
I believe you don't want the not here?
| # This hash is not used, so we're using a dummy value here that makes it possible to identify the secret arguments in the following code. | ||
| hash=secret_hash, | ||
| ) | ||
| session.rollback() |
Collaborator
There was a problem hiding this comment.
Curious why is there a rollback here? I didn't notice any session changes.
Comment on lines
+1068
to
+1069
| secret_id=secret_id, | ||
| secret_value=secret_value, |
Collaborator
There was a problem hiding this comment.
Curious is there any validation needed for secret id/value? For example, what if they were empty strings?
| session: orm.Session, | ||
| user_id: str, | ||
| secret_id: str, | ||
| ): |
Collaborator
There was a problem hiding this comment.
Suggested change
| ): | |
| ) -> None: |
| secret_value: str, | ||
| raise_if_not_exists: bool = False, | ||
| raise_if_exists: bool = False, | ||
| ): |
Collaborator
There was a problem hiding this comment.
Suggested change
| ): | |
| ) -> None: |
Comment on lines
+1017
to
+1018
| ): | ||
| return self._set_secret_value( |
Collaborator
There was a problem hiding this comment.
Suggested change
| ): | |
| return self._set_secret_value( | |
| ) -> None: | |
| self._set_secret_value( |
_set_secret_value doesn't return anything, so a return is not necessary here?
Comment on lines
+1033
to
+1034
| ): | ||
| return self._set_secret_value( |
Collaborator
There was a problem hiding this comment.
Suggested change
| ): | |
| return self._set_secret_value( | |
| ) -> None: | |
| self._set_secret_value( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
API changes
List secrets: GET
/api/secrets/.Create a secret: POST
/api/secrets/.Update a secret: PUT
/api/secrets/{secret_id}.Delete a secret: DELETE
/api/secrets/{secret_id}.DB changes
TaskSpec changes
Fixes: #51