Skip to content

(PE-47151) Run the Mend scan on a daily schedule - #34

Open
cthorn42 wants to merge 2 commits into
mainfrom
PE-47151/main/mend-scan
Open

cthorn42 wants to merge 2 commits into
mainfrom
PE-47151/main/mend-scan

Conversation

@cthorn42

@cthorn42 cthorn42 commented Oct 16, 2026 •

Copy link
Copy Markdown

Summary

The Mend scan only ran on push to main, so it stops scanning whenever the repo is quiet. This runs it daily at 03:00 and on manual dispatch instead, with no push trigger.

  • Per-branch projects. Each branch in the branch: matrix scans into its own <repo>-<branch> Mend project. main is the only branch today; a release branch can be added later with one entry.
  • Hardened job, since it holds the Mend credentials:
    • read-only GITHUB_TOKEN permissions
    • actions pinned to commit SHAs
    • the unified agent pinned to release v26.8.2 and checked against its published sha256, instead of the floating S3 download
  • Leiningen only. Installs just Leiningen, which is all lein pom needs, instead of every Clojure tool at latest.
  • Runtime dependencies only. Generates the pom with lein with-profile -dev pom. Plain lein pom writes :dev dependencies as test scope, and Mend drops runtime dependencies that Maven resolves underneath them. That didn't happen in this repo, but in a sibling repo it left about 40 shipped libraries out of the report.
  • No silent empty scans. Fails the job if Mend logs Failed getting dependencies, instead of uploading a near-empty inventory.

Testing

Ran from this branch: https://github.com/puppetlabs/trapperkeeper-filesystem-watcher/actions/runs/38983036664

  • All steps passed; the agent checksum verified.
  • Mend resolved 51 dependencies into trapperkeeper-filesystem-watcher-main, the same count as before the with-profile -dev change, with no "omitted dependency" warnings.

Not exercised: the scheduled trigger itself, which only fires from the default branch.

🤖 Generated with Claude Code

@cthorn42
cthorn42 requested review from a team as code owners October 16, 2026 21:45
@cthorn42
cthorn42 force-pushed the PE-47151/main/mend-scan branch from 7d5345c to e3aa129 Compare October 16, 2026 23:44
The scan only ran on push to main, so it goes stale whenever the repo
is quiet. Run it daily and on manual dispatch instead.

Scan each branch listed in the matrix into its own <repo>-<branch>
project, so a release branch can be added later with one entry.

While here, harden the job, since it holds the Mend credentials:
- read-only GITHUB_TOKEN permissions
- actions pinned to commit SHAs
- the unified agent pinned to a release and checked against its
  published sha256, instead of the floating S3 download
- install only Leiningen, which is all `lein pom` needs

Generate the pom without the :dev profile. `lein pom` writes :dev
dependencies as test scope, and Mend drops runtime dependencies that
Maven resolves underneath them, which can leave shipped libraries out
of the report. Also fail the job if Mend reports that dependency
resolution failed, rather than uploading an empty inventory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cthorn42
cthorn42 force-pushed the PE-47151/main/mend-scan branch from e3aa129 to 3748c12 Compare October 16, 2026 23:48
Mend uploads even when its own Maven dependency resolution fails, and
with updateType OVERRIDE that replaces the project's inventory with an
empty one. The grep for "Failed getting dependencies" ran after the
upload, so it turned the job red but could not stop the overwrite.

Run `lein with-profile -dev deps` first, so a dependency that can't be
resolved fails the job before Mend runs. Keep the grep as a backstop
for failures only Mend's Maven run hits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants