Install a pull request
Your CI tests the code, but it never installs the product the way a user does: an installer change, a change of the server’s setup or an upgrade path is first exercised after the merge. With a label on a pull request, Fistron installs the pull request’s build on a clean machine, upgrades to it from the last release, runs the tests the change needs and answers on the pull request (ADR 0141).
Before you start
- A Fistron agent that may run kits (its configuration’s
[validation]with a participant, a trusted key for your workflow’s signature and a clean target) and that reads your repository with its token (Install and register an agent). - A clean target on that agent: a machine created for each run and
destroyed after (
provision), a host reset before each run (reset), or the CI runner itself (ephemeral) (validation.md). - How it installs: the setting
pr-installationin Repository settings or, until it is set there,.fistron/pr-installation.tomlin your repository; and the kit in.fistron/validation/(an example:examples/pr-installationin Fistron’s repository). - An API token of the project for your workflow
(Create an API token), as the secret
FISTRON_CONTROL_PLANE_TOKEN. - The write path allows the action
pr-installationfor the repository (any level): the comment on the pull request.
Set it up
- Set the setting
pr-installation(or write.fistron/pr-installation.toml): the labels (fistron-install,fistron-upgrade,fistron-migrateby default), the kit, the targets and, for the tests’ selection, the Fast Feedback Loop’s tier. - Write the kit:
installinstalls the pull request’s build,upgradeinstalls the last release and upgrades to it,testruns the tests (only those inFISTRON_SELECTED_TESTSwhen Fistron selected). Other builds, such as the pull request’s installer, are named{with.<name>.path}. - Add a workflow on the labels: it builds the pull request’s build and
signs it (cosign, keyless), then runs
fistron validation requestwith the pull request, its labels and the builds by digest. The job waits for the answer: it passes only when every path passed.
The settings and the kit are read from your repository’s base branch, not from the pull request: a pull request changes what is installed, never what the agent runs.
Through your team’s own pipeline
If your CI already installs the product (Jenkins, GitHub Actions or
GitLab CI), Fistron can use that pipeline instead of a kit (ADR 0158).
In the setting pr-installation, set executor = "pipeline" and
[pipeline]:
- the job and your mark that it is a test or staging pipeline: Fistron never starts a production one;
- who starts the run: Fistron (
start = "fistron", as the level ofci-run-startallows: a link for a person at propose, the run started at merge), or your CI itself (start = "ci"); - the pipeline’s parameters and where each value comes from: the build’s reference, image or digest, another build’s, the pull request’s number and head, or a constant. Nothing else of the pull request reaches your pipeline;
- which of its stages belong to
install,upgradeandtest(on GitHub and GitLab: its jobs or stages); - on GitHub, a workflow with
workflow_dispatchwhoserun-namenames the pull request’s number and head, for examplerun-name: "pr ${{ inputs.PR_NUMBER }} ${{ inputs.PR_HEAD }}": that is how Fistron finds the run it started.
The answer on the pull request is the same as with a kit: each path’s verdict with a link to its run, where it stopped, the step that failed and the RCA. A newer push replaces the older run: Fistron stops a run it started, and leaves your CI’s own runs.
An example of two repositories, each installed by its own pipeline:
examples/pr-installation-pipeline in Fistron’s repository. The
installer’s pull requests go through a Jenkins pipeline (its
Jenkinsfile), the server’s through a GitHub workflow
(.github/workflows/pr-install.yml); both run the same QE stages
(provision, install, upgrade, smoke tests, Cucumber), and each pins the
other repository’s build (with.server.reference,
with.installer.reference). Its .fistron/pr-installation.toml files are
what the form below keeps.
In the GUI
Open Quality and delivery > Install each pull request in your project and name the repository:
- How it installs: first Read the pipeline: name its CI and the
pipeline, and Read its parameters and stages asks the agent to read
it, starting nothing. It shows each parameter with the source Fistron
proposes for it, the proposed
NAME = sourcelines to copy into Its parameters, and the pipeline’s stages. Then the setting as a form: Who installs (your team’s pipeline or the kit), the labels, the pipeline’s CI and its name, This pipeline is a test or a staging pipeline (until you confirm it, Fistron starts nothing), who starts its run, Its parameters asNAME = sourcelines, the stages of each path and the time limits. Keep the installation of a pull request checks the setting as Fistron reads it before it is kept. - A trial run: a pull request’s number, head, labels and build;
Run it once installs it without a comment on the pull request. Tick
I start the pipeline’s run from here when
ci-run-startis at decide: a person’s start from Fistron is then enough. - The runs: each installation on Work, with its record.
The agent needs no [validation] for your team’s pipeline: it reads the
pipeline with its CI connector ([acquisition.jenkins], .github or
.gitlab) and starts and stops runs through the write path
([actions.jenkins], or the repository’s GitHub or GitLab group, with
ci-run-start and ci-run-stop).
Ask for an installation
- Open the pull request and add the label
fistron-install; addfistron-upgradefor the upgrade from the last release andfistron-migratefor a migration’s rehearsal. - The workflow starts. Each new push to the pull request while the label stays installs again; a newer push cancels the run of the older one.
- To stop, remove the label.
Read the answer
Fistron comments on the pull request, one comment updated in place:
| Part | Says |
|---|---|
| The table | each path (install, upgrade, migrate), its target and its verdict: passed, failed (a test failed), error (a step failed: the installer, the machine) or refused (the build’s signature, a target that is not clean); why |
| Build, With | the builds installed, by reference |
| Tests | how many tests the Fast Feedback Loop selected for the files the pull request changes, or why the kit ran its own set |
| Why a path failed | the cause from the failed run’s RCA, and the report among the project’s documents |
In the control plane, open the project’s Work and the work
pr-installation: its result and the documents (each path’s run record,
the RCA’s report, pr-installation.json).
Troubleshooting
| You see | Cause and fix |
|---|---|
| The job waits, then exits 2 | No agent took the work: an agent that may run kits and reaches the repository is needed; the work’s page says which it waits for. |
| refused: “neither provisioned for the run, reset before it nor ephemeral” | The target in .fistron/pr-installation.toml is not clean: use one with provision, reset or ephemeral. |
| refused: the build’s signature | The agent does not trust your workflow’s identity: its [validation.trust.pull-requests] names the workflow. |
| error: “machines of … are up (max_at_once …)” | Earlier runs’ machines still exist: wait, or raise max_at_once. A machine left over is reported with every run until it is destroyed. |
| “not published: the pull request’s head is now …” | A newer push came while it ran: its own run answers. |
| No comment, the job passed | The write path does not allow pr-installation for the repository. |
Next
- Upgrades customers take, across releases: Certify upgrades from earlier releases.
- The tests a change needs: Get your CI’s answer sooner.