- 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.
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.
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
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
Add a simple convenience target that prints the filename of the test
image without creating it beforehand. This can be useful to know what is
the expected filename, so it is possible to provide an own test image
instead of the generated one.
When creating the tarballs for sources and node modules, apply some
hardening to the tar compression to remove some variances that may cause
the tarballs to not be reproducible; in particular:
- set fixed modes, and ownership
- set the mtime from the author's timestamp of the top-level commit
- sort the files by name
Cockpit's PF/React/build library (pkg/lib from cockpit.git) is checked
out as src/lib, so exclude it from the search of js/jsx, and html
sources for the extraction of i18n messages.
This avoids the cockpit messages in case the message extraction is
performed in a source tree after build.
Add a simple 'srpm' target that builds the src.rpm file for the current
project.
Partially reverts commit b2662eeebd (at
least to bring the 'srpm' target back).
Drop the image-customize `--verbose` option. mock is incredibly blabbery
about its internals otherwise, and seeing the build log isn't
particularly interesting.
When installing the module, instead of copying the metainfo file to the
destination, merge the available translations for it. Since this is done
at install time, add gettext as BuildRequires for the RPM packaging;
add libappstream-glib-devel as well only on RHEL/CentOS 8, since it
contains the metainfo.its for gettext in order to handle .metainfo.xml
files.
This requires a LINGUAS file with the list of translations currently
available: this is the way msgfmt picks the available languages to
merge. Generate it dynamically from the list of available .po files.
Recent versions of gettext know how to extract messages also from XML
files such as AppStream metadata. Hence, extract their messages, and
append them together with the global message catalog.
This ensures that we stay independent from any changes that go on in
online repositories, and our mock/pbuilders are sufficiently pre-cached.
Drop the explicit install of `cockpit-ws` -- all our bots images have it
pre-installed.
This centralizes/factorizes the rpm package builds, and builds
RPM packages in the VM instead of on the host, which is cleaner. It also
paves the way for supporting Debian and arch builds.
Drop the `make srpm` rule, as it's not very useful. Keep the `make rpm`
rule, as sometimes developers do this manually. This might be replaced
later on with another image-customize feature which copies the built rpm
out of the VM.
Use the CockpitRsyncWebpack plugin to optionally rsync build code to a
remote machine, the destination is determined by looking at the
package.json's name field.
The node_modules cache tarball will be published as release artifact, to
make sure that any release can be rebuilt in a reproducible way.
Cockpituous' release-source will call this if available:
https://github.com/cockpit-project/cockpituous/pull/438
Avoid the indirection, and directly call webpack. This avoids adding an
`npm` build dependency if/when the RPM wants to rebuild the webpack
during package build.
This is ugly as it races with other make targets which expect
node_modules/ to exist. It's also unnecessary, we can just tell tar to
ignore node_modules/.
Cockpit 247 changed cockpit-po-plugin.js to always expect a line number
in msgid references [1]. Also sync manifest2po from Cockpit 249 to
generate that reference for manifests, so that they keep getting
included into the translation js.
[1] 0ecc3a705d
731fdf82c0 fixed the
deprecation warning in cockpit-po-plugin:
> node:37175) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning:
> Compilation.assets will be frozen in future, all modifications are
> deprecated.
> BREAKING CHANGE: No more changes should happen to Compilation.assets
> after sealing the Compilation.
Bring back terser-webpack-plugin from commit c52136c051 and re-enable
it. It builds the autogenerated dist/index.js.LICENSE.txt which is quite
important for shipping distribution packages -- c-{podman,machines} both
do this.
Backport 95021c336e
to make sure that the webpack for the release tarball is *actually*
built in production mode.
Teach `make dist-gzip` to print the tarball name as last line, and use
it as `create-archive` action.
Add a `make print-version` command which packit can use. The builtin
default only works if there is at least one git tag, which is not the
case for starter-kit (which is never released).
Drop the cockpit-po-plugin.js and sassc-loader.js code copies, and check
them out from a stable cockpit tag, similarly to how we already get the
PatternFly CSS.