Skip to content

Harden Actions workflows and pin patched pytest - #1321

Merged
zlareb1 merged 8 commits into
mainfrom
fix/code-scanning
Nov 24, 2026
Merged

zlareb1 merged 8 commits into
mainfrom
fix/code-scanning

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Closes: #1306
Closes: #1307
Closes: #1308
Closes: #1309

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Why

GitHub Actions use caches shared across runs and interpolate workflow expressions into shell source. Jobs with write credentials can also start from pull request or workflow completion events. The mutation-test requirements pin a pytest release affected by PYSEC-2026-1845.

Scope and risk

  • Disable the flagged package caches, pass shell inputs through environment variables, and keep translation Git credentials scoped to the steps that write.
  • Finalize after successful same-repository dispatches on the translation branch and on the existing six-hour schedule. Both jobs share one workflow group and start from main. Scheduled runs finalize before starting an update. The finalizer validates the generated diff and the exact commit that passed CI. Open pull requests receive their discovery label on a 30-minute schedule, and issue events and manual dispatch still reconcile individual items.
  • Look up releases and drafts with a single API call. Upload with the runner's GitHub CLI and publish in a separate edit so a failed response leaves the release and its notes available. The release workflow retains the previous final tag as the start of generated notes and checks that each asset group has a file before publishing.
  • Give the n8n jobs explicit names, document the n8n and CodeQL write permissions, and pin the release metadata checker's package by hash. Install pytest 9.0.3 in the mutation-test environment.
  • Thirteen low-severity scanner results remain for the SDK installation probes, the WSL shell, and local workflow and action syntax accepted by the pinned linter. The scanner also flags the translation completion trigger even with its narrower job condition.

Compatibility, rollout and rollback

  • Operator steps and wire changes are none.
  • Reverting restores the earlier workflow behavior and mutation-test dependency. There are no migrations or generated data to roll back.

Tests

  • The local zizmor 1.32.0 scan used --offline --strict-collection --no-config --no-ignores --persona=auditor --collect=workflows,dependabot. Findings fell from 80 to 14 on the current base.
  • Workflow lint and ShellCheck passed. The pinned plugin scanner scored 77 against a cutoff of 75. Focused tests cover label polling, translation finalization, release publication, signatures, installer rehearsal, and CodeQL workflow behavior. The mutation-test lockfile installed with hashes and its 22 identity smoke tests passed.
  • Local formatting, repository lint, and type checks passed. The full local unit run stopped after ClickHouse version and parser failures.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated with Codex. Checked the workflow behavior with the hosted scanner's settings and the focused tests above.

Checklist

  • Local format, lint, type checks and focused tests pass.
  • Commits are signed off.

@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Nov 24, 2026 3:38pm UTC

Request Review

Disable shared package caches and pass workflow values through the shell environment. Check translation and label state on scheduled runs. Use pytest 9.0.3 for the mutation tests to fix PYSEC-2026-1845.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Look up a release through the CLI so retries retain a draft and its notes. Abort on API errors so publication cannot mistake a failed lookup for a missing release.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Use one draft-aware lookup so an API failure cannot be mistaken for absence. Create a draft and publish it with a separate edit so a failed publish response leaves its assets available for the next run.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
The finalizer can advance main while a producer is translating a batch. Share one workflow group and load main when a queued update starts so finalization cannot leave that batch based on an obsolete event commit.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Frequent polling can displace pending manual runs, while finalizing only on the existing schedule can leave a batch behind main. Admit successful same-repository dispatches on the translation branch and finalize before the scheduled producer starts.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
The workflow trigger filters CI completions to the translation branch and the exact-head merge validation checks it again. A duplicate branch expression in the job condition is treated as a checkout reference by the plugin scanner.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
@zlareb1
zlareb1 merged commit ccb6396 into main Nov 24, 2026
91 checks passed
@zlareb1
zlareb1 deleted the fix/code-scanning branch November 24, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment