Now that all code conforms with the new style, we can remove all
the tricky bits that compare errors from regular- and legacy
config or limit checks to changed lines from a git diff.
All that is left over the eslint CLI tool is the ability to output
results both as junit for gitlab and plain text for logs without
duplicating the linting, but that's well worth preserving.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
The eslint jobs report their results as artifacts in junit format,
so that gitlab can present them in its UI.
However many people miss that, and unsuccessfully check the logs
instead.
Account for that by also printing the results to stdout.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2829>
We currently only find a matching ref on the same remote in
a merge request pipeline, but not in branch pipelines.
It can occasionally be useful to run a pipeline without opening
a merge request, so try the same remote here as well instead of
just assuming origin.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2814>
This was necessary after mutter configured a non-root user
for the image, although as it turned out not sufficient.
The latest image no longer sets up a special user, so building
the toolbox image should work again as before.
This reverts commit ee384d85da.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2813>
Toolbox is a convenient option for development, but setting up
the image with all dependencies is annoying at best, in particular
later in the cycle when `dnf builddep` is likely insufficient.
To address that, produce toolbox images for main and stable branches
that are based on the regular CI image, and update them whenever
the image version is updated. This guarantees that all build- and
runtime dependencies are included.
Unsurprisingly, the script that produces the image draws heavily
from freedesktop's ci-templates. The most notable difference
(other than being neither distro-agnostic nor generic) is that
tag names are fixed (toolbox:main, toolbox:43 etc.) to make them
easier to consume.
Instead, whether an image needs rebuilding is based on a custom
label that records the base image that was used.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2713>
Provided we use the correct version of the SpiderMonkey shell, we
can perform checks using the same engine that is used by gjs.
However some engine features are opt-in, so the set of features enabled
by gjs and js102 may differ. The obvious option for avoiding this is
replacing js102 with gjs for tests.
For that reason the check-potfiles.js script has been ported to gjs
and a second (simpler) script to replace `js102 --compileonly` was
added. This work happened in a separate repository to make sharing
between different JS-based projects easier.
Update the CI image to pull in those scripts and include gjs.
This will also address the issue that `js102 --compileonly` does not
handle modules.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2193>
Both the subdir and prepare arguments are very specific to
building the extensions-tool subproject stand-alone. In order
to make the script more generic, turn those required arguments
into optional --subdir and --prepare ones.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2712>
We currently remove the directory at the end of the script, but
that code is only reached when all previous operations were
successful.
Address this by first using an absolute directory path in /tmp
instead of a "random" location based on the CWD, then set a trap
to remove it on exit.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2712>
The script has four mandatory arguments, and also accepts optional
build options that are passed on to meson. Checking for the number
of arguments *before* filtering out the optional ones means that
`./install-meson-project.sh -Done=1 -Dtwo=2 -Dthree=3 -Dfour=4`
is considered valid, even though not a single required argument
is passed.
Fix this by filtering out the arguments before doing the usage
check. As it is a nice touch to have usage information at the
top of the script, move the message into a usage() function at
the top.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2712>
For non-MR pipelines, we check for a matching branch or tag name
in mutter. As we use the same naming policy for stable branches
and branch at about the same time, this works generally fine for
branches.
However for tags, it is less unlikely that there is no matching
tag in mutter, in particularly late in a stable cycle when most
changes are translation updates (which are much rare in mutter
than gnome-shell).
Before falling back to main (which is doomed to fail in that case),
try to guess the correct stable branch based on the tag name.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2293>
As the previous commit shows, just checking source files isn't
enough. Extending the existing check to .ui files should make
sure that we catch that kind of breakage in the future before
it hits translators.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2173>
Regex are a crude tool for analyzing whether some code *calls* a
particular function. Spidermonkey has Reflect.parse() that returns
the AST of the passed in code, which allows for a much more precise
check for javascript.
The old script is still used for C code, where i18n-affecting changes
are much rarer.
Based heavily on Philip Chimento's mozjs migration script at
https://gitlab.gnome.org/ptomato/moz60tool.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1941>
This job does:
1. Download the coverity bundle and untar it in a cached location
2. Build GNOME Shell using clang and the coverity tool
3. Compress the coverity report
4. Upload for analysis
In a similar setup to that of Mutter.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1913>
Mutter added some additional rules, for instance to enforce proper
capitalization style in commit messages. That's a good idea, and
now that adding rules is easy, let's adapt them to gnome-shell.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1544>
$CI_COMMIT_REF_NAME can be a branch name or a tag, depending on the
pipeline, but our checkout script only deals with the former at the
moment.
Address this by rather than looking for a remote branch name, just
try to fetch the ref like we do for merge request pipelines.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1529>
We are currently not very good at communicating what's going in,
in particular for non-merge request pipelines where the output
is usually just "Using origin/master instead" (instead of what?).
Improve this by consistently communicate what we are looking for,
whether we found it, and what we end up doing.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1529>
This rebuilds the automaticaly whenever the image tag changes. Whenever
something in the image needs to change, alter the installation script
and change the tag to the current date.
This removes the -s (strict) argument from js68, as it doesn't exist in
js78.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1492>
Instead of making sure there is a reference to a bug or merge request,
make sure there isn't. The reason for this is that marge-bot will always
append a merge request URL in the end of the commit message.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1491>
This is unnecessary hard in shell when compared to a proper programming
language. It becomes even easier with a node-js script, as that gives us
access to the underlying ESLint module rather than just the CLI interface.
Besides that, node-js has the added benefit that we don't need to add
more dependencies to the CI image.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1497
The Extensions app code is now independent enough from the rest of the code
base to move it to its own subprojects, like we did for the extensions-tool.
This allows for stand-alone builds of the app, which we are about to use
for distributing it as flatpak.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1133
Sadly, xgettext's dealing with template strings is abysimal, so we
had to stop using them in files with translatable strings.
Make sure we don't accidentally sneak in template strings again(*)
and enforce that rule in a CI job.
(*) easy "mistake", considering how much nicer they are than
String.prototype.format()
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1016
Also known as "Piotr Drąg Bot".
We will soon make sure that files processed by xgettext don't use template
strings. To make that check as adequate as possible, ensure that no source
code files are missing from POTFILES.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1016
While the old merge request URLs still work, gitlab recently started
including an additional /- for merge requests.
Adjust the regex to account for that, so that simply copying the URL
from gitlab works again.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1048
For stable branches, we currently only check out the correct mutter
branch for merge requests. For the regular pipeline, our code to
determine the current shell branch fails because CI runs on a
temporary "pipeline/12345" branch that doesn't exist for mutter.
Switching to the correct gitlab environment variable fixes that.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/811