Skip to content

CI: run Harbor's task linter over every task - #75

Open
reacher-z wants to merge 1 commit into
mainfrom
ci/harbor-lint
Open

reacher-z wants to merge 1 commit into
mainfrom
ci/harbor-lint

Conversation

@reacher-z

Copy link
Copy Markdown
Collaborator

Refs #14

Harbor ships task lint rules this repository did not run: agent-image-test-leak (hidden tests copied into the agent image), verifier-runtime-install, verifier-network-download, shared-verifier and overlapping artifact paths, among others.

Changes

  • scripts/lint_tasks.py runs Harbor's default rules over every task and prints PASS/FAIL per task. It drops exactly two findings that Harbor 0.25.0 reports on every task:
    • invalid-task-config on docker-compose.yaml, because the files need Harbor's base Compose file to load;
    • unpinned-python-dependency on the hash-locked --require-hashes ... -r installs, where --link-mode copy is read as a package named copy.
  • A CI step "Lint tasks with Harbor" runs it on Python 3.12 (about a minute).
  • docs/development.md lists the command.

The Compose rules themselves still do not run; #14 describes how to make them.

Tests

tests/test_lint_tasks.py checks that the two findings are dropped and that other task-config errors, an unpinned package and other rules are kept. Adding RUN pip install requests to a verifier Dockerfile makes the script fail on that task. All 70 tasks pass.

  • uv run python -m unittest discover -s tests
  • uv run ruff check scripts src tests
  • uv run ruff format --check scripts src tests

Harbor ships a linter whose default rules this repository does not check
itself, among them agent-image-test-leak (hidden tests copied into the
agent image), verifier-runtime-install and verifier-network-download,
shared-verifier and overlapping artifact paths. scripts/lint_tasks.py
runs those rules over every task and fails on any finding except the two
that Harbor 0.25.0 reports on every task: a Compose file that cannot load
without Harbor's base file, and --link-mode copy read as a package named
copy. All 70 tasks pass in about a minute.
@reacher-z reacher-z added tasks Task definitions and payloads ci GitHub Actions and checks labels Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci GitHub Actions and checks tasks Task definitions and payloads

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant