Skip to content

ci: add prek/zizmor/codeql/allowlist workflows, dependabot, .asf.yaml#5

Merged
potiuk merged 2 commits into
mainfrom
add-ci-asf-yaml
Apr 29, 2026
Merged

ci: add prek/zizmor/codeql/allowlist workflows, dependabot, .asf.yaml#5
potiuk merged 2 commits into
mainfrom
add-ci-asf-yaml

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented Apr 28, 2026

Summary

Bootstraps the standard ASF / security CI surface for the framework repo. The framework had no CI of its own — .pre-commit-config.yaml defined hooks (ruff/format/mypy/pytest for the two Python projects) but nothing was actually invoking them on PRs.

Mirrors what airflow-s/airflow-s and apache/airflow run.

Files added

  • .github/workflows/pre-commit.yml — runs prek on every PR and push to main. Sets up Python and uv before invoking j178/prek-action; uv is required because the per-project hooks under tools/{vulnogram/generate-cve-json,gmail/oauth-draft}/ invoke uv run --directory ....
  • .github/workflows/zizmor.yml — GitHub Actions security analysis via zizmorcore/zizmor-action. Reads .zizmor.yml at the repo root.
  • .github/workflows/codeql.yml — weekly + per-PR CodeQL analysis for Python (the only hand-written language in this repo). Uses the security-and-quality query suite; no security-extended needed (the code is stdlib-only / single OAuth dep and does not process untrusted runtime input).
  • .github/workflows/asf-allowlist-check.yml — ASF infra's allowlist-check action, scoped to PRs that touch .github/. Catches actions that haven't been allow-listed by ASF Infra.
  • .github/dependabot.yml — weekly bumps with a 7-day cooldown for four ecosystems: github-actions (root), pre-commit (root), and uv with a directory entry per Python project (tools/vulnogram/generate-cve-json, tools/gmail/oauth-draft).
  • .zizmor.yml — empty rule overrides, so every finding surfaces initially. Add ignores here when accepting a known false positive.
  • .asf.yaml — repo metadata that ASF Infra picks up:
    • Description (replacing the current incorrect "Apache airflow") and homepage.
    • Labels (8 generic, room for ~12 more).
    • Feature flags: issues/projects/discussions on, wiki off.
    • Squash-only merge, no auto-merge, head branch deletion on merge.
    • Notification routing to airflow.apache.org lists (the framework lives under the Airflow PMC umbrella for now; revisit if/when the repo moves to apache/steward under a different PMC).
    • Deliberately no protected_branches: block — branch protection stays in the GitHub UI for now until the project's release/branching policy stabilises.

All actions are pinned to SHAs (matching the airflow-s convention); versions chosen are the latest as used by airflow-s/airflow-s / apache/airflow at the time of writing.

Test plan

  • prek passes on the new workflow files locally.
  • zizmor v1.24.1 audit of the four workflow files plus dependabot.yml: no findings.
  • The actual CI runs will fire on this PR and validate the workflows themselves end-to-end.
  • After merge, ASF Infra's asf.yaml processor will pick up the description / labels / notification config (allow ~minutes for the GitHub repo metadata to update).

🤖 Generated with Claude Code

Bootstraps the standard ASF/security CI surface for the framework
repo, mirroring what airflow-s and apache/airflow run. The framework
had no CI of its own — the .pre-commit-config.yaml hooks defined
hooks (ruff/format/mypy/pytest for the two Python projects) but
nothing was actually invoking them on PRs.

Files added:

- .github/workflows/pre-commit.yml — runs `prek` on every PR and
  push to main. Sets up Python and uv before invoking
  `j178/prek-action`; uv is required because the per-project hooks
  under tools/{vulnogram/generate-cve-json,gmail/oauth-draft}/
  invoke `uv run --directory ...`.
- .github/workflows/zizmor.yml — GitHub Actions security analysis
  via zizmorcore/zizmor-action. Reads .zizmor.yml at the repo root.
- .github/workflows/codeql.yml — weekly + per-PR CodeQL analysis
  for Python (the only hand-written language in this repo). Uses
  the `security-and-quality` query suite; no security-extended
  needed (the code is stdlib-only / single OAuth dep and does not
  process untrusted runtime input).
- .github/workflows/asf-allowlist-check.yml — ASF infra's
  allowlist-check action, scoped to PRs that touch .github/.
  Catches actions that haven't been allow-listed by ASF Infra.
- .github/dependabot.yml — weekly bumps with a 7-day cooldown for
  four ecosystems: github-actions (root), pre-commit (root), and
  uv with a directory entry per Python project
  (tools/vulnogram/generate-cve-json, tools/gmail/oauth-draft).
- .zizmor.yml — empty rule overrides, so every finding surfaces
  initially. Add ignores here when accepting a known false
  positive.
- .asf.yaml — repo metadata that ASF Infra picks up: description
  (replacing the current incorrect "Apache airflow"), homepage,
  labels, feature flags (issues/projects/discussions on, wiki off),
  squash-only merge, no auto-merge, head branch deletion on merge,
  and notification routing to airflow.apache.org lists (the
  framework lives under the Airflow PMC umbrella for now).

  Deliberately **no `protected_branches:` block** — branch
  protection stays in GitHub UI for now until the project's
  release/branching policy stabilises.

All actions are pinned to SHAs (matching the airflow-s convention);
versions chosen are the latest as used by airflow-s/airflow at the
time of writing.

Test plan:

- `prek` passes on the new workflow files (yaml-lint, doctoc skip,
  end-of-file-fixer all green).
- `zizmor` v1.24.1 audit of the four workflow files plus
  dependabot.yml: no findings.
- The actual CI runs will fire on the PR and validate the workflows
  themselves end-to-end.

Generated-by: Claude Code (Claude Opus 4.7)
@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

…own)

Replaces the `j178/prek-action` step in the pre-commit workflow with
a `uv sync --group dev` + `uv run prek` invocation, and adds a root
`pyproject.toml` so the framework's dependency-resolution settings
have a place to live.

Why the swap:

- `uv tool install` does not honor `[tool.uv]` settings from a
  pyproject.toml in cwd, so the `exclude-newer` cooldown below would
  not have applied to a `uv tool install prek` invocation.
- `uv sync --group dev` does — prek is now a declared dev
  dependency of the framework root, the resolution honors the
  `exclude-newer` cooldown, and the resolved version is locked in
  the root `uv.lock` for reproducibility across CI runs.

Root `pyproject.toml`:

- `[project]` block declares the framework root as a (non-package)
  uv-managed project. `[tool.uv] package = false` keeps uv from
  trying to build a wheel from the framework root.
- `[dependency-groups] dev = ["prek>=0.3.5"]` — lower bound mirrors
  `minimum_prek_version` in `.pre-commit-config.yaml`; upper bound
  is enforced implicitly by the cooldown below, so the resolved
  version is "the most recent prek that is at least 7 days old"
  (currently 0.3.10, released 2026-04-21).
- `[tool.uv] required-version = ">=0.11.8"` pins the minimum uv
  version (latest at time of writing).
- `[tool.uv] exclude-newer = "7 days"` — relative cooldown, applied
  uniformly across all uv resolutions (including the per-project
  resolutions for the two Python projects under `tools/`, which uv
  re-resolved as a side-effect of the root settings).
- `[tool.uv] exclude-newer-package = { uv = "1 day" }` — per-package
  override for `uv` itself, since the latest uv (0.11.8, released
  2026-04-27) is within the 7-day window. The TODO comment marks
  2026-05-05 as the date when this override becomes redundant and
  can be dropped.

Workflow change:

- Drop the `actions/setup-python` step. uv brings its own Python
  via `uv sync` and the per-project hooks already use `uv run
  --directory ...` for their Python needs.
- Drop the `j178/prek-action` step. Replaced with `uv sync
  --group dev` (resolves prek through the root pyproject.toml's
  cooldown settings) followed by `uv run prek run --all-files
  --show-diff-on-failure --color=always`.

Per-tool lockfile updates (`tools/gmail/oauth-draft/uv.lock`,
`tools/vulnogram/generate-cve-json/uv.lock`):

These re-resolved as a side-effect of the new root `[tool.uv]
exclude-newer` setting being inherited by the subprojects. The
version downgrades (e.g. cryptography 47.0.0 → 46.0.7, certifi
2026.4.22 → 2026.2.25) are within stable releases and all 122 tests
+ 8 lint/type-check hooks pass against the new resolution.

Generated-by: Claude Code (Claude Opus 4.7)
@potiuk potiuk merged commit 9093baa into main Apr 29, 2026
5 checks passed
@andreahlert andreahlert added the mode:platform Substrate / infra — not a mode (sandbox, CI, validators) label May 7, 2026
andreahlert added a commit to andreahlert/airflow-steward that referenced this pull request May 15, 2026
- Replace SPDX with full ASF v2 license header (jbonofre)
- Clarify binding audience: contributors, committers, PMC, unmodified adopters (jbonofre)
- Extend apache#5 with deterministic-first execution to save tokens (potiuk)
- Extend apache#6 with explicit human sign-off for outbound human communication (RussellSpitzer)
- Rework apache#9 around capability floor instead of "same code on all backends", add justified-and-minimized clause, add end-to-end single-machine config requirement (RussellSpitzer)
- Standardize on US English (analyze, artifact, behavior, catalog, license, specialized)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mode:platform Substrate / infra — not a mode (sandbox, CI, validators)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants