Skip to content

fix: openqa-investigate comment deletion error - #721

Closed
okurz wants to merge 1 commit into
os-autoinst:masterfrom
okurz:feature/009_gh718_fix_delete_comment_error
Closed

okurz wants to merge 1 commit into
os-autoinst:masterfrom
okurz:feature/009_gh718_fix_delete_comment_error

Conversation

@okurz

@okurz okurz commented Sep 24, 2026

Copy link
Copy Markdown
Member

Motivation
Parallel execution of openqa-investigate results in crashes when attempting
to delete job comments that either do not exist (404) or lack permission (403).

Design Choices
Implemented ignore_status parameter in _run_openqa_cli to catch and swallow
HTTP 403 and 404 errors during openqa-cli execution. Extracted a helper function
to keep McCabe complexity low, and normalized parameter annotations.

Benefits
Enhances robust parallel execution of job comment cleanup and prevents
unnecessary job crashes while maintaining detailed error output for unhandled
API issues.

Related issue: #718

Motivation
Parallel execution of openqa-investigate results in crashes when attempting
to delete job comments that either do not exist (404) or lack permission (403).

Design Choices
Implemented ignore_status parameter in _run_openqa_cli to catch and swallow
HTTP 403 and 404 errors during openqa-cli execution. Extracted a helper function
to keep McCabe complexity low, and normalized parameter annotations.

Benefits
Enhances robust parallel execution of job comment cleanup and prevents
unnecessary job crashes while maintaining detailed error output for unhandled
API issues.

Related issue: os-autoinst#718
@perlpunk

perlpunk commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

When I checked yesterday, the comment in question did still exist and was by geekotest, so why would there be a 403?
https://openqa.opensuse.org/tests/6234008#comments the second comment is now gone, though.

edit: hm, according to the audit log you deleted the comment yesterday. I think ignoring 403 won't solve anything. Then we can just remove the code that tries to delete comments. Wasn't the problem rather that users can't delete their own comments?

@perlpunk perlpunk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See my comment, I think we should clarify first

@okurz

okurz commented Sep 25, 2026

Copy link
Copy Markdown
Member Author

edit: hm, according to the audit log you deleted the comment yesterday. I think ignoring 403 won't solve anything. Then we can just remove the code that tries to delete comments. Wasn't the problem rather that users can't delete their own comments?

Yes, first I thought so as well. But then why would we only see a sporadic problem? I think I will try with another test account with different permission level

@okurz

okurz commented Sep 25, 2026 •

Copy link
Copy Markdown
Member Author

Thought about it and decided for a change in openQA. Closing this PR in favor of the upstream openQA change (os-autoinst/openQA#7875) which allows comment authors to delete their own comments directly. Since these scripts are most likely only deployed on our continuously updated openQA instances, the upstream fix is the cleanest solution and avoids needing error-swallowing workarounds here.

@okurz okurz closed this Sep 25, 2026
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.

3 participants