Include CSS linting by default for our CSS/SCSS files, originally
introduced in cockpit. The stylelint configuration is copied from
760a4628282e02fbcef3.
- Generalize NODE_MODULES_TEST comment to apply for both direct
`npm install` and git checkouts.
- Drop obsolete touch commands from dist tarfile build.
- Consistently use NODE_MODULES_TEST constant.
- Better sorting of .PHONY, and add missing prepare-check.
This reduces the diff to cockpit-podman.
Use the html2po and manifest2po tools that we already check out from
cockpit repo pkg/lib.
These tools switched to a new argument parser library (`argparse`) in
cockpit-project/cockpit#16271, so add it to our package.json and drop
`stdio`.
Drop our old copies.
I checked the result of building `po/starter-kit.pot` before and after
the change, and aside from the timestamp, it's identical.
Cherry-picked from cockpit-podman commit bf53f801b17ba6.
Replace the two rules for test/common and pkg/lib with a single rule
based on `git-archive`, avoiding the use of racy `FETCH_HEAD` and
side-effecting `git-checkout`. This lets us drop the `flock` call, and
introduces some logic to avoid the fetch in case we already have it.
We'll hardcode shas from here on out: it's more secure (ie:
tamperproof), and more performant (since we don't have to check the ref
if we already have the object), in addition to being easier to work with
in terms of the required git commands.
Use pkg/lib/cockpit.js as a stamp file.
This rule will make it easier to expand to more files in the future.
One drawback is that when we want to update files from the cockpit/
repository, we'll now need to do it in lock-step: using new API from
testlib will force us to adjust to PatternFly changes, for example.
Cherry-picked from cockpit-podman commit cfc05e730d6f5d.
Keep pkg/lib in the same location as it is in the cockpit repository,
and adjust the include path accordingly.
This makes the production of the .pot file somewhat more deterministic:
previously, it would either include or not include the strings from
pkg/lib depending on if it had been checked out or not. Now it never
includes them.
Cherry-picked from cockpit-podman commit a70630be2139a.
RHEL 8 has node 10, which is too old for current
jest-worker/eslint/stylelint NPM modules.
The webpack rebuild during RPM build was introduced to satisfy Fedora
packaging policy, but it's not a requirement on RHEL 8. So just disable
it there.
The GKE container only has the default 64 MiB /dev/shm, which is not
enough for Chromium. It cannot be remounted from inside the container,
and chromium's `--disable-dev-shm-usage` option does not actually work,
so run the tests with Firefox instead.
All cockpit extensions should only require the bridge, at least as long
as they are independent from any other page (which is usually the case).
We still need cockpit-system for the tests (thus keep it in
test/browser/main.fmf), but it is perfectly reasonable to look at a
particular Cockpit page via the "remote hosts" panel, cockpit-desktop,
or Cockpit Client.
This gets rid of our "release" environment with high-profile secrets,
and the cockpituous/release infra.
The upstream release uses our shared
https://github.com/cockpit-project/action-release/ action.
This forces the package build to happen on a koji builder which actually
supports node. It's pointless at runtime (as the code runs in a browser,
not through node), but in practice, `nodejs_arches` encompasses all
supported Fedora/RHEL architectures anyway.
https://docs.fedoraproject.org/en-US/packaging-guidelines/Node.js/#_exclusivearch
According to the Fedora guidelines, nodejs-devel is needed for using
nodejs modules:
https://docs.fedoraproject.org/en-US/packaging-guidelines/Node.js/#_buildrequires
Since this applies only on Fedora, and that nodejs-devel may not even
exist on other distros (e.g. CentOS 9 Stream), then limit the
nodejs-devel requirement only to Fedora, keep using nodejs
unconditionally everywhere.
Disable the printing of the echo commands that write the filename of the
VM image for tests in the 'vm' and 'print-vm' targets.
This makes it possible to use their outputs, especially the 'print-vm'
target.
By default, webpack does not clean up dist/, so when you e.g. touch the
code and rebuild with `NODE_ENV=devel`, the old compressed assets from
a previous `production` build were left in place, and cockpit could
serve the old wrong ones. Enable the `clean` output option to fix this [1].
Also force the rewrite of all files with `compareBeforeEmit: false`, so
that the time stamps actually get updated on a webpack run. This fixes
`make` rules and unnecessary rebuilds when nothing changed.
Fixes#563
[1] https://webpack.js.org/configuration/output/#outputclean
run-tests recently got a new `--track-naughties` option [1] to explicitly
enable updating known issues on GitHub. Enable it for CI runs, and leave
it disabled for local runs and PackIt, as in these cases we don't want
to try and talk to GitHub.
[1] 7ef88e80ce
It's useless there -- any style error that may happen there has already
slipped through the upstream release, and at RPM build time there is
nothing that can be done about it. It just wastes time.
This allows us to bump eslint to a newer version which is incompatible
with the older node.js on RHEL/CentOS 8.
- use https when possible (mostly for cockpit-project.org URLs)
- fix the references to the cockpit and tmt official repositories
- update one packit.dev URL
Add a simple convenience target to "undo" what the devel-install did
(creating a symlink to ~/.local/share/cockpit), i.e. simply removing
that symlink.
Suggested by: Christopher Snyder