Skip to content

fix(scripts): tolerate SIGPIPE in bootstrap_secrets randstr - #356

Merged
vedharish merged 1 commit into
mainfrom
fix/bootstrap-secrets-pipefail
Nov 11, 2026
Merged

vedharish merged 1 commit into
mainfrom
fix/bootstrap-secrets-pipefail

Conversation

@Vishalan

Copy link
Copy Markdown
Collaborator

Problem

On a fresh checkout (no secrets/*.env), make test fails at setup_secrets with Error 141.

randstr() pipes tr into head -c N. Once head has enough bytes it closes the pipe and tr is killed by SIGPIPE (exit 141). The script runs with set -euo pipefail, so the pipeline status aborts it.

Fix

Append || true to the pipeline in randstr() so the expected SIGPIPE is ignored. The output is unaffected.

Testing

  • Copied the script and the four *.env.sample files into an empty temp dir and ran it: exit 0, all four *.env files created, no __CHANGE_ME__ placeholders left.
  • Re-ran it: "already present, nothing to do", exit 0 (still idempotent).
  • Scope: one line plus a comment; no behaviour change when secrets already exist or when MYSQL_ROOT_PASSWORD / APP_TOKEN are provided.

Not included: the Dockerfile still uses the EOL python:3.11-slim-bullseye base image (apt 404s on a fresh build). That is a separate decision and is not part of this PR.

🤖 Generated with Claude Code

`head -c` closes the pipe once it has enough bytes, so `tr` exits 141.
Under `set -euo pipefail` the command substitution then aborts the script
on a fresh checkout (no secrets/*.env yet), failing `make test` at
setup_secrets with Error 141.

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

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. 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: Central YAML (base), Organization UI (inherited), Workspace UI (inherited); Enforced overrides: Organization
  • Review profile: ASSERTIVE
  • Plan: Enterprise
  • Run ID: 31f7c2f7-8baa-46db-99b3-b039bba2477d

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

@vedharish
vedharish merged commit d1fa321 into main Nov 11, 2026
9 checks passed
@vedharish
vedharish deleted the fix/bootstrap-secrets-pipefail branch November 11, 2026 09:06
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