Skip to content

feat: topic in-page navigation via sefaria:bootstrap-url#3377

Open
yodem wants to merge 5 commits into
masterfrom
feat/topic-bootstrap-url-navigation
Open

feat: topic in-page navigation via sefaria:bootstrap-url#3377
yodem wants to merge 5 commits into
masterfrom
feat/topic-bootstrap-url-navigation

Conversation

@yodem

@yodem yodem commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Enables in-page navigation for topic links dispatched via sefaria:bootstrap-url from the AI chatbot.

The fix for the bootstrapUrl crash on non-ref URLs (topics, profiles, etc.) is already in master (bb7cf2775). This branch + cauldron is for testing chatbot topic navigation end-to-end.

Test

Load any Sefaria page with ?chatbot_version=149, ask about a topic, click a topic link — should navigate in-page.

⚠️ Cauldron test branch — do not merge unless there are additional changes.

🤖 Generated with Claude Code

yodem and others added 4 commits June 2, 2026 13:41
…L; retire slack-webhook secret [sc-44609]

SLACK_URL was injected twice: an explicit `env` from the dedicated
slack-webhook secret (sefaria.secrets.slackWebhook) and the SLACK_URL key
bundled in local-settings-secrets (via envFrom). In Kubernetes an explicit
`env` always wins over an envFrom key of the same name, so SLACK_URL overrides
set in an environment's / cauldron's local-settings-secrets were silently
ignored, leaving pods serving a stale webhook (invalid_token).

Make local-settings-secrets the single source of truth and retire the
dedicated slack-webhook secret entirely:

- Remove the redundant explicit SLACK_URL env from the pods that already mount
  local-settings-secrets (web, task, reindex-elasticsearch, mongo-backup,
  postgres-packup) so the envFrom value takes effect.
- Migrate the blue-green deploy notifier (analysistemplate/rollout-complete)
  off the slack-webhook secret: SLACK_URL now comes from local-settings-secrets
  and the target channel from a new SLACK_CHANNEL key there. Both are
  optional (the curl is also `|| /bin/true`) so the post-promotion
  notification never blocks a rollout.
- Delete the slack-webhook secret template, the sefaria.secrets.slackWebhook
  helper, and the secrets.slackWebhook values stanza.

Companion infra change (separate PR): add the SLACK_CHANNEL key to
local-settings-secrets (prod + dev) and remove the orphaned slack-webhook-*
secrets. SLACK_URL already exists in those secrets.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…localSettings ref [sc-44609]

Addresses Copilot review on PR #3369:

- postgres-packup: the pgdump-uploader container (which runs upload-dumps.sh →
  `curl ... ${SLACK_URL}` under `set -e`) has no envFrom, so dropping the explicit
  SLACK_URL env left it unset and would fail the backup job. Restore SLACK_URL from
  the configured local-settings secret.
- mongo-backup: upload-dumps.sh (mongo) does not use SLACK_URL at all — the previous
  env was dead. Keep it removed; correct the misleading comment.
- rollout-complete analysistemplate: reference {{ .Values.secrets.localSettings.ref }}
  (prod: local-settings-secrets-production, where SLACK_URL/SLACK_CHANNEL live) instead
  of the hardcoded local-settings-secrets-{{ deployEnv }} pattern.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nnel [sc-44609]

The deploy notifier uses a Slack incoming webhook (SLACK_URL), which is bound to
a channel at creation; the payload channel override is redundant (and ignored by
app-based webhooks). Remove the CHANNEL env and the channel field from the payload,
so no SLACK_CHANNEL key is needed in local-settings-secrets.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The explanatory comments read well in the PR diff but are noise in the
long-lived chart after merge. Remove them; keep two short present-tense
notes where the behavior is non-obvious (pg-backup uploader's explicit
SLACK_URL, and the deliberate absence of a channel override).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gitvelocity-reviewer

Copy link
Copy Markdown

📊 Code Quality Score: 14/100

36 × 0.4 = 14.4

Category Score Factors
🔭 Scope 9/20 8 files across Helm chart templates: cronjobs, rollouts, analysis templates, helpers, values.yaml; single subsystem (Helm chart) but broad file coverage
🏗️ Architecture 8/20 Consolidates secret management by removing dedicated slack-webhook secret abstraction; reduces secret sprawl; changes how SLACK_URL is sourced across multiple deployment components
⚙️ Implementation 5/20 Helm template changes: straightforward deletions and key remappings; no complex logic; some inconsistency introduced between mongo-backup and postgres-packup handling
⚠️ Risk 9/20 Infra change affecting deployment pipelines; potential silent breakage of Slack notifications in mongo-backup (SLACK_URL removed without replacement); no migration documentation; optional:true inconsistency between jobs
✅ Quality 3/15 No tests (appropriate for Helm charts); inconsistency introduced between mongo-backup and postgres-packup; no migration notes for existing deployers; comment added in postgres-packup is helpful
🔒 Perf / Security 2/5 Slight security improvement by reducing secret sprawl and consolidating into existing localSettings secret

Was this score accurate? 👍 Yes · 👎 No

Scored by GitVelocity · How are scores calculated?

Copilot AI 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.

Pull request overview

This PR updates the Sefaria Helm chart to remove the dedicated slackWebhook secret/template and to source SLACK_URL from the existing secrets.localSettings.ref secret (with some components no longer explicitly injecting SLACK_URL). Note: the PR title/description references chatbot topic in-page navigation, but the actual diff is entirely Helm/Slack-secret related.

Changes:

  • Remove secrets.slackWebhook values + the slack webhook Secret template/helper.
  • Stop explicitly injecting SLACK_URL into web/tasks and some cronjobs; rely on envFrom local settings where present.
  • Update rollout-complete and postgres backup cronjob to read SLACK_URL from secrets.localSettings.ref (rollout-complete uses optional: true).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
helm-chart/sefaria/values.yaml Removes secrets.slackWebhook values block; chart configuration surface changes.
helm-chart/sefaria/templates/secret/slack-webhook.yaml Deletes the Slack webhook Secret template.
helm-chart/sefaria/templates/rollout/web.yaml Removes explicit SLACK_URL env var from web rollout.
helm-chart/sefaria/templates/rollout/task.yaml Removes explicit SLACK_URL env var from tasks rollout.
helm-chart/sefaria/templates/cronjob/reindex-elasticsearch.yaml Removes explicit SLACK_URL env var from reindex cronjob.
helm-chart/sefaria/templates/cronjob/postgres-packup.yaml Switches SLACK_URL secretKeyRef to secrets.localSettings.ref / SLACK_URL.
helm-chart/sefaria/templates/cronjob/mongo-backup.yaml Removes explicit SLACK_URL env var from mongo backup uploader.
helm-chart/sefaria/templates/analysistemplate/rollout-complete.yaml Removes channel override from Slack payload; sources SLACK_URL from local settings secret (optional).
helm-chart/sefaria/templates/_helpers.tpl Removes sefaria.secrets.slackWebhook helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 392 to 396
ref:
# data:
# key:
# serviceAccount:
# This is used in mongobackup & reindex-elasticsearch cron jobs.
slackWebhook:
# If you're using a reference to an existing secret then the data: section
# should be commented out and vice-versa.
ref:
# data:
webpageCronjob:
Comment on lines 77 to +81
- name: SLACK_URL
valueFrom:
secretKeyRef:
name: {{ template "sefaria.secrets.slackWebhook" . }}
key: slack-webhook
name: {{ .Values.secrets.localSettings.ref }}
key: SLACK_URL
# should be commented out and vice-versa.
ref:
# data:
webpageCronjob:
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