Skip to content

feat(helm)!: Add env/volume injection hooks to the worker Deployment.#415

Open
20001020ycx wants to merge 1 commit into
y-scope:mainfrom
20001020ycx:feat/2026-07-24-worker-hooks
Open

feat(helm)!: Add env/volume injection hooks to the worker Deployment.#415
20001020ycx wants to merge 1 commit into
y-scope:mainfrom
20001020ycx:feat/2026-07-24-worker-hooks

Conversation

@20001020ycx

@20001020ycx 20001020ycx commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description

When this chart is consumed as a subchart, the worker container often needs consumer-specific runtime env vars, volumes, and volume mounts. This PR adds the wiring for such configuration to be passed to the worker Deployment through values at install time (the validation section below shows an example of what a user may supply):

  • spiderConfig.worker.extra_envs becomes a list of raw EnvVar objects.
    • The previous map form could only render literal name: value string pairs, which limits the semantic, structured fields like valueFrom.secretKeyRef cannot be expressed.
  • New spiderConfig.worker.extra_volume_mounts / extra_volumes hooks accept raw VolumeMount / Volume objects.

Note

This is a breaking change because spiderConfig.worker.extra_envs changes from a map (name: value) to a list of raw EnvVar objects, so values written against chart 0.1.3 would render an invalid Deployment after upgrading.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

1. The hooks render valueFrom env vars, extra mounts, and extra volumes

  1. Render the worker Deployment with all three hooks populated.

    cat > /tmp/hook-test-values.yaml <<'VALUES'
    spiderConfig:
      worker:
        extra_envs:
          - name: "CLP_DB_USER"
            valueFrom:
              secretKeyRef:
                name: "test-clp-database"
                key: "username"
        extra_volume_mounts:
          - name: "staged-archives"
            mountPath: "/var/data/staged-archives"
        extra_volumes:
          - name: "staged-archives"
            emptyDir: {}
    VALUES
    helm template test tools/deployment/spider-helm -f /tmp/hook-test-values.yaml --show-only templates/worker-deployment.yaml

    Expected: the container gets the env var with valueFrom.secretKeyRef and the /var/data/staged-archives mount, and the pod gets the emptyDir volume, each appended after the existing config entries.

2. Default values render an unchanged worker Deployment

  1. Render with default values and diff against the chart before this change.

    helm template test tools/deployment/spider-helm --show-only templates/worker-deployment.yaml

    Expected: byte-identical to the 0.1.3 render except the helm.sh/chart: spider-0.1.4 labels — no env: key, no empty list items.

Summary by CodeRabbit

  • New Features

    • Added configurable extra environment variables, volume mounts, and volumes for worker deployments.
    • Improved flexibility for customizing worker container and pod settings.
  • Bug Fixes

    • Corrected the expected configuration format for additional environment variables.
  • Chores

    • Updated the deployment chart version to 0.1.4.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@20001020ycx, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e2d7342e-9084-4619-abf9-4780ccb04b13

📥 Commits

Reviewing files that changed from the base of the PR and between 6b683d7 and 4613974.

📒 Files selected for processing (3)
  • tools/deployment/spider-helm/Chart.yaml
  • tools/deployment/spider-helm/templates/worker-deployment.yaml
  • tools/deployment/spider-helm/values.yaml

Walkthrough

The Helm chart now supports configurable worker environment variables, volume mounts, and volumes. The worker template conditionally renders these list-based settings, and the chart version is incremented from 0.1.3 to 0.1.4.

Changes

Worker Helm customization

Layer / File(s) Summary
Worker configuration rendering
tools/deployment/spider-helm/values.yaml, tools/deployment/spider-helm/templates/worker-deployment.yaml
Worker environment variables now use list values, while additional environment variables, volume mounts, and volumes are conditionally rendered in the Deployment template.
Chart release metadata
tools/deployment/spider-helm/Chart.yaml
The chart version is updated from 0.1.3 to 0.1.4.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: sitaowang1998

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding env and volume injection hooks to the worker Deployment.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@20001020ycx
20001020ycx force-pushed the feat/2026-07-24-worker-hooks branch from 6148856 to 6b683d7 Compare July 24, 2026 18:29
@20001020ycx
20001020ycx marked this pull request as ready for review July 24, 2026 18:55
@20001020ycx
20001020ycx requested review from a team and sitaowang1998 as code owners July 24, 2026 18:55

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tools/deployment/spider-helm/Chart.yaml`:
- Line 5: Update the chart version in Chart.yaml from 0.1.4 to 0.2.0 to reflect
the breaking spiderConfig.worker.extra_envs values contract change from a map to
a list.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0d64bba0-7a01-41c1-b64f-81419cd8aaa4

📥 Commits

Reviewing files that changed from the base of the PR and between 04de5d7 and 6b683d7.

📒 Files selected for processing (3)
  • tools/deployment/spider-helm/Chart.yaml
  • tools/deployment/spider-helm/templates/worker-deployment.yaml
  • tools/deployment/spider-helm/values.yaml

Comment thread tools/deployment/spider-helm/Chart.yaml
sitaowang1998
sitaowang1998 previously approved these changes Jul 24, 2026
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.

2 participants