Skip to content

Summarize a command's env vars in the PIN dialog and Slack (v0.1.27) - #193

Merged
ndbroadbent merged 4 commits into
mainfrom
nathan/command-env-summary
Oct 26, 2026
Merged

ndbroadbent merged 4 commits into
mainfrom
nathan/command-env-summary

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

An app's command_env_vars can hold every env var its commands need to boot. For a Rails app that's around a hundred names: the image's own, the non-secret settings, and the keys it can't boot without. The PIN dialog, --dry-run and the Slack notification listed every one of them. That buried the names the person approving a command needs to see: the ones it asked for and the read-only substitutes.

They now summarize the app's list:

Env vars: the 98 in the app's command_env_vars, plus SENTRY_DSN; read-only DATABASE_URL (from READ_ONLY_DATABASE_URL)
  • cmdenv.Plan has Added: the env vars the command gets besides the app's (--env, or its approved_deploy_commands entry). settings.CommandEnv.Plan fills it in, and Plan.Summary uses it. Describe still names every env var, and the mock rack's env: line uses it.
  • Audit entries record env_vars_added beside the full env_vars list. The web audit dialog shows them as "Asked for".
  • Plans that give every env var, or none, read as before.

Tests: TestSummary, plus env_vars_added and the summary text in the settings, proxy, Slack, CLI prompt, CLI dry-run and web audit dialog tests. The changed Go packages and the web test passed on the test box.

Summary by CodeRabbit

  • New Features
    • Audit log details now show additional environment variables requested by a command, when applicable.
    • Command environment summaries distinguish the app’s configured variables from newly requested and read-only variables. PIN prompts, dry-run output, and Slack notifications provide clearer summaries.
  • Documentation
    • Updated CLI and audit logging guidance to explain how environment-variable summaries and audit records are presented.

… record the ones it asked for

An app's command_env_vars can hold every env var its commands need to boot (around a hundred names for a Rails
app). The PIN dialog, --dry-run and the Slack notification listed every one of them, which buried the names that
matter: the ones the command asked for and the read-only substitutes. They now say "the 98 in the app's
command_env_vars, plus SENTRY_DSN; read-only DATABASE_URL (from READ_ONLY_DATABASE_URL)".

The plan knows which env vars were added for the command (--env, or its approved_deploy_commands entry), and the
audit entry records them as env_vars_added beside the full env_vars list.
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
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: Essentials
  • Run ID: 20bce9d5-7d69-4183-888e-4d63759bb9e0
Commits

Reviewing files that changed from the base of the PR and between cb4fb02 and b3218e7.

Files selected for processing: 17
  • convox.yml
  • docs/src/content/docs/concepts/audit-logging.mdx
  • docs/src/content/docs/user-guide/cli/commands.mdx
  • internal/cli/AGENTS.md
  • internal/cli/convox_process_env.go
  • internal/cli/convox_process_env_test.go
  • internal/cmdenv/cmdenv.go
  • internal/cmdenv/cmdenv_test.go
  • internal/gateway/audit/command_env.go
  • internal/gateway/proxy/command_env_test.go
  • internal/gateway/settings/command_env.go
  • internal/gateway/settings/command_env_test.go
  • internal/gateway/slack/process_notifications.go
  • internal/gateway/slack/process_notifications_test.go
  • web/package.json
  • web/src/components/audit-logs/command-details.test.tsx
  • web/src/components/audit-logs/command-details.tsx

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Walkthrough

The command environment plan now tracks requested variables outside the app-wide list and summarizes configured, added, and read-only variables. CLI and Slack messages use that summary. Command audit details record added names, and the web audit view displays them. Documentation and release version values also changed.

Changes

Command Environment Reporting

Layer / File(s) Summary
Track added variables and summarize plans
internal/cmdenv/cmdenv.go, internal/cmdenv/cmdenv_test.go, internal/gateway/settings/command_env.go, internal/gateway/settings/command_env_test.go
Environment plans record sorted requested variables beyond the app-wide list. Plan summaries report configured-variable counts, added names, and read-only variables.
Use plan summaries in CLI and Slack
internal/cli/convox_process_env.go, internal/cli/convox_process_env_test.go, internal/cli/AGENTS.md, internal/gateway/slack/process_notifications.go, internal/gateway/slack/process_notifications_test.go, docs/src/content/docs/user-guide/cli/commands.mdx
CLI prompts and dry-run output, plus Slack notifications, use the updated environment summary. Documentation describes the displayed counts and variable names.
Record and display added variables
internal/gateway/audit/command_env.go, internal/gateway/proxy/command_env_test.go, web/src/components/audit-logs/command-details.tsx, web/src/components/audit-logs/command-details.test.tsx, docs/src/content/docs/concepts/audit-logging.mdx
Command audit details include nonempty added-variable lists. The web audit view parses and displays those names, and documentation describes the audit field.

Release Version Updates

Layer / File(s) Summary
Update release version values
convox.yml, web/package.json
The gateway and admin image tags and the web package version are updated to v0.1.27 and 0.1.27, respectively.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant SettingsCommandEnv
  participant AuditCommandEnv
  participant parseCommandDetails
  participant CommandDetails
  SettingsCommandEnv->>AuditCommandEnv: Plan.Added
  AuditCommandEnv->>parseCommandDetails: env_vars_added
  parseCommandDetails->>CommandDetails: envAdded names
Loading

Possibly related PRs

  • DocSpring/rack-gateway#182: Introduced command approval, Slack process notifications, and readable web audit details that this change extends with environment-variable summaries and audit data.
Merge Risk: Minimal · up to b3218

The environment-variable summaries and audit display are mergeable after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the primary change: command environment-variable summaries in the PIN dialog and Slack. The objectives confirm this is the main change. It also includes the version bump (v0.1.27), whi…
Docstring Coverage Passed Docstring coverage is 81.82% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 12 files. (5 skipped: 5…
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.
Full details: Title check

Explanation

The title names the primary change: command environment-variable summaries in the PIN dialog and Slack. The objectives confirm this is the main change. It also includes the version bump (v0.1.27), which is a minor detail. The title is concise, specific, and does not use vague terms.

Full details: Docstring Coverage

Explanation

Docstring coverage is 81.82% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 12 files. (5 skipped: 5 unsupported.)

Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the env plan with care,
Added names hop into the record there.
The CLI counts; Slack tells the tale,
Audit details show names without fail.
I thump my feet: the fields align,
Then nibble greens beside the line.

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

@deepsource-io

deepsource-io Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in cb4fb02...b3218e7 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Oct 26, 2026 10:02p.m. Review ↗
Go Oct 26, 2026 10:02p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@ndbroadbent
ndbroadbent merged commit 292b069 into main Oct 26, 2026
14 checks passed
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