Skip to content

fix(helm): use venv python for KB index job - #604

Merged
delete-cloud merged 1 commit into
mainfrom
fix/helm-kb-cronjob-entrypoint
Jun 15, 2026
Merged

delete-cloud merged 1 commit into
mainfrom
fix/helm-kb-cronjob-entrypoint

Conversation

@delete-cloud

@delete-cloud delete-cloud commented Jun 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • call the KB index CLI through the runtime venv Python in the Helm CronJob
  • tighten the Helm test so the CronJob does not render the unavailable bare kb index command

Evidence

  • live smoke showed Kubernetes Job PATH did not include /app/.venv/bin, so command -v coding-agent failed
  • /app/.venv/bin/python -m coding_agent kb --help works in the deployed image

Tests

  • uv run pytest tests/deploy/test_helm_chart.py -k kb_index_cronjob -v
  • uv run pytest tests/deploy/test_helm_chart.py -v

Summary by CodeRabbit

  • Refactor
    • Enhanced the scheduled knowledge base indexing process execution mechanism to improve consistency and reliability in the deployment workflow.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@delete-cloud, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 52 minutes and 59 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ce5c27a4-3cd7-474b-8d05-0d77957000b6

📥 Commits

Reviewing files that changed from the base of the PR and between 4ceee73 and c34e87e.

📒 Files selected for processing (2)
  • coding-agent/helm/templates/cronjob-kb-index.yaml
  • coding-agent/tests/deploy/test_helm_chart.py
📝 Walkthrough

Walkthrough

The kb-index CronJob Helm template replaces a direct kb index command with /app/.venv/bin/python -m coding_agent kb index, preserving all existing arguments. The corresponding Helm chart test is updated to assert the new explicit Python module invocation and to assert that the old bare kb index form is absent.

Changes

KB-Index CronJob Command Switch

Layer / File(s) Summary
CronJob command and test assertion update
coding-agent/helm/templates/cronjob-kb-index.yaml, coding-agent/tests/deploy/test_helm_chart.py
The CronJob container command is changed from kb index to /app/.venv/bin/python -m coding_agent kb index with the same templated arguments; the test now asserts the exact new command is present and the old bare kb index is absent.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

A rabbit hops into the shell, twitching its nose,
"Direct commands? How clumsy!" it primly says.
Now Python leads the way, module in tow,
/app/.venv/bin/python -m — off it goes!
The test agrees: no bare kb index shall stay. 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: switching the KB index job to use the virtual environment's Python interpreter instead of a bare command, which is the core fix described in the PR objectives.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/helm-kb-cronjob-entrypoint

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 and usage tips.

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

🧹 Nitpick comments (1)
coding-agent/tests/deploy/test_helm_chart.py (1)

681-681: ⚡ Quick win

Make the legacy-command absence check whitespace-tolerant.

"\nkb index" only blocks one exact form. An indented bare command could slip through; a regex check is more robust.

Suggested test hardening
+    import re
@@
-    assert "\nkb index" not in script
+    assert re.search(r"(^|\n)\s*kb index(\s|$)", script) is None
🤖 Prompt for 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.

In `@coding-agent/tests/deploy/test_helm_chart.py` at line 681, The assertion
checking for absence of "kb index" in the script variable only matches the exact
string pattern "\nkb index", which allows indented or differently-spaced
variations to slip through. Replace this simple string containment check with a
regex-based assertion that uses a pattern like `\s+kb\s+index` or similar
whitespace-tolerant pattern to ensure the legacy command is caught regardless of
indentation or spacing. Use a pattern that matches "kb index" with flexible
whitespace before and between the words to make the check robust.
🤖 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.

Nitpick comments:
In `@coding-agent/tests/deploy/test_helm_chart.py`:
- Line 681: The assertion checking for absence of "kb index" in the script
variable only matches the exact string pattern "\nkb index", which allows
indented or differently-spaced variations to slip through. Replace this simple
string containment check with a regex-based assertion that uses a pattern like
`\s+kb\s+index` or similar whitespace-tolerant pattern to ensure the legacy
command is caught regardless of indentation or spacing. Use a pattern that
matches "kb index" with flexible whitespace before and between the words to make
the check robust.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 320eaef8-4b46-49c2-97fc-ff9a8c8c9012

📥 Commits

Reviewing files that changed from the base of the PR and between bb27404 and 4ceee73.

📒 Files selected for processing (2)
  • coding-agent/helm/templates/cronjob-kb-index.yaml
  • coding-agent/tests/deploy/test_helm_chart.py

@delete-cloud
delete-cloud force-pushed the fix/helm-kb-cronjob-entrypoint branch from 4ceee73 to c34e87e Compare June 15, 2026 11:17
@delete-cloud
delete-cloud merged commit 6d73f29 into main Jun 15, 2026
2 checks passed
@delete-cloud
delete-cloud deleted the fix/helm-kb-cronjob-entrypoint branch June 15, 2026 21:20
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.

1 participant