Commit graph

220 commits

Author SHA1 Message Date
Christian Gmeiner
84ea560e11 bin/ci: Update python-gitlab to 5.x for Python 3.14 compatibility
Update python-gitlab from 4.x to 5.x to fix AttributeError with
__annotations__ when running on Python 3.14. The 4.x series is
incompatible with Python 3.14 due to changes in how class annotations
are handled.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38123>
2025-10-29 08:16:39 +00:00
Christian Gmeiner
c4c545b287 bin/ci: Fix SyntaxWarning about return in finally block
Remove the finally block with a return statement in GitlabGQL.query()
method. This pattern causes a SyntaxWarning in Python 3.14 as the return
in finally will override any return value or exception from the try/except
blocks.

Move the return statement to the end of the except block where it belongs,
maintaining the same error recovery behavior while fixing the warning.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38123>
2025-10-29 08:16:39 +00:00
Job Noorman
3b2f7ed918 ci,marge_queue: read token from file by default
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This allows token to be stored in ~/.config/gitlab-token instead of
passing them as an argument.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37916>
2025-10-16 17:40:51 +00:00
Sergi Blanch Torne
d0af217911 ci: Add missing aiohttp Python dependecy
Found a missing dependency for `pipeline_message.py`.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37868>
2025-10-15 23:48:53 +00:00
Sergi Blanch Torne
3d444619e0 ci,marge_queue: introduce testing
This script didn't have tests defined. Now, the objects on this tool have
tests to verify its functionality, as well as the core method called to do
all the processes to provide a sorted list of the marge queue.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37395>
2025-10-09 12:12:42 +00:00
Sergi Blanch Torne
50c4ec0620 ci,marge_queue: use rich module
As proposed in !37454, we can benefit from `rich` python module to simplify
output formatting. Using it here it's only the link print in console what
needs to be adjusted. There is a side effect, that look ok, with some
coloring in the timestamps and MR ids listed.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37395>
2025-10-09 12:12:42 +00:00
Sergi Blanch Torne
1d38792d62 ci,marge_queue: handle GitLab auth exception
Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37395>
2025-10-09 12:12:42 +00:00
Sergi Blanch Torne
f41dcfcec7 ci,marge_queue: queue element formatting
The output line with the MR link only works in some consoles; it can be
interesting for some developers to have visibility of the MR id. 

It can be useful, too, to have some sort of a header showing the fields
printed from each merge request in the queue.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37395>
2025-10-09 12:12:41 +00:00
Sergi Blanch Torne
b80a93dac0 ci,marge_queue: encapsulate GitLab module queries
For testing and an eventual use of tenacity, it is practical to encapsulate
calls to the GitLab module in methods.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37395>
2025-10-09 12:12:41 +00:00
Sergi Blanch Torne
e2acf0934b ci,marge_queue: protect form transient errors
Use the parameter retry_transient_errors on the GitLab object creation to
protect the script from transient errors that can be well handled.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37395>
2025-10-09 12:12:41 +00:00
Sergi Blanch Torne
b0ea4d36ff ci,marge_queue: refactor the get queue method
Rebuild the information gathering about the marge queue and how the
information is later prompted to the user.

The queue provided to the user is sorted, so the user knows what will be
merged first (when the corresponding merge request pipeline succeeds).

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37395>
2025-10-09 12:12:40 +00:00
Sergi Blanch Torne
bf5626c82f ci,marge_queue: objects to represent the queue
Enhancement of the module with two structures that can encapsulate
functionalities and establish links between data collected.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37395>
2025-10-09 12:12:39 +00:00
Sergi Blanch Torne
02af2a199b ci,marge_queue: enhance script interruption
Instead of printing an exception on the screen when the process is interrupted
from the keyboard, handle it and print a more friendly message.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37395>
2025-10-09 12:12:39 +00:00
Sergi Blanch Torne
915648f994 ci,marge_queue: encapsulate monitor loop
Encapsulate the procedure in a method that can be imported from another tool
or even a python console.

Also include a typehint fix.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37395>
2025-10-09 12:12:39 +00:00
Karmjit Mahil
30fe9b47f5 ci,crnm: Fix f-string print error
```
f"{f"has new status: {job.status} " if new_status else f"{job.status}"} "
     ^^^
SyntaxError: f-string: expecting '}'
```

Fixes: 51c3f56aa (ci,crnm: migrate colorama to rich)
Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37770>
2025-10-08 18:35:59 +00:00
Sergi Blanch Torne
cf9b0c1fd3 ci: fix requirements file
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
With the migration concluded on !37510 of the lava-job-submitter (it is now an
independent project under the gfx-ci namespace), a lava requirements file was
not necessary anymore, but there was still one reference.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37713>
2025-10-06 09:18:49 +00:00
Valentine Burley
040201d46a ci: Remove lava-job-submitter, LAVA containers, and tests
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
lava-job-submitter has been moved to a new repository:
https://gitlab.freedesktop.org/gfx-ci/lava-job-submitter

Remove the LAVA-related code from Mesa, since we now use the containers
built in that repository. These containers already include
lava-job-submitter and run the relevant tests there.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37510>
2025-10-02 18:31:56 +00:00
Martin Roukala (né Peres)
9bb74929bc ci,crnm: remove unused imports
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37641>
2025-10-01 09:38:02 +00:00
Martin Roukala (né Peres)
c2a2d7215a ci,crnm: remove unsupported arguments by console.print
Fixes: 51c3f56aa (ci,crnm: migrate colorama to rich)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37641>
2025-10-01 09:38:02 +00:00
Sergi Blanch Torne
51c3f56aa3 ci,crnm: migrate colorama to rich
The links in the console are broken depending on the console type; for example,
when it runs within a GitLab job. This can be improved using rich. But as we
have a dependency on colorama too, we can migrate all the coloring to use this
other library too.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37454>
2025-09-23 09:57:37 +00:00
Valentine Burley
a9dbb5bd81 ci/lava: Update fire for compatibility with Debian 13
Bump `fire` from 0.5.0 to 0.7.0. The newer version removes the dependency
on the deprecated `pipes` module, which was removed in Python 3.13.

This fixes the LAVA tests in the `yaml-toml-shell-py-test` job when
running on Debian 13.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35853>
2025-09-16 06:16:21 +00:00
Eric Engestrom
8e2ff175c6 ci/update_traces_checksum: fix regex detecting PIGLIT_REPLAY_DEVICE_NAME in job logs
`declare -x` is one way to export a variable, but there is also `export`.
LAVA uses the former, while CI-tron uses the latter.

LAVA always adds quotes, while CI-tron uses python's `shlex.quote()` [1]
which only adds the quotes when necessary, so let's make those optional
in the regex as well.

[1] https://docs.python.org/3/library/shlex.html#shlex.quote

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37215>
2025-09-08 13:39:39 +00:00
Eric Engestrom
62428ae59b ci/update_traces_checksum: fix decoding of log lines
We don't need to evaluate escape sequences, we should instead read them
verbatim.

Fixes issues like:

    bin/ci/update_traces_checksum.py:45: DeprecationWarning: invalid escape sequence '\.'
    bin/ci/update_traces_checksum.py:45: DeprecationWarning: invalid escape sequence '\ '
    bin/ci/update_traces_checksum.py:45: DeprecationWarning: invalid escape sequence '\;'
    bin/ci/update_traces_checksum.py:45: DeprecationWarning: invalid escape sequence '\_'

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37215>
2025-09-08 13:39:39 +00:00
Eric Engestrom
263d260494 ci_run_n_monitor: add --job-tags filter
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This allows limiting to eg. `--target '(zink-)?radv-.*' --job-tags
'farm:(mupuf|keywords)'` to only run radv jobs on DUTs in these two
farms.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37100>
2025-09-04 09:19:32 +00:00
Eric Engestrom
d2c3c92f5e ci/gitlab_gql: keep track of job tags
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37100>
2025-09-04 09:19:32 +00:00
Eric Engestrom
f74df30d6a bin/ci: let filter_dag() caller define job filter once (instead of 3 times)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37100>
2025-09-04 09:19:31 +00:00
Eric Engestrom
159fcfdb2f ci: document what scope the ci_run_n_monitor token needs
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37083>
2025-08-29 16:18:30 +00:00
Valentine Burley
d1972be598 ci: Fix trace update script following environment variable changes
Since 655cf2f553 ("ci: Simplify filter_env_vars using indirect expansion"),
PIGLIT_REPLAY_DEVICE_NAME is declared using `declare -x`, not `export`.

Update the regex in update_traces_checksum.py accordingly. This is safe
for now, as all performance trace jobs currently run in LAVA and use this
declaration style.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36070>
2025-07-14 06:48:18 +00:00
Sergi Blanch-Torne
8911437038 ci: crnm: review argument metavar and type
Check the arguments to have a consistent definition of metavars to control the
string shown, and have them all lowercase. Also define the types expected on
those arguments.

Signed-off-by: Sergi Blanch-Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35828>
2025-07-02 15:13:55 +00:00
Sergi Blanch-Torne
c3f4b1a7db ci: crnm: rev argument for tags and branches
The --rev argument mentions that it accepts a git revision. I think it would
be practical to describe that it accepts a commit id, as well as a tag or
branch name.

Signed-off-by: Sergi Blanch-Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35828>
2025-07-02 15:13:55 +00:00
Sergi Blanch-Torne
e99236bad4 ci: crnm: extend it to work with other instances
ci-run_n_monitor tool can work with more projects than Mesa. It would be split
to its own repo with transparent access from the scripts in Mesa. But
meanwhile, this simple change allows using more GitLab instances than the
default gl.fd.o.

Signed-off-by: Sergi Blanch-Torne <sergi.blanch.torne@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35826>
2025-07-02 14:11:45 +00:00
Valentine Burley
54c967cb76 ci: Fix location of conditional build tags
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This allows the components to be found again after the move in
d5c63dd292 ("ci: split long containers build yaml").

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35851>
2025-07-01 10:41:14 +00:00
Eric Engestrom
14fedcfb8d ci_run_n_monitor: fix padding in links
8f557b84f6 was done because `text` is sometimes just an int,
but the fix was only applies to the padding calculation.

Unfortunately, the padding direction is also different between strings
and integers, which means the behaviour is now incoherent.

Let's convert `text` to a string before we start doing anything so that
everything afterwards is coherent.

Fixes: 8f557b84f6 ("ci: crnm: fix hyperlink format")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35587>
2025-06-18 08:42:19 +00:00
Sergi Blanch-Torne
8f557b84f6 ci: crnm: fix hyperlink format
While preparing a console link, if there is not padding defined and the text
is not strictly a string, we can have an exception that is also finishing the
execution. So, we need to strictly cast the text variable.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13342

Signed-off-by: Sergi Blanch-Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35511>
2025-06-17 09:02:40 +00:00
Sergi Blanch Torne
e19e8012e4 docs: crnm: document token usage
Judging by comments in the chat, it seems the usage of the tokens in crnm is
only natural when you've been using it for a while. New users would appreciate
reading it in the documentation, beyond the help in the tool.

Also, mentioning how to create a token and what's the minimal scope of the
token to be used with the tool can help new users.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34860>
2025-06-09 06:06:11 +00:00
Guilherme Gallo
e942d1e9e4 bin/ci: crnm: Sanitize n_colums value
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The number of columns should never be less than 1, otherwise we can
break the script such as:

```
Traceback (most recent call last):
  File "/var/home/guilherme/projects/mesa/bin/ci/ci_run_n_monitor.py", line 734, in <module>
    main()
  File "/var/home/guilherme/projects/mesa/bin/ci/ci_run_n_monitor.py", line 713, in main
    target_job_id, ret, exec_t = monitor_pipeline(
                                 ^^^^^^^^^^^^^^^^^
  File "/var/home/guilherme/projects/mesa/bin/ci/ci_run_n_monitor.py", line 221, in monitor_pipeline
    cancel_jobs(project, to_cancel)
  File "/var/home/guilherme/projects/mesa/bin/ci/ci_run_n_monitor.py", line 400, in cancel_jobs
    print_formatted_list(cancelled_jobs, indentation=8)
  File "/var/home/guilherme/projects/mesa/bin/ci/gitlab_gql.py", line 373, in print_formatted_list
    step = (len(elements) // n_columns) + 1
            ~~~~~~~~~~~~~~^^~~~~~~~~~~
ZeroDivisionError: integer division or modulo by zero
```

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35250>
2025-05-30 13:15:37 +00:00
Valentine Burley
080894325a ci: Remove debian/x86_64_pyutils container
Delete the debian/x86_64_pyutils container, since the LAVA jobs no longer
use it.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34980>
2025-05-26 17:25:40 +00:00
Valentine Burley
f6dce6dee1 ci: Add a minimal Alpine container for running LAVA jobs
Compared to the existing Debian-based x86_64_pyutils container, this
Alpine-based variant reduces the image size by approximately 83%.

Include all the necessary python artifacts, including lava_job_submitter
in the container to avoid having to download them at the start of each
test job.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34980>
2025-05-26 17:25:40 +00:00
Valentine Burley
f83e830dbc bin/ci: Split out LAVA-specific python requirements
Move LAVA-related Python packages into a separate requirements file to
simplify installing only the necessary dependencies.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34980>
2025-05-26 17:25:40 +00:00
Sergi Blanch Torne
fca369f57a bin/ci: crnm: adaptative field pads
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Some text paddings are not enough during the execution of the script. Having
an adaptative way for this variable can help the structure and visibility of
the output.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34856>
2025-05-16 20:34:16 +00:00
Sergi Blanch Torne
f65975975e bin/ci: crnm: columns list when waiting jobs update
It's another example of a long list of job names, when the jobs waiting for a
status update is printed. The print formatted list can help to present it.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34856>
2025-05-16 20:34:16 +00:00
Sergi Blanch Torne
e4396c40fa bin/ci: crnm: columns list for cancelled jobs
Rewrite how the jobs are cancelled within a pool of threads to simplify how
it can then use the print formatted list to for a better presentation of the
results.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34856>
2025-05-16 20:34:16 +00:00
Sergi Blanch Torne
e504d226ce bin/ci: crnm: format in columns when listing
When we are printing a long list, and it needs more than one line, it gets
hard to review the content. This is an idea to group the elements to be
printed in columns to make it easier to identify individual elements in
the output.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34856>
2025-05-16 20:34:16 +00:00
Eric Engestrom
4227982326 ci: rename misleading *-postmerge stages to *-nightly
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
These stages are for the jobs that are skipped in merge pipelines,
automatically run in nightly pipelines, and are available to run
manually in other pipelines.

None of these ever run in post-merge pipelines.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34590>
2025-04-29 05:49:00 +00:00
Sergi Blanch Torne
48bccb7d55 bin/ci: crnm: bug stress mode retry formula
The execution_times structure was filled the same way in all the cases of an
if. As a side effect, the retry evaluation doesn't include the last result and
can lead, as a race condition, into triggering one extra time than the
indication in the stress argument.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33750>
2025-04-23 07:42:37 +00:00
Sergi Blanch Torne
e6843c1705 bin/ci: crnm: bug while stressing a single job
When one launches a stress test on a single job, the script behaves like the
stress number is not set. After this wrong end, relaunch the command works
only if stress is bigger than 2. In case 2, it can confuse the number of
executions.

When in stress mode, don't exit the monitor_pipeline method as if there were
only one job run. One job run, prints in std the job trace, but in stress
mode, there are more than one job execution.

The stress_status_counter structure lost the information about job IDs, and
the bug happens when it counts twice the same job.

Reported-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33750>
2025-04-23 07:42:37 +00:00
Guilherme Gallo
ce200e6a4a bin/ci: crnm: Fix job duration calculation
The former version was problematic because:

- time.perf_counter() returns seconds relative to an arbitrary point in
  time (monotonic clock)
- time.mktime() converts to epoch time (seconds since 1970)

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33750>
2025-04-23 07:42:37 +00:00
Guilherme Gallo
b3a9125014 bin/ci: crnm: Improve timer display formatting
Modify the pretty_wait function to use a two-digit width for seconds
display, ensuring consistent and aligned output when showing the
countdown timer.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33750>
2025-04-23 07:42:37 +00:00
Guilherme Gallo
769c9bf27c bin/ci: crnm: Improve job enabling robustness
Add error handling for job retry/play actions with proper exception
handling and improve status tracking. Introduce a maximum retry
limit with MAX_ENABLE_JOB_ATTEMPTS to prevent infinite loops when
jobs cannot be enabled.

Change enable_job to return a boolean status rather than job objects
to avoid race conditions with stale job state. Update callers to
properly handle the new return value and wait for fresh job data
in the next monitoring loop.
Address race conditions in the CI monitor script:

Reported-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33750>
2025-04-23 07:42:37 +00:00
Guilherme Gallo
6464083a6b ci: Extract target job handling in CI monitor script
Extract the target job processing logic from the monitor_pipeline
function into a dedicated run_target_job helper. This improves
readability and maintainability by reducing the complexity of the
monitor_pipeline function.

Also add type casting to ensure proper typing for the job objects and
import the necessary Callable type.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33750>
2025-04-23 07:42:37 +00:00