Skip to content

ci: add a CI workflow with a gate - #230

Merged
uniqueg merged 6 commits into
devfrom
ci/add-ci
Nov 6, 2026
Merged

uniqueg merged 6 commits into
devfrom
ci/add-ci

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Replaces the old chart CI with ci.yml / CI, as in cloud-registry and foca, with the gate CI passed that the dev ruleset requires.

  • build.yaml is removed. It ran only on pull requests to master, and it also ran chart-releaser on pull requests, which published a chart from an unmerged branch. .travis.yml is removed too: it no longer runs.
  • ci.yml jobs:
    • title / PR title: shared action.
    • lint / Lint: pre-commit, with pre-commit-hooks, gitleaks and actionlint, as in cloud-registry. pre-commit and uv come from uv.lock.
    • chart / Chart: helm lint --strict and helm template.
    • chart-install / Chart install: installs on kind with the default values and checks GET /ga4gh/tes/v1/service-info through a port forward.
    • passed / CI passed: shared gate action.
  • The chart steps are composite actions (.github/actions/test-chart, install-chart), as in foca, so that the release workflow (ci: release charts from v* tags #222) can reuse them.
  • A minimal non-package pyproject.toml + uv.lock holds the tools (dependency group dev).
  • A separate whitespace-only commit applies the new fixers. It doesn't touch the copy of tesk-core in source/, which is excluded from the whitespace hooks.
  • charts/tesk/tls_secret_name.yml-TEMPLATE: filler PEM bodies replaced with short placeholders. gitleaks reported them as a private key; they were filler text, not a key.

Nothing is published from CI. Chart releases come with release.yml (#222). The Ingress isn't exercised any more: the old job used microk8s with the ingress addon, the new one uses kind and a port forward. Docs, metadata, tests and the release workflow follow in separate PRs (see #229).

Closes #221

Verification

  • helm lint charts/tesk --strict and helm template (Helm v3.22.1): pass.
  • pre-commit-hooks 6.0.0 fixers and checks run directly (pre-commit can't fetch hooks here): pass. A reviewer ran the full pre-commit run --all-files with cached hook environments, including gitleaks, actionlint and shellcheck: pass.
  • gitleaks dir on the tracked files: no leaks.
  • actionlint .github/workflows/ci.yml: pass.
  • uv lock --check: pass.
  • Not run locally: the kind install (no kind here).
  • CI on 5897c67: all jobs pass (PR title, Lint, Chart, Chart install, CI passed; CodeQL, Read the Docs). Chart install: the API answered service-info on kind.

Review

Full review: the change includes a reformat. Two rounds, with adversarial-reviewer and quality-reviewer. All high, medium and cheap low findings are fixed:

  • gitleaks finding (high)
  • port-forward restart and curl timeout
  • Markdown hard line break kept (--markdown-linebreak-ext=md)
  • uv pinned via the lock
  • stale comments fixed
  • exclude narrowed to the whitespace hooks

Declined review findings

None.

Open questions

None.

🤖 Generated with Claude Code

Summary by Sourcery

Replace the legacy validation workflows with a gated CI pipeline that lint-checks the repository, validates the Helm chart, and smoke-tests chart installation without publishing releases.

New Features:

  • Add a GitHub Actions CI workflow covering pull request titles, repository linting, Helm chart validation, and installation checks on kind.
  • Add reusable composite actions for Helm chart testing and deployment smoke tests.

Bug Fixes:

  • Stop running obsolete CI workflows and prevent chart publication from pull request validation.

Enhancements:

  • Introduce a required CI gate that aggregates validation results for the dev ruleset.
  • Standardize development and CI tooling with pinned pre-commit and uv dependencies.
  • Apply repository-wide whitespace and secret-scanning checks, including sanitized TLS template placeholders.

CI:

  • Replace the legacy chart CI and Travis configuration with the gated CI workflow.

Tests:

  • Validate the chart by installing it on kind and checking the TES service-info endpoint.

uniqueg and others added 5 commits November 6, 2026 05:30
Apply the fixers of the new pre-commit hooks (end-of-file-fixer,
trailing-whitespace) to all files outside the copy of tesk-core in
`source/`, so that the lint job of the new CI workflow passes. No
changes other than whitespace.

Refs #221

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Replace `build.yaml` (chart install on pull requests to `master`, with
chart-releaser on pull requests) and the unused `.travis.yml` with
`ci.yml` as in cloud-registry: PR title, lint (pre-commit hooks, with
pre-commit locked in `uv.lock`), chart lint and render, chart install
on kind with a service-info check, and the gate `CI passed`. The chart
steps are composite actions, for reuse by the release workflow.
Nothing is published from CI.

Closes #221

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The template held filler text in PEM blocks, which gitleaks reports as
a private key. Use short placeholders instead.

Refs #221

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Restart the port forward until the API answers, as the chart has no
readiness probe; keep Markdown hard line breaks in the whitespace hook;
pin uv through the lock, as in cloud-registry; limit the exclude of the
copy of tesk-core to the whitespace hooks; drop references to files that
do not exist yet.

Refs #221

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Time out each request after 10 s and show an unexpected response;
require uv 0.13 as cloud-registry does.

Refs #221

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

The PR replaces obsolete Travis and chart CI with a reproducible GitHub Actions workflow whose required CI passed gate covers title, lint/security, Helm validation, and a kind-based API smoke test; reusable pinned chart actions, locked Python tooling, pre-commit configuration, and formatting/secret-fixture updates support the new checks.

Flow diagram for the CI workflow and required gate

flowchart TD
    Trigger["Push to dev or pull request event"] --> Title["PR title"]
    Trigger --> Lint["Lint: pre-commit and gitleaks"]
    Trigger --> Chart["Chart: helm lint --strict and helm template"]
    Trigger --> Install["Chart install"]
    Install --> Kind["Create kind cluster"]
    Kind --> HelmInstall["helm install"]
    HelmInstall --> PortForward["kubectl port-forward"]
    PortForward --> ServiceInfo["curl GET /ga4gh/tes/v1/service-info"]
    Title --> Gate["CI passed"]
    Lint --> Gate
    Chart --> Gate
    ServiceInfo --> Gate
    Gate --> Required["Required dev ruleset check"]
Loading

File-Level Changes

Change Details Files
Replace legacy CI configuration with a branch- and pull-request-aware GitHub Actions workflow centered on a required CI passed gate.
  • Run PR title validation, locked pre-commit/security/actionlint checks, chart validation, and kind-based chart installation on dev pull requests and pushes.
  • Use concurrency controls and job conditions so title edits are validated while the gate remains reliably reportable.
  • Delegate gate evaluation to the shared action and allow only the expected title-job skip on pushes.
.github/workflows/ci.yml
.github/workflows/build.yaml
.travis.yml
Extract reusable Helm chart validation and installation logic into pinned composite actions.
  • Pin Helm and kind versions and run strict linting plus template rendering.
  • Install the chart on kind with default values, restart port forwarding as needed, poll the TES service-info endpoint with timeouts, validate the JSON response, and emit diagnostics on failure.
.github/actions/test-chart/action.yml
.github/actions/install-chart/action.yml
Establish reproducible repository tooling and pre-commit enforcement for CI and local checks.
  • Add a minimal non-package Python project with locked pre-commit and uv dev dependencies.
  • Configure pinned pre-commit-hooks, gitleaks, and actionlint checks, preserving Markdown hard breaks and excluding the maintained source/tesk-core copy from whitespace fixers.
  • Add lock-file validation and CI installation of the locked tool environment.
pyproject.toml
uv.lock
.pre-commit-config.yaml
Apply whitespace and secret-scan-related fixture updates required by the new checks.
  • Normalize trailing whitespace and end-of-file formatting across documentation, examples, chart files, and metadata.
  • Replace filler PEM content in the TLS template with short non-secret placeholders and update related ignore/configuration files.
.gitignore
.readthedocs.yaml
README.md
charts/tesk/.helmignore
charts/tesk/README.md
charts/tesk/s3-config/credentials-TEMPLATE
charts/tesk/templates/common/tesk-deployment.yaml
charts/tesk/templates/storage/openstack.yaml
charts/tesk/tls_secret_name.yml-TEMPLATE
charts/tesk/values.yaml
documentation/conf.py
documentation/deployment.md
documentation/index.rst
documentation/integrated_wes_tes.md
documentation/local_ftp.md
documentation/requirements.txt
examples/localftp/taskWithIO.json
examples/taskCreate
examples/taskList

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@uniqueg
uniqueg marked this pull request as ready for review November 6, 2026 04:56

@sourcery-ai sourcery-ai Bot 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.

Hey - I've found 2 issues

Fixed security issues:

  • charts/tesk/tls_secret_name.yml-TEMPLATE (link)
Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/ci.yml" line_range="117" />
<code_context>
+
+  # The only required check: fails if any job failed or was cancelled, or
+  # was skipped where it must run (only `title` is skipped on pushes)
+  passed:
+    name: CI passed
+    runs-on: ubuntu-latest
</code_context>
<issue_to_address>
**Unvalidated changes can pass required checks**

When a PR author can edit the workflow and the `dev` ruleset requires only the status check named `CI passed`, the PR-provided workflow can replace the `passed` job with an unconditional job using the same `CI passed` name, so GitHub reports the required check as successful without running the title, lint, or chart checks.

Protect changes to the workflow with required review, or configure the ruleset to require this workflow rather than only a status-check name.
</issue_to_address>

### Comment 2
<location path=".github/actions/install-chart/action.yml" line_range="56" />
<code_context>
+          fi
+          if curl --fail --silent --show-error --max-time 10 --output "${body}" \
+              http://localhost:8080/ga4gh/tes/v1/service-info; then
+            if ! jq -e '.id and .type.group == "org.ga4gh"' "${body}"; then
+              echo "::error::Unexpected service info"
+              cat "${body}"
</code_context>
<issue_to_address>
**Empty service ID passes the check**

When the endpoint returns HTTP 200 with an empty-string `id` and `type.group` equal to `org.ga4gh`, the `Check service info` test uses jq truthiness for `.id`; jq treats an empty string as true, so a response with `"id": ""` and the expected group passes and the chart install is reported successful despite the invalid service ID.

Require `.id` to be a non-empty string in the jq assertion.
</issue_to_address>

Linked issues

#221 ci: add a CI workflow with a gate · 9 of 9 met

# Requirement Status Notes
1 Run CI on pull requests to dev and pushes to dev, without paths filters ✅ Met The workflow triggers on both event types for dev and defines no paths filters.
2 Use the shared PR title action ✅ Met The title job uses the shared pr-title action pinned to a release commit.
3 Run pre-commit lint with pre-commit-hooks, gitleaks and actionlint ✅ Met The lint job runs pre-commit checks and the manual gitleaks-all hook; pre-commit and uv are managed through the locked dev dependencies.
4 Lint and render the chart ✅ Met The test-chart action runs helm lint --strict and helm template.
5 Install the chart on a throwaway cluster and check that the service-info endpoint answers ✅ Met The install-chart action creates a kind cluster, installs with default values, and checks the endpoint through a port forward.
6 Add the CI passed gate using the shared gate action ✅ Met The passed job runs with if: always(), needs all check jobs, and invokes the shared gate action.
7 Pin the shared actions to release commits ✅ Met The shared PR-title and gate actions are pinned to commit SHAs.
8 CI passed reports on every pull request to dev and every push to dev ✅ Met The workflow has the required triggers, and the always-running gate accounts for skipped title checks on pushes.
9 Remove build.yaml and .travis.yml, and do not publish from pull requests ✅ Met Both old workflow files are deleted; the new CI workflow contains no publishing step.

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: .github/workflows/ci.yml:117, .github/actions/install-chart/action.yml:56


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread .github/workflows/ci.yml Resolved
@uniqueg
uniqueg merged commit 8199bcc into dev Nov 6, 2026
15 checks passed
@uniqueg
uniqueg deleted the ci/add-ci branch November 6, 2026 05:02
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: add a CI workflow with a gate

1 participant