8000 ci: build-ch-jwt-verify.yml path filters omit the shared packages the sidecar compiles — published image goes stale · Issue #24 · Altinity/altinity-oauth-helper · GitHub
[go: up one dir, main page]

Skip to content

ci: build-ch-jwt-verify.yml path filters omit the shared packages the sidecar compiles — published image goes stale #24

Closed

Description

@BorisTyshkevich

Summary

.github/workflows/build-ch-jwt-verify.yml builds and pushes the ch-jwt-verify sidecar
image on push to main, path-filtered to cmd/ch-jwt-verify/**, go.mod, go.sum,
Dockerfile, and the workflow file itself (lines 10–15). Since #19 phase 1 (PR #20) the
sidecar has compiled two shared first-party packages that appear in none of those
filters, so a change confined to them publishes nothing and the newest sidecar-<sha> tag
silently predates main.

Verified against the tree at the time of writing — go list -deps ./cmd/ch-jwt-verify,
first-party members only:

github.com/altinity/altinity-oauth-helper/internal/identity
github.com/altinity/altinity-oauth-helper/internal/verification
github.com/altinity/altinity-oauth-helper/cmd/ch-jwt-verify

Both are security-relevant, not incidental: internal/verification holds verifier.go and
cache.go (the /verify response cache whose key binding CLAUDE.md calls a security
property, not a perf detail), and internal/identity/policy.go holds the verified-email /
allowed-domain / iss-aud policy. A fix to either one merges to main, triggers no
publish, and leaves every Helm value pinning a sidecar-<sha> tag on pre-fix bytes.

.github/workflows/build-ch-oauth-ldap.yml (line 65) already carries internal/**, so this
is an asymmetry between the two publication workflows rather than a repo-wide gap.

Latent, not yet active. The last commit touching a sidecar trigger path is 6fd9325
(2026-08-31); no commit after it touches internal/verification or internal/identity. That
bounds the urgency, not the validity — the next shared-code fix is the one that ships stale.

Proposal

1. Filter the packages the sidecar actually compiles.

paths:
  - "cmd/ch-jwt-verify/**"
  - "internal/identity/**"
  - "internal/verification/**"
  - "go.mod"
  - "go.sum"
  - "Dockerfile"
  - ".github/workflows/build-ch-jwt-verify.yml"

Deliberately not a blanket internal/** mirroring the LDAP workflow. The sidecar compiles
two of the packages under internal/; internal/** would republish a
behaviourally-identical sidecar image on every internal/ldap/profile commit — of which
issue #33 produced many — leaving a misleading trail of tags that suggest sidecar changes
that did not happen. Precise globs are only unsafe because they rot the moment someone adds
an import, which is what part 2 exists to prevent. (If reviewers prefer symmetry with
build-ch-oauth-ldap.yml over signal, internal/** is the acceptable alternative and makes
part 2 trivially satisfiable; state the choice explicitly either way.)

2. Add a closure-coverage contract test, for both workflows.

New test in internal/securitytest: for each (command, publication workflow) pair, every
first-party package in go list -deps ./cmd/<name> must be matched by at least one glob in
that workflow's on.push.paths. This is the coverage direction — it fails when an import is
added that no filter covers, which is the failure mode part 1's precise globs are exposed to.

Both halves already exist in the repo and should be reused rather than reinvented:
dependency_contract_test.go already drives go list -deps deterministically, and
pr_gate_contract_test.go already parses workflow YAML and asserts structure against literal
expectations. Cover ./cmd/ch-oauth-ldap / build-ch-oauth-ldap.yml in the same pass —
nothing guards that filter today either; it is correct by authorship, not by contract.

Non-goals

  • Reproducibility of the sidecar image. This issue makes the published image not stale;
    it does not make it reproducible. Unlike build-ch-oauth-ldap.yml, the sidecar workflow
    still cross-compiles into the checkout and builds with context: ., and Dockerfile's base
    is alpine:latest (floating). Worth a separate issue; the fix here must not be described as
    addressing it.
  • Turning either publication workflow into a verification gate. Required PR gate
    (.github/workflows/pr-gate.yml) remains the only merge gate; a green publish is not a
    substitute. The new contract test from part 2 runs inside that gate as part of
    go test -race ./....
  • Touching build-ch-jwt-verify.yml's tagging, guards, or build context. Scope is the
    paths: filter plus the new test.

Corrections to this issue's original body

Recorded rather than silently dropped, since the original text was cited in #19 phase 4's
"Out-of-scope follow-up" and the <!-- ship-log --> comment on #19:

  1. The original claimed the sidecar imports internal/roles. It does not — only
    cmd/ch-oauth-ldap does (see the go list -deps output above). A precise-glob fix must
    not include it.
  2. The original hedged "and third_party/** if the sidecar ever depends on it". Moot —
    third_party/ was deleted at issue Implement ADR #32: replace general LDAP stack with ClickHouse compatibility profile #33 phase 4 along with the vendored
    goldap/ldapserver forks and their replace directives; the directory no longer exists.
  3. The original framed the risk as "a security fix landing only under internal/**". Worth
    stating precisely: the JWT/JWKS cryptography itself lives upstream in
    go-mcp-oauth-sdk and reaches the sidecar through go.mod, which is already
    filtered. The real exposure is the two first-party wrappers named above — narrower than
    the original implied, and still genuinely security-relevant.
  4. The original proposed the regression check land "in the daemon-free PR CI proposed in
    ci: add required PR-time Go/race/security gates; keep Docker ClickHouse matrix separate #23". ci: add required PR-time Go/race/security gates; keep Docker ClickHouse matrix separate #23 has since shipped; the check goes in internal/securitytest and is picked up by
    the existing go test -race ./... step, with no workflow change needed.

Activity

  1. changed the title [-]ci: build-ch-jwt-verify.yml path filters omit internal/** — sidecar image goes stale after shared-code fixes[/-] [+]ci: build-ch-jwt-verify.yml path filters omit the shared packages the sidecar compiles — published image goes stale[/+] on Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0