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

occ background-job:delete #42670

Merged
merged 1 commit into from
Jan 15, 2024
Merged

Conversation

ArtificialOwl
Copy link
Member

allow an admin to remove a background job entry from the database

Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

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

This is potentially very dangerous and at the same time some apps might regenerate their jobs.
So far I never had the case where an admin would have needed to delete a job? Can you give an example?

use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;

class DeleteCommand extends Base {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
class DeleteCommand extends Base {
class DeleteJob extends Base {

?

@ArtificialOwl
Copy link
Member Author

This is potentially very dangerous and at the same time some apps might regenerate their jobs. So far I never had the case where an admin would have needed to delete a job? Can you give an example?

The only one I have in mind right now is this issue with a background job that could not resolve itself:
#42489

It is a unique job that remove itself when its purpose is over.
While this job should be fixed by #42667 it also made us realize there is no easy way to cancel it

@ArtificialOwl ArtificialOwl force-pushed the enh/noid/occ-background-job-delete branch from 56c72e3 to 57ddf34 Compare January 10, 2024 09:41
@ArtificialOwl ArtificialOwl added this to the Nextcloud 29 milestone Jan 10, 2024
@ArtificialOwl ArtificialOwl added the 3. to review Waiting for reviews label Jan 10, 2024
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/occ-background-job-delete branch from 57ddf34 to ef2c76d Compare January 10, 2024 16:07
@come-nc
Copy link
Contributor

come-nc commented Jan 11, 2024

Please just name the file Delete.php and the class Delete if the command is :delete.

ListCommmand is called ListCommand because list is a reserved keyword, delete is not.

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/occ-background-job-delete branch from 7001e41 to bd3df75 Compare January 12, 2024 00:17
@joshtrichards
Copy link
Member

Could "hide" being NC_debug but the built-in confirmation might also be enough warning.

@ArtificialOwl ArtificialOwl merged commit 083a9d8 into master Jan 15, 2024
50 checks passed
@ArtificialOwl ArtificialOwl deleted the enh/noid/occ-background-job-delete branch January 15, 2024 10:36
@ArtificialOwl
Copy link
Member Author

/backport to stable28

@backportbot-nextcloud
Copy link

The backport to stable28 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable28
git pull origin stable28

# Create the new backport branch
git checkout -b fix/foo-stable28

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable28

Error: Unknown error

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants