Skip to content

Conversation

@sondrebr
Copy link

See issue #190

The command allows for cancelling multiple jobs in one command, e.g. bot: cancel jobid:1 jobid:2. The status table of each job is updated to show that the job was cancelled. A build job can only be cancelled by the job owner (the one who submitted it). This is done by adding the name of the job owner to the job metadata file, and checking that the name matches before cancelling the job.

A new setting is required for the command, 'cancel_command' in the '[buildenv]' section.

One small issue at the moment is that jobs that are known by the job manager get UNKNOWN status when they are cancelled, but I guess that can be easily ignored and fixed in another PR if needed.

I have (hopefully) updated the documentation and tests where necessary, although I haven't added any new tests.

First PR, sorry for the single huge commit 😅 Any feedback would be appreciated 🙂


# Update job status table
dt = datetime.now(timezone.utc)
update = f"\n|{dt.strftime("%b %d %X %Z %Y")}|finished|job id `{job_id}` was cancelled|"
Copy link

Choose a reason for hiding this comment

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

SyntaxError: invalid syntax
missing whitespace around modulo operator
missing whitespace around operator

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.

1 participant