Skip to content

ci: pin Actions and Poetry, and add an OSV check - #102

Open
gauron99 wants to merge 2 commits into
knative-extensions:mainfrom
gauron99:push-sstylxpktolx
Open

gauron99 wants to merge 2 commits into
knative-extensions:mainfrom
gauron99:push-sstylxpktolx

Conversation

@gauron99

@gauron99 gauron99 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Pins

  • Every action is pinned to a commit SHA, with its version in a comment.
    Dependabot updates both.
  • pypa/gh-action-pypi-publish moves from its release/v1 branch, which
    Dependabot cannot update, to v1.14.3.
  • The knative-*.yaml workflows stay at knative/actions@main, since knobots
    syncs them.
  • The workflows install Poetry 2.5.1 from .github/requirements.txt instead
    of the newest release. Dependabot now watches that file too.
  • publish.yaml builds with poetry build on Python 3.12 instead of
    python -m build. Poetry 2.5.1 requires poetry-core 2.5.0 exactly, so
    the build backend is pinned as well. The wheel and sdist for 0.8.1 are
    byte-identical to before.
  • ci.yaml also runs poetry build, so a Poetry update that breaks the
    build fails its pull request, not the release.

OSV check

The same check as knative-extensions/func-go#208. OSV-Scanner scans the
base branch and the pull request, and fails when the pull request adds an
advisory the base branch does not have. Advisories already on main do not
fail it. Python has no call analysis, so any new advisory fails it. Results
show as pull request annotations and job artifacts, not code scanning
alerts.

It runs with --no-resolve. .github/requirements.txt names only Poetry,
and without the flag the scanner guesses versions for Poetry's
dependencies. On this PR it guessed anyio 4.9.0, certifi 2026.7.22,
filelock 3.19.1, idna 3.9.0 and virtualenv 21.9.1 and failed on their 24
advisories, while CI's pip installed 4.16.0, 2026.11.20, 4.3.1, 3.20 and
21.15.13, all past the fixes.

Not from this PR: "Publish to TestPyPI" fails on every push to main
(400 File already exists, since the version stays 0.8.1). After this
merges, the "Build distribution" job of that run shows whether the new
build works.

🤖 Generated with Claude Code

@knative-prow
knative-prow Bot requested review from matejvasek and matzew November 24, 2026 20:59
@knative-prow

knative-prow Bot commented Nov 24, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gauron99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 24, 2026
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 24, 2026
@knative-prow knative-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 24, 2026
Pin every action to a commit SHA, with its version in a comment, and
let Dependabot update both. pypa/gh-action-pypi-publish moves from its
release/v1 branch to v1.14.3. The knative-*.yaml workflows stay at
knative/actions@main, since knobots syncs them.

Install Poetry 2.5.1 from .github/requirements.txt, which Dependabot
now watches, instead of the newest release. publish.yaml builds with
"poetry build" on Python 3.12 (same wheel and sdist as before), and
ci.yaml runs the same build, so a Poetry update that breaks it fails
the pull request.
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 24, 2026
@gauron99
gauron99 requested review from lkingland and a balanced review from Copilot and removed request for matejvasek and matzew November 24, 2026 21:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The CI and release workflow hardening changes have no active review issues.

No open issues 🎉

What changed in this PR

This PR hardens CI and release workflows by pinning tooling and adding a dependency advisory check.

Changes:

  • Pins Actions to commit SHAs and Poetry to a shared requirements file monitored by Dependabot.
  • Aligns release builds with poetry build and adds package building to CI.
  • Adds an OSV check that reports newly introduced advisories without uploading code-scanning alerts.
File Description
.github/​workflows/​publish.yaml Pins Actions and builds distributions with pinned Poetry on Python 3.12.
.github/​workflows/​osv-scanner.yaml Adds a pull-request check for newly introduced dependency advisories.
.github/​workflows/​ci.yaml Pins Actions, installs pinned Poetry, and adds package building.
.github/​requirements.txt Pins Poetry to version 2.5.1 for workflow use.
.github/​dependabot.yml Extends Python dependency updates to workflow tooling in .github.

Review effort: Balanced

OSV-Scanner scans the base branch and the pull request and fails when
the pull request adds a dependency version with an advisory on OSV.dev,
such as a known vulnerability or a malicious release. Advisories the
base branch already has do not fail it, so one found in an old
dependency does not block unrelated work.

It runs with --no-resolve: .github/requirements.txt names only Poetry,
and the scanner would otherwise guess older versions of Poetry's
dependencies than pip installs and fail on their advisories.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the CI, release-tooling, and dependency-scanning changes.

No open issues 🎉

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants