Commit Graph
140 Commits
Author SHA1 Message Date
Lars Wirzenius 6f29315b46 tests(ci-broker.md): add scenario for JSON config file
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-09-19 08:10:37 +03:00
Lars Wirzenius 80db71a440 feat: cibtool trigger --patch option
Either `--commit` or `--patch` is now mandatory, undoing the
simplification in recent commits.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-08-13 14:10:46 +03:00
Lars Wirzenius a13b5a9868 feat: cibtool event add defaults to HEAD commit of chosen ref
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-08-13 10:31:42 +03:00
Lars Wirzenius 562465ef93 feat: cibtool event add defaults to default branch
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-08-13 10:22:15 +03:00
Lars Wirzenius b84fffaf02 feat! make cibtool log read cib log output as well
Previously we only supported reading `cib` log output wrapped into
`journald` messages as JSON.

This is a breaking change because the command line syntax changes
slightly.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-08-13 09:40:40 +03:00
Lars Wirzenius 6736324dd7 test: drop 0.18.0 from upgrade tests, add 0.19.1
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-08-06 16:27:06 +03:00
Lars Wirzenius 5439018503 tests: add scenario to verify behavior when adapter fails
Verify behavior for both a successful and a failed CI run, but with an
adapter that returns non-zero.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-08-05 08:01:31 +03:00
Lars Wirzenius 1f85b1b9e0 test: test upgrade to v0.19.0
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-07-28 08:47:45 +03:00
Lars Wirzenius 073b652f7c fix: serialize only the adapter config, not the adapter spec
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-12 16:59:41 +03:00
Lars Wirzenius d1db5e96ac feat: allow configuring adapters in the cib configuration file
This makes it easier to specify several adapters, with varying
configurations, by not having to put the configuration for each
specification in a separate file.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-12 14:44:39 +03:00
Lars Wirzenius f32efd9166 test: add release 0.18.0 to upgrade tests
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-09 08:01:03 +03:00
Lars Wirzenius 7f8ddca5a3 test: make upgrade tests pass despite warnings
For a reason I do not entirely understand, the upgrade test started
failing when I removed `rust-toolchain` from the **current** git, even
though old releases still have it. The failures are due to warnings.
Work around this by removing the `#![deny(...)]` and `#[deny(...)]`
lines from the source of the old releases.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-03 09:23:20 +03:00
Lars Wirzenius 43f2de4605 test: drop release 0.12 from upgrade tests
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-03 08:49:12 +03:00
Lars Wirzenius b93695ff43 fix: parse "concurrent_adapters" in config correctly
Oops. Brown paper bag moment.

This undoes the type mangling to ensure the field value is never zero,
in favor of doing run time logic. That should be done with types some
day, but today I need to get running.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-19 16:51:51 +03:00
Lars Wirzenius af581de269 test(ci-broker.md): add previous release to upgrade tests
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-19 10:36:35 +03:00
Lars Wirzenius 8d7989cc6a Revert "fix: "cibtool run list" shows ids without loading run info"
This reverts commit 900a457157.
2025-04-17 17:04:46 +03:00
Lars Wirzenius 765e6b606c fix: "cibtool run remove" removed only by broker run id by default
We need to parse the run info in the database as JSON to get at the
adapter run info. This fails if the run info can't be parsed. That can
happen if the database has run info from a development version. Change
`cibtool run remove` so that it takes only broker run ids by default
so that we can delete using those even if the run info is broken.
Allow removing by adapter run id with the `--adapter` option.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-07 15:35:47 +03:00
Lars Wirzenius 900a457157 fix: "cibtool run list" shows ids without loading run info
If the run info can't be parsed as JSON, loading it will fail. Change
`cibtool run list` so that it only lists the run ids by default.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-07 15:34:57 +03:00
Lars Wirzenius 756d7ac81d fix: Subplot step to run git in sub directory
Subplot's Rust lib/runcmd library currently sets HOME to the directory
in which a command is run. If the step is "when I run, in foo, git",
then git is run with HOME set to point to the sub-directory foo under
the per-scenario data directory. I suspect this is a bug in Subplot,
but until that is confirmed and fixed by Subplot, and the fix included
in a release, we can avoid that by running "env -C foo git" instead.
This has the effect of changing the working directory to foo before
running git, without affecting any environment variables, which is
what we want.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-04 15:00:38 +03:00
Lars Wirzenius a7d02c18c4 feat: make Tag event filter take a regular expression
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-04 11:42:11 +03:00
Lars Wirzenius b783ef65d7 feat: events for created, updated, deleted Git tags
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-04 10:59:07 +03:00
Lars Wirzenius 7cab201b41 feat: version number now includes Git commit short id
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-31 15:04:06 +03:00
Lars Wirzenius 29c37f9095 test(ci-broker.md): add scenario to run cib without a report dir
We want to make sure this works.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 18:05:06 +02:00
Lars Wirzenius 0d1d3291cc fix: use new Git refs module, fix bugs found
This is a huge change, but it's mostly a few kinds of similar changes
in a lot of places. Unfortunately, they were not easy to tease apart
into small, easily reviewed commits.

Use the Git ref types created by the new refs module. Fix problems
this exposes.

The CiEvent enum variants for branch events now use the BranchName
type for branch names. In other words, they have a plain branch name.
The CiEvent::from_node_event constructor also always sets the branch
name to a plain branch name, instead of a name spaced ref for updated
or deleted branches. The ci_event.rs module's unit tests have been
fixed to use the correct kind of Git ref in each test. (It used to be
a mess.)

The CI event filter "Branch" now contains a BranchName, previously a
RefString. This should not break anything, as a RefString will always
work as a BranchName.

The DefaultBranch filter now works, because it compares plain branch
names, where it previously would compare a plain and a name spaced
branch name, and those are never equal.

"cibtool trigger" and "cibtool event add" now add branch events with a plain
branch instead of a name spaced ref.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-20 18:33:39 +02:00
Lars Wirzenius 43306e1513 feat: output trigger event to stdout, file
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-04 18:43:57 +02:00
Lars Wirzenius fe9ffca3d2 feat: cibool run remove
Also fix Db::remove_run, which has never actually worked, because the
run id column was named wrongly. Oops.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-04 17:43:05 +02:00
Lars Wirzenius e69262d186 feat: add metadata about CI run to RSS feed entries
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-19 17:26:39 +02:00
Lars Wirzenius 2778011d40 trigger
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-17 14:45:41 +02:00
Lars Wirzenius 5a9fdb2a79 test: drop old release from upgrade tests
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-05 14:48:18 +02:00
Lars Wirzenius 623e590c2c feat: HasFile event filter predicte
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-04 18:46:19 +02:00
Lars Wirzenius 2ef02467f8 feat: add predicate DefaultBranch
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-04 16:59:22 +02:00
Lars Wirzenius 14ad23cc83 feat: refuse configuration files with unknown fields
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-04 14:45:05 +02:00
Lars Wirzenius 9e84afecbf feat! change the "Not" event filter to take a list of filters
Change the logical negation operator `Not` to take a list of filters
as operands. The operator returns true, if and only if all of the
operands are false. The syntax is now consistent with logical `And`
and `Or`, which simplifies code, and is expected to simplify use.

In YAML syntax, `Not` now works like this:

~~~
!Not
  - !Allow
~~~

Previously, `!Not` only had one operand, so that above would have been
expressed as `!Not Allow`.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-30 15:36:57 +02:00
Lars Wirzenius d0c6a8c8c1 test(ci-broker.md): verify event filter Not
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 18:00:01 +02:00
Lars Wirzenius d97f1c6720 test(ci-broker.md): verify event filter Or
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 18:00:01 +02:00
Lars Wirzenius 42bded3825 test(ci-broker.md): verify event filter And
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 18:00:01 +02:00
Lars Wirzenius 28ee4580e0 test(ci-broker.md): verify event filter Deny
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:42:49 +02:00
Lars Wirzenius 568592aabc test(ci-broker.md): verify event filter Allow
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:42:49 +02:00
Lars Wirzenius e0a967af68 test(ci-broker.md): verify event filter BranchDeleted
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:42:49 +02:00
Lars Wirzenius 791b7cad6d test(ci-broker.md): verify event filter BranchUpdated
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:42:49 +02:00
Lars Wirzenius bb5cf1273a test(ci-broker.md): verify event filter BranchCreated
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:42:47 +02:00
Lars Wirzenius d1e9b5e159 test(ci-broker.md): verify event filter Branch
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:42:37 +02:00
Lars Wirzenius 59deeed8c1 test(ci-broker.md): verify event filter Node
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:41:37 +02:00
Lars Wirzenius 2ea38588ad test(ci-broker.md): verify event filter Repository
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:41:16 +02:00
Lars Wirzenius c4bae7b09b test(ci-broker.md): use cibtool trigger option defaults
"cibtool trigger" option "--ref" defaults to "main" and "--commit" to
"HEAD", and there's no need to say those explicitly.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:41:06 +02:00
Lars Wirzenius f65a5b83b3 tests: trim releases for upgrade testing
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 11:27:58 +02:00
Lars Wirzenius f736bdf8e6 tests(ci-broker.md): document what to upgrade test, use commits
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 10:23:33 +02:00
Lars Wirzenius ba9b4365f9 fix(ci-broker.md): drop bashism: set -o pipefail.
On a machine where /bin/sh it not Bash, the pipefail setting will
fail.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-27 18:01:24 +02:00
Fintan Halpenny 8cbc1fe313 refactor: change test shell commands
While setting up a Nix flake, a series of tests were failing due to shell
invocations. The falling were the changes required:

- Use `!#/bin/sh` instead of `!#/bin/bash`
- Use `$$` instead of `$BASHPID`
- Use `true` and `false` instead of `/bin/true` and `/bin/false`

It was also noted that the `git-remote-helper` is needed alongside the `rad`
binary for some of the acceptance tests to work.
2025-01-24 10:23:49 +00:00
Lars Wirzenius c239dfb0a9 fix(ci-broker.md): drop unused embedded file
Unused files make `subplot docgen` fail unless it's given the
`--merciful` option.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-22 09:46:51 +02:00