Skip to content

Chart Drift: mint a GitHub App installation token instead of a stored PAT (#1709) - #2309

Merged
rbuergi merged 1 commit into
mainfrom
fix/1709-app-token-cross-repo
Aug 26, 2026
Merged

rbuergi merged 1 commit into
mainfrom
fix/1709-app-token-cross-repo

Conversation

@rbuergi

@rbuergi rbuergi commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1709.

Chart Drift has failed every run since it was added — nine for nine. The preflight named secrets.MEMEX_DEPLOY_REPO_TOKEN as unprovisioned; it was in fact provisioned on 2026-08-17 (created_at == updated_at) and has returned HTTP 401 Bad credentials on every run since. It authenticates as nothing. Drift detection for memex, memex-cloud and client-i has never run once.

The header's premise was half right

A PAT cannot be minted through the API or CLI, so this step is necessarily manual.

True of a PAT. But the conclusion doesn't follow: a GitHub App installation token is mintable, and the org already has the meshweaver-cloud App (id 4220566) installed with access to all 32 repos — Systemorph/Memex among them. Verified by minting one and reading the repo: HTTP 200.

So the credential stops being a stored secret that rots:

before after
lifetime until someone notices it died one hour, minted per run
scope Contents: Read on Memex repositories: Memex + permission-contents: read — narrower
rotation manual, no owner Key Vault Systemorph/github-app-privatekey

secrets.MESHWEAVER_APP_ID / MESHWEAVER_APP_PRIVATE_KEY are provisioned.

The other two prerequisites were already done

The issue listed three things. Only the token was outstanding:

  1. Overlays committed — deployments/aks/{memex,memex-cloud,client-i}/values.<release>.public.yaml all exist in Systemorph/Memex, with the optional portal-patch.json beside them.
  2. AKS access granted — github-actions-deploy holds Azure Kubernetes Service Cluster Admin Role and Contributor Role on memexaks-cluster; Contributor covers Microsoft.ContainerService/managedClusters/*, i.e. runCommand/action.

What is deliberately unchanged

The validity probe stays, because its lesson is the durable one — PRESENT is not VALID, learned here the hard way when an empty-string check went green over a dead token. It still fails RED, no if:, no continue-on-error. Only the diagnostics change: 401/403/404 mean different things for an installation token than for a PAT, and each takes a different fix.

Expect the first completing run to be red

Legitimately, and that is the point — the header documents 121 divergences found in a local run against memex on 2026-08-17, including Authentication__Microsoft__ClientId still being CHANGE_ME_... in the chart. That backlog is the finding, not a defect in the gate.

What's New: skipped — CI credential plumbing, no user-visible effect.

… PAT (#1709)

Chart Drift has failed every run since it was added — nine for nine. The
preflight named `secrets.MEMEX_DEPLOY_REPO_TOKEN` as unprovisioned; it was in
fact provisioned on 2026-08-17 and has returned HTTP 401 "Bad credentials"
ever since. It authenticates as nothing. So drift detection for memex,
memex-cloud and atioz has never run at all.

The workflow header explained why the fix had to be manual: "A PAT cannot be
minted through the API or CLI." That is true of a PAT, but the conclusion does
not follow — a GitHub App INSTALLATION token is mintable, and the Systemorph
org already has the `meshweaver-cloud` App (id 4220566) installed with access
to all 32 repositories, Systemorph/Memex among them.

So the credential stops being a stored secret that rots:

  - preflight, discover and drift each mint a token with
    actions/create-github-app-token@v2, scoped `repositories: Memex` and
    `permission-contents: read` — narrower than the read-only PAT it replaces.
  - Rotation has ONE home: Key Vault `Systemorph/github-app-privatekey`.
  - secrets.MESHWEAVER_APP_ID / MESHWEAVER_APP_PRIVATE_KEY are provisioned.

The other two prerequisites in the header turn out to be satisfied already, so
this was the only one left:

  1. The overlays are committed — deployments/aks/{memex,memex-cloud,atioz}/
     values.<release>.public.yaml all exist in Systemorph/Memex, with the
     optional portal-patch.json beside them.
  3. The CI identity has AKS access — `github-actions-deploy` holds both
     "Azure Kubernetes Service Cluster Admin Role" and "... Contributor Role"
     on memexaks-cluster, and Contributor covers
     Microsoft.ContainerService/managedClusters/* — i.e. runCommand/action.

The validity probe is kept exactly as it was, because its lesson is the durable
one: PRESENT is not VALID, and this gate learned it the hard way. It still
fails RED with no `if:` and no continue-on-error; only the diagnostics change,
since 401/403/404 mean different things for an installation token than for a
PAT and each takes a different fix.

Category: none — CI credential plumbing, no user-visible effect.
Copilot AI lite review requested due to automatic review settings August 26, 2026 06:10

Copilot AI 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.

Pull request overview

This PR fixes the “Chart Drift” workflow’s authentication model by replacing a stored, long-lived deploy-repo PAT with a per-run GitHub App installation token, so the workflow can reliably read the private Systemorph/Memex overlays needed for drift detection.

Changes:

  • Replaces MEMEX_DEPLOY_REPO_TOKEN (PAT) with MESHWEAVER_APP_ID + MESHWEAVER_APP_PRIVATE_KEY and mints an installation token via actions/create-github-app-token@v2.
  • Updates preflight to validate the new secret inputs and probes deploy-repo readability using the minted token.
  • Updates deploy-repo checkouts in discover and drift jobs to use the minted token.
Suppressed comments (2)

.github/workflows/chart-drift.yml:236

  • actions/create-github-app-token@v2 does not accept a permission-contents input key; it uses a permissions object/map (or defaults to the App installation’s permissions). With the current key, the permission restriction may be ignored or the action may fail input validation.
          app-id: ${{ secrets.MESHWEAVER_APP_ID }}
          private-key: ${{ secrets.MESHWEAVER_APP_PRIVATE_KEY }}
          owner: Systemorph
          repositories: Memex
          permission-contents: read
      - name: Check out the deployment repo

.github/workflows/chart-drift.yml:318

  • actions/create-github-app-token@v2 does not accept a permission-contents input key; it uses a permissions object/map (or defaults to the App installation’s permissions). With the current key, the permission restriction may be ignored or the action may fail input validation.
          app-id: ${{ secrets.MESHWEAVER_APP_ID }}
          private-key: ${{ secrets.MESHWEAVER_APP_PRIVATE_KEY }}
          owner: Systemorph
          repositories: Memex
          permission-contents: read
      - name: Check out the per-env overlays

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/chart-drift.yml
Comment thread .github/workflows/chart-drift.yml
@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 3)

    9 files  ±0      9 suites  ±0   6m 20s ⏱️ +9s
1 827 tests ±0  1 823 ✅ ±0  4 💤 ±0  0 ❌ ±0 
2 369 runs  ±0  2 365 ✅ ±0  4 💤 ±0  0 ❌ ±0 

Results for commit 35953a4. ± Comparison against base commit b53aed0.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 0)

1 202 tests  ±0   1 202 ✅ ±0   17m 29s ⏱️ + 1m 7s
    9 suites ±0       0 💤 ±0 
    9 files   ±0       0 ❌ ±0 

Results for commit 35953a4. ± Comparison against base commit b53aed0.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 5)

   10 files  ±0     10 suites  ±0   7m 14s ⏱️ -13s
1 310 tests ±0  1 309 ✅ ±0  1 💤 ±0  0 ❌ ±0 
1 311 runs  ±0  1 310 ✅ ±0  1 💤 ±0  0 ❌ ±0 

Results for commit 35953a4. ± Comparison against base commit b53aed0.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 4)

2 122 tests  ±0   1 822 ✅ ±0   10m 32s ⏱️ - 1m 37s
    9 suites ±0     300 💤 ±0 
    9 files   ±0       0 ❌ ±0 

Results for commit 35953a4. ± Comparison against base commit b53aed0.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 2)

3 438 tests  ±0   3 438 ✅ ±0   9m 36s ⏱️ +4s
    8 suites ±0       0 💤 ±0 
    8 files   ±0       0 ❌ ±0 

Results for commit 35953a4. ± Comparison against base commit b53aed0.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 1)

1 815 tests  ±0   1 815 ✅ ±0   9m 32s ⏱️ +11s
   10 suites ±0       0 💤 ±0 
   10 files   ±0       0 ❌ ±0 

Results for commit 35953a4. ± Comparison against base commit b53aed0.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    55 files  ±0      55 suites  ±0   1h 0m 46s ⏱️ -19s
11 714 tests ±0  11 409 ✅ ±0  305 💤 ±0  0 ❌ ±0 
12 257 runs  ±0  11 952 ✅ ±0  305 💤 ±0  0 ❌ ±0 

Results for commit 35953a4. ± Comparison against base commit b53aed0.

@rbuergi
rbuergi merged commit 505b67d into main Aug 26, 2026
29 of 32 checks passed
@rbuergi
rbuergi deleted the fix/1709-app-token-cross-repo branch August 28, 2026 08:56
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.

Chart Drift has never run: MEMEX_DEPLOY_REPO_TOKEN authenticates as nothing (HTTP 401) — re-mint it

2 participants