Skip to content

feat(sessions-pipeline): rearm-sweeper pass-receipt env, backport onto prod infra_ref c2aef4a1 (HOLD) - #564

Open
khaliqgant wants to merge 3 commits into
backport/agentrelay-prod-c2aef4a1from
backport/agentrelay-prod-rearm-receipt-env
Open

khaliqgant wants to merge 3 commits into
backport/agentrelay-prod-c2aef4a1from
backport/agentrelay-prod-rearm-receipt-env

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

What

Backport onto c2aef4a1 (agentrelay-prod's infra_ref), into base branch backport/agentrelay-prod-c2aef4a1. Item (3) of the "Sweeper infra batch", #owner-decisions 251927619257282560 (Khaliq; route A confirmed by claude-cloud-cloud-b1).

charts/sessions-pipeline/templates/rearm-sweeper.yaml: the rearm-sweeper container gains the provenance env that relayhistory-pipeline src/session-ingest/rearm-sweeper-receipt.ts (799f3925, review PASS) reads:

Env Source
INGEST_REARM_CRONJOB_NAME literal $name (<release>-rearm-sweeper); the downward API has no owner refs
INGEST_REARM_IMAGE_DIGEST the $digest the CronJob already runs (ingestEdge.image.digest)
INGEST_REARM_JOB_NAME fieldRef metadata.labels['batch.kubernetes.io/job-name']
INGEST_REARM_JOB_UID fieldRef metadata.labels['batch.kubernetes.io/controller-uid'] (the workload identity)
INGEST_REARM_POD_NAME fieldRef metadata.name
INGEST_REARM_POD_UID fieldRef metadata.uid
INGEST_REARM_POD_NAMESPACE fieldRef metadata.namespace

All seven are optional in the receipt code (missing → field omitted), so this is harmless before that code is deployed. POD_NAME and POD_UID are beyond the five originally requested; the receipt code documents and reads them.

Why a backport, and no version bump

Prod pins infra_ref c2aef4a1. infra main is 37 commits ahead (sessions-pipeline 0.8.56 → 0.8.62, agent-relay 0.7.76 → 0.7.87), so moving prod to main would ship far more than this. This branch is c2aef4a1 + this one commit. Chart versions are deliberately not bumped: the branch is unreleased, and identical helm.sh/chart labels keep the prod plan to exactly this env change.

Follow-up: the same template change still needs a normal, versioned PR to main, so the next prod infra_ref move does not drop it. rearm-sweeper.yaml is unchanged on main since c2aef4a1, so it applies cleanly.

Rollout (held)

  1. Merge this into backport/agentrelay-prod-c2aef4a1.
  2. EO PR: environments/agentrelay-prod/deploy/ci.json infra_ref → the merged commit. Its push plan must show only CronJob/agent-relay-prod/agent-relay-rearm-sweeper env (+7), no Jobs.
  3. agentrelay-deploy mode=apply (pg_dump control snapshot first), then verify the next sweeper Job completes and carries the env.

🤖 Generated with Claude Code


Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Backports pass-receipt provenance env to the rearm-sweeper CronJob on prod's pinned infra_ref c2aef4a1, so its receipt records can identify the run. Registers the new env in the self-hosted requirements registry, re-renders the docs, and adds chart tests covering the env and its exact fieldRefs.

  • Seven new env: CronJob name, image digest, and downward-API job/pod names, UIDs, and namespace.
  • All are optional in the receipt code, so harmless until that code ships; no chart version bump keeps the prod plan limited to this change.
  • Tests still forbid Secret/ConfigMap credentials under Pod Identity, allowing only downward-API fieldRefs.

Rollout (held)

  • After merge, point environments/agentrelay-prod/deploy/ci.json infra_ref at the merged commit; the push plan must show only the rearm-sweeper CronJob env change.
  • The same template change still needs a normal, versioned PR to main so the next prod infra_ref move keeps it.

Written for commit bb41fe6. Summary will update on new commits.

View guided diff Turn on auto-fix

…ackport onto c2aef4a)

The rearm-sweeper CronJob container gains the provenance env that
relayhistory-pipeline src/session-ingest/rearm-sweeper-receipt.ts (799f3925)
reads: INGEST_REARM_CRONJOB_NAME (literal), INGEST_REARM_IMAGE_DIGEST, and
downward-API INGEST_REARM_JOB_NAME, _JOB_UID, _POD_NAME, _POD_UID and
_POD_NAMESPACE. Harmless until the receipt code is deployed. Backport for the
agentrelay-prod infra_ref; no chart version bump (unreleased branch; chart
labels stay identical so the prod plan shows only this env).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@khaliqgant khaliqgant added the merge-train:hold Do not merge without Khaliq's direct OK label Nov 27, 2026
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9914a39a-86ef-4f70-87f8-1dbfd7a53909

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 potential issue.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

Comment on lines +151 to +152
- { name: INGEST_REARM_CRONJOB_NAME, value: {{ $name | quote }} }
- { name: INGEST_REARM_IMAGE_DIGEST, value: {{ $digest | quote }} }

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.

🟡 Unchanged chart version fails CI

The new INGEST_REARM_CRONJOB_NAME and receipt fields change the rendered chart without a version bump. The chart version check rejects this backport against its base.

Learn more

The contribution guide requires a chart version bump for template changes. The Lint Charts workflow runs the version check on pull requests without filtering by base branch. The check sees the changed template and compares the chart version with the version on the PR base.

Example: Running bash scripts/ci/version-bump.sh c2aef4a1 at the PR head reports that sessions-pipeline changed but its version is still 0.8.56, then exits with status 1.

Recommended fix: Coordinate an approved backport exception if the deployment must preserve existing chart labels. Otherwise, bump to an unused chart version, align release metadata, and update the expected deployment plan.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

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.

@khaliqgant, linking your existing backport disposition to this open thread: #564 (comment) . Please mark the thread resolved if that disposition covers it. Keep the backport open on its existing base and hold.

@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · No blocking code issues remain; the stated rollout hold still applies.RetriggerView in GreptileConfidence Score: 5/5

[Low impact] No blocking code issues remain; the stated rollout hold still applies.

Summary

Adds seven environment variables so sweeper receipts can identify the image, CronJob, Job, and Pod.

  • Sweeper pass receipts can identify the CronJob, image, Job, and Pod that ran them.

Reviews (3) · Last reviewed commit: "test(sessions-pipeline): rearm-sweeper c..." · Reviewed by Greptile

…uirements registry

Add INGEST_REARM_CRONJOB_NAME, _IMAGE_DIGEST, _JOB_NAME, _JOB_UID, _POD_NAME,
_POD_UID and _POD_NAMESPACE to the rearm-sweeper entry and re-render
docs/self-hosted-requirements.md (registry.mjs render; check OK).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eipt env

test_sweeper_cronjob_shape expects INGEST_REARM_CRONJOB_NAME and
INGEST_REARM_IMAGE_DIGEST plus the five downward-API entries, and asserts their
exact fieldRefs. test_sweeper_pod_identity still forbids credentials from a
Secret or ConfigMap under Pod Identity, but allows downward-API fieldRefs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@khaliqgant

Copy link
Copy Markdown
Member Author

Review findings addressed:

  • Greptile P1 (chart tests break): fixed in bb41fe6f. test_sweeper_cronjob_shape now expects the 7 receipt env vars and asserts their exact fieldRefs. test_sweeper_pod_identity still forbids credentials from a Secret or ConfigMap under Pod Identity but allows downward-API fieldRefs. The "Local kind profile and trust contract tests" step passes.
  • Devin (unchanged chart version fails CI): intentional, accepted by the deploy owner (infragrok, option (i)). This is an unreleased backport onto prod's infra_ref c2aef4a1. chart-releaser publishes only from main, and a bump here would change the helm.sh/chart label on every sessions-pipeline/agent-relay resource in the prod plan. The versioned change is feat(sessions-pipeline): rearm-sweeper pass-receipt provenance env (sessions-pipeline 0.8.63, agent-relay 0.7.88) (HOLD) #565 (sessions-pipeline 0.8.63, agent-relay 0.7.88). Per that decision this PR stays open and unmerged as the record; prod pins bb41fe6f directly (EO#165).

🤖 Generated with Claude Code

khaliqgant added a commit that referenced this pull request Nov 27, 2026
…essions-pipeline 0.8.63, agent-relay 0.7.88) (HOLD) (#565)

* feat(sessions-pipeline): rearm-sweeper pass-receipt provenance env (sessions-pipeline 0.8.63, agent-relay 0.7.88)

The rearm-sweeper CronJob container gains the provenance env that
relayhistory-pipeline src/session-ingest/rearm-sweeper-receipt.ts (799f3925)
reads: INGEST_REARM_CRONJOB_NAME (literal), INGEST_REARM_IMAGE_DIGEST, and
downward-API INGEST_REARM_JOB_NAME, _JOB_UID, _POD_NAME, _POD_UID and
_POD_NAMESPACE. All optional; harmless before the receipt code is deployed.
Same change as the agentrelay-prod backport (#564), so main does not fall
behind prod. Registry entry, release matrix rows and docs updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(sessions-pipeline): rearm-sweeper chart tests cover the pass-receipt env

test_sweeper_cronjob_shape expects INGEST_REARM_CRONJOB_NAME and
INGEST_REARM_IMAGE_DIGEST plus the five downward-API entries, and asserts their
exact fieldRefs. test_sweeper_pod_identity still forbids credentials from a
Secret or ConfigMap under Pod Identity, but allows downward-API fieldRefs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-train:hold Do not merge without Khaliq's direct OK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant