-
Notifications
You must be signed in to change notification settings - Fork 2
Updated Mutexbot CLI flow to use DB #42
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
Merged
Merged
Conversation
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
jcgruenhage
reviewed
Sep 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start! I think the areas where this still needs improvement are:
- Better leveraging the type system. This includes using
sqlx
to provide type checked sql queries, but also to define structs in favor of tuples to ensure we have clarity on what a field is. That thei64
inVec<(i64, String)>
returned bycheck_blocking_deployments
is probably the ID of the deployments returned is relatively obvious, but knowing what theString
is, is guesswork without looking at the code of the function. I shouldn't need to read code, names and types of parameters, and types of return values should be enough to know what to expect of a function. If that's not possible, the documentation of the function should cover this. Doing this helps both tooling to verify that the code is working as intended, and helps developers working on the code. - Right now we're not changing the outside interface at all. Doing that is necessary though, and I think it'd be okay to revamp most of it. New CLI name, new operation modes (start, cancel, finish), new parameter handling. This should be fairly straight forward though.
- To make updating this in the future easier we need to have the tool handle it's DB migrations. Having them embedded in the repo here also means we're able to do code review on them.
Improved printing of blocking deployments.
jcgruenhage
reviewed
Sep 10, 2025
jcgruenhage
reviewed
Sep 10, 2025
Add missing params to Reserve function.
jcgruenhage
reviewed
Sep 11, 2025
Removed other params from check_blocking_deployments and get them from DB.
jcgruenhage
reviewed
Sep 19, 2025
jcgruenhage
reviewed
Sep 19, 2025
jcgruenhage
reviewed
Sep 19, 2025
Co-authored-by: JC Grünhage <[email protected]>
Added run commands for all modes.
jcgruenhage
approved these changes
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now :)
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.
Related to https://databricks.atlassian.net/browse/LKB-3161.
Update Mutexbot CLI flow to use DB for reservation instead of API.
It has 4 CLI methods:
Start
- start deployment for givencomponent
,region
andenvironment
. Returnsdeployment_id
.Finish
- finish deployment (for givendeployment_id
)Cancel
- cancel deployment (for givendeployment_id
)Info
- print info about deployment (for givendeployment_id
)Start
methodInsert deployment record to DB, table
deployments
Check whether any deployments for the same region by other components with a smaller queue position exist that haven't finished yet. Wait and check until there is no queued deployment anymore.
Update
start_timestamp
in the deployments table.