Skip to content

BRE-1893 fix(marketplace): guard against non-interactive shells#520

Merged
fntyler merged 1 commit into
mainfrom
bre-1893/fix-setup-wizard
Jun 3, 2026
Merged

BRE-1893 fix(marketplace): guard against non-interactive shells#520
fntyler merged 1 commit into
mainfrom
bre-1893/fix-setup-wizard

Conversation

@fntyler
Copy link
Copy Markdown
Contributor

@fntyler fntyler commented Jun 3, 2026

🎟️ Tracking

BRE-1893

📔 Objective

The first-login setup wizard prompts for the deployment edition via a read loop. When a non-interactive session sources it, the prompt blocks the session, so the session's commands never run.

  • Exit the wizard immediately when stdin or stdout is not a terminal, so non-interactive logins are never blocked
  • Make the read EOF-safe (|| exit 0) so a closed stdin cannot spin the selection loop

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

… shells

[BRE-1893](https://bitwarden.atlassian.net/browse/BRE-1893)

The first-login setup wizard prompts for the deployment edition via a
`read` loop. When a non-interactive session sources it, the
prompt blocks the session, so the session's commands never run.
* Exit the wizard immediately when stdin or stdout is not a terminal,
  so non-interactive logins are never blocked
* Make the read EOF-safe (`|| exit 0`) so a closed stdin cannot spin the
  selection loop
@fntyler fntyler requested a review from a team as a code owner June 3, 2026 21:37
@fntyler fntyler requested a review from aj-bw June 3, 2026 21:37
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR adds two defensive guards to CommonMarketplace/files/opt/bitwarden/setup-wizard.sh so the first-login setup wizard cannot block non-interactive sessions: an early exit 0 when stdin or stdout is not a TTY, and an EOF-safe read fallback inside the selection loop. The change is small, focused, and correctly preserves retry behavior — when the wizard exits early in non-interactive mode, the /etc/profile.d/bitwarden-first-login.sh trigger is left in place, so the wizard will re-run on the next interactive login. The fix is consistent with the BRE-1893 root cause described in the PR.

Code Review Details

No findings.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 3, 2026

@fntyler fntyler enabled auto-merge (squash) June 3, 2026 21:41
Copy link
Copy Markdown
Contributor

@gitclonebrian gitclonebrian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@fntyler fntyler merged commit 4772370 into main Jun 3, 2026
8 checks passed
@fntyler fntyler deleted the bre-1893/fix-setup-wizard branch June 3, 2026 21:42
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