Browse the docs

Keep your CI and report each run to Putnami

Keep GitHub Actions, GitLab CI or another CI, and send each run to Putnami with putnami observe --upload. The change then shows in putnami.app.

The repository needs no putnami.workspace.json. Putnami reads what your CI already produces: the components the change touches, tests, coverage and dependency changes.

What happens in the cloud

  1. A CI job runs putnami observe. It reads the checkout and the test, coverage and dependency reports the job produced, and writes one evidence document.
  2. --upload sends the document to Putnami with your credential: an ingest token, or the job's own identity token on GitHub Actions.
  3. The first upload of an unknown repository creates its workspace in your organization, named after the repository. A repository id keys the workspace, so a rename or a transfer keeps it.
  4. Putnami stores the run, marked as reported by your CI, and opens the change page. The upload prints a report URL that only the members of that workspace can open.
  5. Optionally, Putnami posts a summary on the pull or merge request.

What changes with your own CI

Part With your own CI
Verdict Always checked, never verified: Putnami did not run the checks. Lost proofs and declaration changes still wait for a person.
Validation The same, once the repository holds a Putnami workspace with its specs declared.
Review Putnami starts it at Ready for review, apart from your CI. See Set up review.
Merge queue Not available. The queue reads runs that Putnami's CI ran. Your own merge rules apply.
Release Your CI publishes and deploys. The Release tab reads only the channels and environments that Putnami hosts.
Change page It shows only the tabs that have data, and always Checks.

Do it

Report a run with a token

  1. Sign in to putnami.app/observe and pick your CI. Each tab gives the whole step with a button that copies it.
  2. Create an ingest token on that page. It belongs to your organization, so one token serves every repository. It sends CI results only and reads nothing. The page shows it once. The CLI creates one too: putnami cloud token create --organization <id> --name ci.
  3. Store it in the CI as the secret PUTNAMI_CLOUD_TOKEN.
  4. Add the step after your tests. On GitHub Actions:
      - name: Observe the change with Putnami
        if: always()
        env:
          PUTNAMI_CLOUD_TOKEN: ${{ secrets.PUTNAMI_CLOUD_TOKEN }}
        run: |
          curl -fsSL https://putnami.dev/install.sh | bash
          export PATH="$HOME/.putnami/bin:$PATH"
          putnami extensions install --user @putnami/observe
          putnami extensions install --user @putnami/cloud
          putnami observe --upload

On GitLab CI, put the same commands under after_script of the job that runs the tests. Store the token as a masked CI/CD variable with Protected off, so merge request pipelines receive it. On another CI, run them after the tests in the same checkout, and pass --base <commit>.

putnami observe exits 0 whatever it finds. A failed upload is a diagnostic in the job log, so read the log when the first run does not arrive.

Report a run with no secret

This is in early access on GitHub Actions, and needs @putnami/cloud 0.5.0 or later.

  1. On putnami.app/observe, in the GitHub Actions tab, under "Without a secret", trust your GitHub organization or one repository. Putnami stores the numeric id GitHub reports and never matches the name.
  2. Give the job id-token: write, name your organization in the variable PUTNAMI_ORGANIZATION (its id, shown on the page, not a secret), and drop the secret:
    permissions:
      contents: read
      id-token: write
    steps:
      - name: Observe the change with Putnami
        if: always()
        env:
          PUTNAMI_ORGANIZATION: <your organization id>
        run: |
          curl -fsSL https://putnami.dev/install.sh | bash
          export PATH="$HOME/.putnami/bin:$PATH"
          putnami extensions install --user @putnami/observe
          putnami extensions install --user @putnami/cloud
          putnami observe --upload

The job's token is exchanged at auth.putnami.cloud for a token that lives 5 minutes, sends CI results only, and is bound to the repository the job names. Remove the trust on the same page to refuse every job at once. A job with PUTNAMI_CLOUD_TOKEN set uses it instead.

On gitlab.com, a job declares id_tokens: PUTNAMI_ID_TOKEN with aud: https://auth.putnami.cloud and sets PUTNAMI_ORGANIZATION. The organization must trust the project, which needs the project connected through your GitLab group. Self-managed GitLab uses the token.

From your laptop, putnami cloud login then putnami observe --open uploads under your own account, into your personal organization.

Post the result on the pull request

Two ways:

  • Turn on Post the summary of an observed run on its pull or merge request in the workspace settings, section Factory. Putnami posts the summary through its GitHub App as a neutral check Putnami observe, or through the GitLab connection as a commit status and a note. The job needs no code host token, and a fork's pull request gets it too.
  • Run putnami observe --upload --publish. It posts a commit status putnami/observe and one summary comment, updated in place, with GITHUB_TOKEN or PUTNAMI_GITLAB_TOKEN.

To post the review findings that your CI uploads, turn on Post the findings of an observed change on its pull request under Review.

Limits

An organization creates at most 5 workspaces this way. The next repository is refused with a message that names the limit. During the organization's first workspace trial, uploads create workspaces with no limit. The workspaces created then stay.

Move to hosted CI later

Open the workspace in putnami.app, connect the GitHub App in Providers, and enable hosted CI. The next pull request runs on Putnami in the same workspace, the earlier observed runs stay with their provenance, and the repository stops counting against the limit. Connecting the App from another workspace is refused with a message that names the workspace to use. See Run hosted CI.

What you see

  • putnami.app. The change page with the tabs that have data, and always Checks, marked as reported by your CI. The run page links your CI run: Run on GitHub Actions, Run on GitLab CI or Run on your CI.
  • GitHub. The Putnami observe check or the putnami/observe status.
  • CLI. putnami observe --details prints the changed files, reports and dependency changes.

The analysis runs in your CI job and uploads summaries. Your source files stay in the job, except the declaration files. See Security and data for what is sent.

When it fails

You see Cause Fix
The first run does not arrive A missing or wrong token. Read the job log. Check PUTNAMI_CLOUD_TOKEN.
Refused: the limit of 5 workspaces The organization holds 5 observed repositories. Follow the message, or move one to hosted CI.
The job says to add id-token: write The job lacks the permission. Add permissions: id-token: write.
The exchange names an untrusted repository The organization does not trust the job's repository or owner. Add the trust on putnami.app/observe.
A copied step keeps installing canary The step was copied while the page installed canary. Remove --version canary and @canary.

Next