GitLab 18.2.2 introduced a security restriction that only allows
uploading artifacts to the user's own namespace.
To work around this, hardcode the artifact location to the path where
the artifacts were uploaded to in
ce0d4f998d ("ci: Fix for GitLab 18.2.2 upgrade").
This is an ugly but temporary workaround until a proper solution is in
place.
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36836>
Now the `subject` from S3 id_token JWT refers to the target project when
we are in an MR pipeline, due to this patch [1].
So, let's use workflow variables to help us define where the S3 paths
should be pointing at.
[1] 7e9f329e8f
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Suggested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36832>
Allow users to call `_section_switch` and `_uncollapsed_section_switch`
without previous section commands.
This can happen because `*-runner.sh` script can be composed in several
ways.
For example if `android-cts-runner.sh` is called without first calling
`cuttlefish-runner.sh`, where a `section_start` is issued, the
`uncollapsed_section_switch` command in `android-cts-runner.sh` will
fail with an error like:
2025-07-02T08:42:33 /install/setup-test-env.sh: line 102: CURRENT_SECTION: unbound variable
Setting default empty values for `CURRENT_SECTION` makes it possible to
use the "section_switch" commands to also start a section for the first
time.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35907>
Avoid parsing variable values manually by using `${!varname@A}`, which
returns the exact declaration as stored in the bash session.
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35421>
Introduce find_s3_project_artifact (and curl-with-retry) helpers to
simplify locating S3 artifacts across upstream mesa/mesa and forks.
Use these helpers in the Fluster build process and for fetching LAVA
rootfs artifacts.
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35167>
Filter out the CI_COMMIT_DESCRIPTION, CI_COMMIT_MESSAGE, and
CI_MERGE_REQUEST_DESCRIPTION variables, which were causing issues in LAVA.
Fixes: cc83b3db5f ("ci: Forward all environment variables to DUTs and crosvm")
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35196>
Instead of the current allowlist in export-gitlab-job-env-for-dut.sh,
filter out unwanted environment variables and forward the rest to
bare-metal and LAVA DUTs, as well as crosvm.
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35051>
Ensure s3_upload correctly validates the S3 folder url by requiring it
to end with /. This prevents wrong uploads to invalid paths, such as
file urls. Also improve the error message.
Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34255>
The current `s3cp` implementation does not work anymore after the
migration, and instead of fixing it and propagating the fix down to us,
it's simpler to directly use `curl`.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34120>
This reverts commit 1cc2c738bb
We originally changed some aliases into functions so scripts could use
them without needing to be sourced, keeping the environment cleaner.
However, this broke `x_off`, which is supposed to stop debug logs
(xtrace output) from showing in the console. The function version still
triggered xtrace before disabling it, while the alias correctly
redirected the logs to `/dev/null`.
It also fixes the `bin/ci/update_tag.py` script to be able to reuse the
aliases via double sourcing the setup-test-env.sh and the respective
build script.
Reported-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33863>
Make structural tagging functions available for both test and build
scripts.
Introduces the update_tag.sh helper for listing, checking, and updating
deterministic tags.
Also adds the ci_tag_build_time_check and ci_tag_test_time_check
functions to validate tags during build and test phases, ensuring
consistent component versioning.
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33421>
Alias are not exportable, in the current situation of the build scripts,
we use alias to deal with sections, but it infers that all build scripts
will be included in a bigger one that has already included
`setup-test-env.sh`.
With the structured tagging, we do a dry run of all build scripts, to
early check if the tagging is valid, before building stuff.
So changing alias to functions will not have an effect on the current
setup, but it also removes the need to reinclude library bash scripts in
some situations, as described above.
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33421>
The RESULTS_DIR variable is defined by reference to the present
working directory, but if the pwd is the root directory then the
$RESULTS_DIR begins with two slashes instead of one like this: //results.
This is harmless but not necessary, so remove it.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32051>
If you're emitting a section header under set -x, you will see:
+ section_start foo "foo"
+ x_off
[the section header]
This is kind of annoying. Instead of trying to squash it everywhere by
dancing around local set +x management, play some extremely stupid
tricks with shells to make sure we never emit it.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31602>
During init-stage2 (used for hardware jobs) and setup-test-env (used
for running directly on shared runners), make sure we always create a
results directory.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31110>
Let CI handle that case as it did before. The only thing which needs to be done by the error() function is to get out of the section.
Fixes the issue where a job is not saving artifacts after failure.
Fixes: 4cc0cec473 ("ci: implement unified sections")
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21715>