-
Notifications
You must be signed in to change notification settings - Fork 113
Add job delete support #4717
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 job delete support #4717
Conversation
Dropped some random stuff, this is not a review as I do not feel confident to do that yet. |
eca164d
to
ab73a24
Compare
Note that Snyk is wrong, no directory traversal is possible since it uses uuid.Parse() to make sure the id is a uuid not some arbitrary string. |
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.
Thanks for adding those contexts.
461e9eb
to
abe1fc1
Compare
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.
Yeah this is great! Small nitpick, but this is ready.
Someone else please review!
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.
Thanks for the PR.
I've added a few questions inline and agree with @lzap's comment about carrying ctx
when interacting with the DB. The rest LGTM.
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.
Sorry, I misclicked. I wanted to request changes, instead of approving 😇
This allows database entries to be deleted. Related: RHEL-60120
This allows jobs to be deleted from the database. Currently only implemented by fsjobqueue. The function for dbjobqueue currently returns nil. This will remove all the job files used by the root job UUID as long as no other job depends on them. ie. It starts at the top, and moves down the dependency tree until it finds a job that is also used by another job, removes the job to be deleted from its dependants list, and moves back up the tree only deleting jobs with empty dependants lists. Related: RHEL-60120
Related: RHEL-60120
This adds SQL to delete jobs and dependencies, and implements the database version of the DeleteJob function. Related: RHEL-60120
This adds tests for retrieving all root jobs, and deleting jobs and unused dependencies. These tests are run against the fsjobqueue for unit testing, and against dbjobqueue for integration testing. Resolves: RHEL-60120
This removes all artifact directories, and their contents, if there isn't an associated Job. This is used to clean up local artifacts after the compose job has been deleted. Related: RHEL-60120
This will be used to delete jobs and their artifacts. Related: RHEL-60120
This adds the handler for DELETE /composes/{id} which will delete a job and all of its dependencies, and any artifacts. Related: RHEL-60120
Related: RHEL-60120
It was returning a null body instead of an empty list. Related: RHEL-60120
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.
All good. Thanks for the changes and your patience!
This pull request includes: