Commit graph

11 commits

Author SHA1 Message Date
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
Helen Koike
69012e355e ci/marge_queue: add pretty_dutation()
Add pretty_duration() function that prints time in format 6m23s and use
it for marge_queue.

Signed-of-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25822>
2023-10-24 12:57:14 +00:00
David Heidelberg
0b31cda678 ci: ci_marge_queue.py
Show currently assigned jobs to Marge and return 0 when it's free.

Useful for combination with ci_run_n_monitor.py .

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20347>
2023-10-14 11:28:56 +00:00