Add option to restart jobs upon comment submission
- Renamed
addCommentstobulkJobsActionto handle both commenting and restarting jobs. - Added button-specific actions using
form.clickedButton. - Updated
fetchWithCSRFlogic to dynamically determine request URLs based on the button clicked. - Introduced separate success and error messages for restarting and commenting actions.
- Updated HTML to include "Restart and Comment" and "Comment" buttons with individual data URLs.
- Adjusted modal to allow submission of comments or restarts through the correct action handlers.
These updates enhance the user experience by allowing users to either comment on jobs, or perform restart with a comment simultaneously from the overview page. Comments always add to the original job of the overview page. By integrating this functionality we provide a workflow for users managing multiple jobs on the overview page.
https://progress.opensuse.org/issues/166559
please describe the relation to
- #5946
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.98%. Comparing base (
ebe44db) to head (29fdf01). Report is 15 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #5971 +/- ##
=======================================
Coverage 98.98% 98.98%
=======================================
Files 395 395
Lines 39417 39428 +11
=======================================
+ Hits 39017 39028 +11
Misses 400 400
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
fa-comment
I will take a look on 3 tmr
please describe the relation to
The difference between this PR and the previews is that the old PR solves the problem integrating the logic in the Comments.pm passing parameters in the underline function. It was requested to implement the solution using the Job.pm. This is not the case in this PR though.
You could base your PR on https://github.com/os-autoinst/openQA/pull/5981 but it looks like I'll have to put a little bit more work into it (as CI checks are currently failing).
UPDATED screenshot
**
**
I believe I addressed everything except the comments about the and substitution of or for the restart button
Some comments on 717e152b9f66615a5752397814660c9c94024d22
- Review commit message for main changes
- not sure if we prefer to rename the restartJob in openqa.js
- not sure if we prefer to provide a link for reload as it is for comments submittion. I went with auto reload for now
- I havent writen any additional tests as for now, other than the ones from the previous commit
[11:58:52] t/ui/12-needle-edit.t ...................... 2/?
# Failed test 'no longer on needle editor'
# at t/ui/12-needle-edit.t line 256.
# got: 'openQA: Needle Editor'
# expected: 'openQA: opensuse-13.1-DVD-i586-Build0091-textmode@32bit test results'
# Looks like you failed 1 test of 37.
[11:58:52] t/ui/12-needle-edit.t ...................... 3/?
# Failed test 'Create new needle'
# at t/ui/12-needle-edit.t line 395.
and
Retry 4 of 5 …
[12:00:13] t/ui/26-jobs_restart.t .. 1/?
# Failed test 'shows cloned job'
# at t/ui/26-jobs_restart.t line 102.
# 'http://localhost:59025/tests/99900'
# doesn't match '(?^u:/tests/99982)'
# Looks like you failed 1 test of 7.
# Failed test 'parent job shows options for advanced restart'
# at t/ui/26-jobs_restart.t line 104.
# Failed test 'warning with link to new job appears'
# at t/ui/26-jobs_restart.t line 144.
# ''
# doesn't match '(?^u:tests/99983)'
# Looks like you failed 1 test of 2.
# Failed test 'force restart'
# at t/ui/26-jobs_restart.t line 154.
# Failed test 'auto refresh to restarted job'
# at t/ui/26-jobs_restart.t line 160.
# 'http://localhost:59025/tests/99946'
# doesn't match '(?^u:tests/99984)'
# Looks like you failed 1 test of 3.
# Failed test 'successful restart'
# at t/ui/26-jobs_restart.t line 163.
# Looks like you failed 3 tests of 6.
[12:00:13] t/ui/26-jobs_restart.t .. 2/?
[11:58:52] t/ui/12-needle-edit.t ...................... 2/? # Failed test 'no longer on needle editor' # at t/ui/12-needle-edit.t line 256. # got: 'openQA: Needle Editor' # expected: 'openQA: opensuse-13.1-DVD-i586-Build0091-textmode@32bit test results' # Looks like you failed 1 test of 37. [11:58:52] t/ui/12-needle-edit.t ...................... 3/? # Failed test 'Create new needle' # at t/ui/12-needle-edit.t line 395.
To be honest this seems not relevant with the changes
and
Retry 4 of 5 … [12:00:13] t/ui/26-jobs_restart.t .. 1/? # Failed test 'shows cloned job' # at t/ui/26-jobs_restart.t line 102. # 'http://localhost:59025/tests/99900' # doesn't match '(?^u:/tests/99982)' # Looks like you failed 1 test of 7. # Failed test 'parent job shows options for advanced restart' # at t/ui/26-jobs_restart.t line 104. # Failed test 'warning with link to new job appears' # at t/ui/26-jobs_restart.t line 144. # '' # doesn't match '(?^u:tests/99983)' # Looks like you failed 1 test of 2. # Failed test 'force restart' # at t/ui/26-jobs_restart.t line 154. # Failed test 'auto refresh to restarted job' # at t/ui/26-jobs_restart.t line 160. # 'http://localhost:59025/tests/99946' # doesn't match '(?^u:tests/99984)' # Looks like you failed 1 test of 3. # Failed test 'successful restart' # at t/ui/26-jobs_restart.t line 163. # Looks like you failed 3 tests of 6. [12:00:13] t/ui/26-jobs_restart.t .. 2/?
This part seems a regression from my patch. will fix
A general request: Could you rebase your PRs more often on master? I personally do this whenever I push new changes. I fetch the origin, and when I see new commits, I rebase.
Great PR! Please pay attention to the following items before merging:
Files matching assets/stylesheets/**:
- [ ] Consider providing screenshots in a PR comment to show the difference visually
This is an automatically generated QA checklist based on modified files.
Hm, I am trying out the PR locally, and I can't get it to write a comment. The restart is triggered, but no comment is written. Clicking on the "Restart and comment on x jobs" button.
edit: see my actual comments on the code for the reason and the fix
Hm, I am trying out the PR locally, and I can't get it to write a comment. The restart is triggered, but no comment is written. Clicking on the "Restart and comment on x jobs" button.
Was this resolved? If yes then please mark it as such
Hm, I am trying out the PR locally, and I can't get it to write a comment. The restart is triggered, but no comment is written. Clicking on the "Restart and comment on x jobs" button.
Was this resolved? If yes then please mark it as such
I just tested and worked for me.
Was this resolved? If yes then please mark it as such
yeah, when I found out the reason for that, I commented on the actual code. I guess without this context it was confusing.