Skip to content

ci: generate coverage badge with locked coverage-badge, drop tj-actions - #355

Merged
as535364 merged 1 commit into
mainfrom
ci/locked-coverage-badge
Jul 20, 2026
Merged

ci: generate coverage badge with locked coverage-badge, drop tj-actions#355
as535364 merged 1 commit into
mainfrom
ci/locked-coverage-badge

Conversation

@as535364

Copy link
Copy Markdown
Member

Closes #347

What

  • Remove tj-actions/coverage-badge-py@v2 from the Generate Coverage Badge workflow. The tj-actions org had a supply chain compromise in March 2025, and the action is only a thin wrapper around the coverage-badge pip package.
  • Add coverage-badge ^1.1.2 to poetry dev dependencies so the version is locked in poetry.lock. The badge step becomes poetry run coverage-badge -o report/coverage.svg.
  • Pin setuptools <82 in the dev group: coverage-badge imports pkg_resources at startup, which was removed in setuptools 82, and its own metadata puts no upper bound on setuptools.

Verification

  • No tj-actions reference remains in .github/ (grep clean).
  • Ran the workflow steps locally: pytest with coverage, then poetry run coverage-badge -o report/coverage.svg produces a valid SVG.
  • Full test suite passes: 509 passed, 9 skipped, 1 xfailed.
  • The rest of the workflow (report dir, gh-pages publish, README badge URL) is unchanged, so https://normal-oj.github.io/Back-End/coverage.svg keeps updating after merge.

tj-actions had a supply chain compromise in March 2025 and the
coverage-badge-py action is only a thin wrapper around the
coverage-badge pip package. Add coverage-badge to poetry dev
dependencies so it is locked in poetry.lock, and generate the badge
with poetry run instead of the action.

Pin setuptools <82 in the dev group because coverage-badge 1.1.2
imports pkg_resources, which was removed in setuptools 82.

Closes #347

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the CI coverage-badge generation pipeline by removing the dependency on tj-actions/coverage-badge-py@v2 (supply-chain risk) and generating the badge directly via a locked Poetry dev dependency.

Changes:

  • Replace the tj-actions/coverage-badge-py@v2 workflow step with poetry run coverage-badge -o report/coverage.svg.
  • Add coverage-badge to the Poetry dev dependency group so it is locked via poetry.lock.
  • Pin setuptools <82 in dev dependencies to keep pkg_resources available for coverage-badge.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
pyproject.toml Adds coverage-badge and pins setuptools <82 in dev dependencies to ensure deterministic, compatible badge generation.
poetry.lock Locks coverage-badge and setuptools versions for reproducible CI installs.
.github/workflows/generate-coverage-badge.yml Removes tj-actions usage and runs coverage-badge directly via Poetry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@as535364
as535364 added this pull request to the merge queue Jul 20, 2026
Merged via the queue into main with commit 1b16ca4 Jul 20, 2026
2 checks passed
@as535364
as535364 deleted the ci/locked-coverage-badge branch July 20, 2026 16:19
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.

ci:徽章產生改用鎖版 coverage-badge,移除 tj-actions

2 participants