Skip to content

ci: fix fork-PR staging deploy, drop dead mainnet overlay - #330

Merged
jorgecuesta merged 4 commits into
stagingfrom
chore/ci-hardening
Jul 30, 2026
Merged

ci: fix fork-PR staging deploy, drop dead mainnet overlay#330
jorgecuesta merged 4 commits into
stagingfrom
chore/ci-hardening

Conversation

@jorgecuesta

@jorgecuesta jorgecuesta commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Two independent cleanups that came out of merging #325/#329/#326.

Note: an earlier revision of this branch added a second Test step to the quality job on the false premise that CI never ran the tests. It already did — ci.yml runs pnpm turbo test right after Type check. That commit is reverted here; squash-and-merge collapses the pair away, and the net diff touches only the two files below.

1. A fork PR breaks the staging deploy

When #326 (external contributor) was merged, all four build-push jobs failed:

denied: installation not allowed to Write organization package

A pull_request event raised by a PR from a fork gets a read-only GITHUB_TOKEN and no secrets, regardless of the permissions: block. The token logs confirm it:

run event token
30577584525 (#326 merge) pull_request from fork Contents: read, Packages: read, Secret source: None
30578171631 (manual re-run) workflow_dispatch Contents: write, Packages: write, Secret source: Actions

The images were never published and post-deploy was skipped, so the release branch stayed out of sync with staging until the deploy was re-run manually.

pull_request_target runs in the base-repo context with a read/write token and keeps github.event.pull_request.labels, so the existing release label gate is unchanged.

The usual pull_request_target hazard — running untrusted PR-head code with a privileged token — does not apply here: both checkouts in the workflow pin ref: staging, never the PR head, and the job only runs once the PR is already merged. The reasoning is left as a comment in the YAML so it does not get "fixed" back.

2. Orphaned mainnet overlay

k8s/apps/middleman-workflows/overlays/mainnet/ was last written by the release automation in v0.11.2 (2026-05-18) and has been frozen at that image tag through six releases. deploy-production.yml no longer references it. Real deployments come from pnf-ops (middleman side) and the docker-compose/ example (operator side).

Its only remaining effect was to read as authoritative production config while declaring NODE_ENV=development and LOG_LEVEL=debug inherited from base — neither of which is true of any real environment.

Tilt is unaffected: every k8s/apps/*/Tiltfile builds ./overlays/dev. Verified all four dev overlays still kubectl kustomize clean after the deletion.

The quality job ran prettier, lint, build and check-types, but never
turbo test — so a green CI said nothing about the 23 test tasks in the
workspace. PR #326 was a behavioural fix backed entirely by tests that
CI never executed.

turbo test costs ~18s locally: its dependsOn is ^build (dependencies
only), so the apps' Next builds are not repeated.
A pull_request event raised by a PR from a fork gets a read-only
GITHUB_TOKEN and no secrets, whatever the permissions block says. When
PR #326 (external contributor) was merged, all four build-push jobs
failed with 'denied: installation not allowed to Write organization
package' and post-deploy was skipped, leaving the release branch out of
sync until the deploy was re-run manually via workflow_dispatch.

pull_request_target runs in the base-repo context with a read/write
token, and keeps github.event.pull_request.labels so the existing
'release' label gate is unchanged.

The usual pull_request_target hazard does not apply: both checkouts pin
ref: staging, never the PR head, and the job only runs post-merge.
Real deployments come from pnf-ops (middleman side) and the
docker-compose example (operator side). This overlay was last written by
the release automation in v0.11.2 (2026-05-18) and has been frozen at
that image tag through six releases; deploy-production.yml no longer
references it.

Its only remaining effect was to read as authoritative production config
while declaring NODE_ENV=development and LOG_LEVEL=debug, both inherited
from base — which is wrong, and misleading to anyone auditing prod.

Tilt is unaffected: every k8s/apps/*/Tiltfile builds ./overlays/dev.
@jorgecuesta
jorgecuesta requested a review from miguel502 July 30, 2026 20:36
@jorgecuesta jorgecuesta self-assigned this Jul 30, 2026
@jorgecuesta jorgecuesta added the enhancement New feature or request label Jul 30, 2026
Reverts e0111e9. The quality job already ran `pnpm turbo test` (ci.yml
lines 79-80, right after Type check); that commit added a second,
identical step. Its premise — that CI never ran the tests — came from a
truncated read of the workflow, not from the file.

Squash-and-merge collapses this pair away.
@jorgecuesta jorgecuesta changed the title ci: run tests, fix fork-PR staging deploy, drop dead mainnet overlay ci: fix fork-PR staging deploy, drop dead mainnet overlay Jul 30, 2026
@jorgecuesta jorgecuesta added the release Trigger staging deploy on merge to staging label Jul 30, 2026
@jorgecuesta
jorgecuesta merged commit 08112f5 into staging Jul 30, 2026
7 checks passed
@jorgecuesta
jorgecuesta deleted the chore/ci-hardening branch July 30, 2026 21:06
@github-actions github-actions Bot mentioned this pull request Jul 30, 2026
jorgecuesta pushed a commit that referenced this pull request Aug 13, 2026
### Reliability
- Transient RPC errors no longer wedge the transaction verifier. A node at a
  block's commit boundary answers blockResults with "could not find results for
  height #N"; that error escaped verifyTransaction's tri-state contract and the
  sweep then threw WorkflowError, which is a plain Error rather than a
  TemporalFailure and therefore fails the workflow task forever. Under
  ScheduleOverlapPolicy.SKIP that wedged the schedule: mainnet went three days
  without verifying a transaction on 2026-08-10. (#338)
- Corrupt schedules self-heal, with manual pause/resume/recreate from the UI. (#323)
- Provider Keys pending-state polling is gated on an actually-pending state.

Observability
- Structured logging foundation: LogTape replaces pino, full console migration,
  repo is console-free and guarded by scripts/no-console-guard.sh. (#322)
- Transaction tables show friendly on-chain failure reasons instead of raw codes. (#328)

### Supplier endpoints
- Endpoint override compatibility is preserved across legacy and numeric forms,
  supplier override readers are aligned, and the behaviour is pinned by
  regression tests.
- New CometBFT RPC type for service endpoints. (#328)

### UI
- Revamp: sticky headers, tabs, failure reasons, notification filters. (#325)

### CI
- Fork-PR staging deploys are fixed and the dead mainnet overlay is dropped. (#330)

### Database
- Two additive migrations run on deploy: 0017 (notification channels, events and
  preferences) and 0018 (watchdog heal state). New tables and enums only — no
  ALTER on existing tables, no data movement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request release Trigger staging deploy on merge to staging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant