Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions .github/workflows/bayn-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
case "${path}" in
services/bayn/* | \
packages/scripts/src/bayn/* | \
scripts/bayn-post-deploy-verify.ts | \
scripts/bayn-post-deploy-verify.test.ts | \
argocd/applications/bayn/* | \
argocd/applications/torghut/clickhouse/* | \
argocd/applicationsets/product.yaml | \
Expand Down Expand Up @@ -108,10 +110,34 @@ jobs:
bun-version: 1.3.14
node-version: 24.11.1
install-command: bun install --frozen-lockfile --ignore-scripts --filter @proompteng/source --filter @proompteng/bayn --filter @proompteng/scripts
lint-command: bunx oxfmt --check services/bayn argocd/applications/bayn argocd/applications/torghut/clickhouse/bayn-sealed-secret.yaml argocd/applications/torghut/clickhouse/clickhouse-cluster.yaml
oxlint-command: bun run --cwd services/bayn lint:oxlint
lint-command: >-
bunx oxfmt --check
services/bayn
scripts/bayn-post-deploy-verify.ts
scripts/bayn-post-deploy-verify.test.ts
argocd/applications/bayn
argocd/applications/torghut/clickhouse/bayn-sealed-secret.yaml
argocd/applications/torghut/clickhouse/clickhouse-cluster.yaml
oxlint-command: >-
bun run --cwd services/bayn lint:oxlint &&
bunx oxlint --config .oxlintrc.json
scripts/bayn-post-deploy-verify.ts
scripts/bayn-post-deploy-verify.test.ts
oxlint-type-command: bun run --cwd services/bayn lint:oxlint:type
test-command: bun run --cwd services/bayn tsc && bun run --cwd services/bayn lint:effect && bun run --cwd services/bayn test && bun test packages/scripts/src/bayn
test-command: >-
bun run --cwd services/bayn tsc &&
bun run --cwd services/bayn lint:effect &&
bun run --cwd services/bayn test &&
bun test packages/scripts/src/bayn scripts/bayn-post-deploy-verify.test.ts &&
bun node_modules/typescript/bin/tsc --ignoreConfig --noEmit
--module esnext
--moduleResolution bundler
--target esnext
--lib esnext,dom
--types bun-types
--skipLibCheck
scripts/bayn-post-deploy-verify.ts
scripts/bayn-post-deploy-verify.test.ts
build-command: bun run --cwd services/bayn build
secrets: inherit

Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/bayn-post-deploy-verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: bayn-post-deploy-verify

on:
push:
branches:
- main
paths:
- 'argocd/applications/bayn/deployment.yaml'
- 'argocd/applications/bayn/kustomization.yaml'

concurrency:
group: bayn-post-deploy-verify-main
cancel-in-progress: true

jobs:
verify:
runs-on: arc-amd64

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Grant the selected runner its required cluster reads

The arc-amd64 scale set runs as arc-amd64-gha-rs-no-permission, but the bindings inspected in argocd/applications/agents-ci/runner-rbac-cluster.yaml grant that identity reads for Argo applications and deployments only; they do not grant the pod list or services/proxy get permissions required by validateReadOnlyPermissions. Consequently every triggered deployment gate exits with RBAC_DENIED before taking a snapshot, so add the Bayn-scoped read bindings or select an appropriately authorized runner identity.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed as a real deployment blocker. The selected arc-amd64-gha-rs-no-permission identity has read-only Argo/Deployment access but lacks Bayn Pod reads and services/proxy; the existing arc-arm64-gha-rs-kube-mode identity can read Pods/proxy but also has Argo mutation authority, so it does not satisfy the required minimum read-only contract. No existing runner identity satisfies all requirements. Adding the missing Bayn-scoped Role/RoleBinding or changing runner permissions is explicitly outside this task’s ownership (do not touch manifests ... branch/environment permissions). The verifier therefore correctly remains fail-closed with RBAC_DENIED; I am not marking this thread resolved or merging a gate that cannot run.

timeout-minutes: 20
permissions:
contents: read
steps:
- name: Checkout exact promoted main revision
uses: actions/checkout@v5
with:
ref: ${{ github.sha }}
fetch-depth: 0

- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14

- name: Set up kubectl
uses: azure/setup-kubectl@v5
with:
version: v1.35.0

- name: Configure in-cluster kubeconfig
shell: bash
run: |
set -euo pipefail
if kubectl config current-context >/dev/null 2>&1; then
exit 0
fi
test -n "${KUBERNETES_SERVICE_HOST:-}"
test -n "${KUBERNETES_SERVICE_PORT:-}"
test -r /var/run/secrets/kubernetes.io/serviceaccount/token
test -r /var/run/secrets/kubernetes.io/serviceaccount/ca.crt

kubeconfig="${RUNNER_TEMP}/kubeconfig"
echo "KUBECONFIG=${kubeconfig}" >> "${GITHUB_ENV}"
kubectl config set-cluster in-cluster \
--server="https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}" \
--certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt \
--embed-certs=true \
--kubeconfig="${kubeconfig}"
kubectl config set-credentials gha-runner \
--token="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \
--kubeconfig="${kubeconfig}"
kubectl config set-context in-cluster \
--cluster=in-cluster \
--user=gha-runner \
--namespace=bayn \
--kubeconfig="${kubeconfig}"
kubectl config use-context in-cluster --kubeconfig="${kubeconfig}"

- name: Verify exact Bayn production promotion
shell: bash
env:
EXPECTED_ARGO_REVISION: ${{ github.sha }}
run: |
set -euo pipefail
bun scripts/bayn-post-deploy-verify.ts \
--expected-revision "${EXPECTED_ARGO_REVISION}" \
--deadline-seconds 900 \
--interval-seconds 10
Loading
Loading