Skip to content

CI: pass SHLVL to make ~ubuntu/.bash_logout succeed#627

Merged
aramprice merged 1 commit into
ubuntu-jammyfrom
fix-sudo-env
Jun 10, 2026
Merged

CI: pass SHLVL to make ~ubuntu/.bash_logout succeed#627
aramprice merged 1 commit into
ubuntu-jammyfrom
fix-sudo-env

Conversation

@aramprice

Copy link
Copy Markdown
Member

NOTE: this repository uses a "Merge Forward" strategy

Changes should be made in the earliest applicable branch, and
merged forward through subsequent branches.

  1. Create a PR into the oldest branch (ubuntu-<short_name>)
  2. After this PR has been merged create a merge-to-<next_short_name> branch
  3. Merge ubuntu-<short_name> into merge-to-<next_short_name>
  4. Create a PR to merge merge-to-<next_short_name> into ubuntu-<next_short_name>
  5. Repeat as needed for subsequent branches

Copilot AI review requested due to automatic review settings June 10, 2026 02:24
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d0a4be4e-87de-47b6-8957-9cae6ff7003b

📥 Commits

Reviewing files that changed from the base of the PR and between 21f4272 and e045098.

📒 Files selected for processing (2)
  • ci/tasks/build.sh
  • ci/tasks/os-images/build.sh

Walkthrough

This PR updates two CI build scripts (ci/tasks/build.sh and ci/tasks/os-images/build.sh) to add SHLVL to the sudo --preserve-env list used in heredoc invocations and to remove the interactive -i flag from /bin/bash --login. Comments were added noting that forwarding SHLVL prevents ~ubuntu/.bash_logout from causing the session to exit.

Suggested reviewers

  • mkocher
  • ragaskar
  • rkoster
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly relates to the main change: preserving the SHLVL environment variable in CI build scripts to resolve bash_logout issues.
Description check ✅ Passed The description matches the provided template exactly, documenting the repository's Merge Forward strategy and workflow steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-sudo-env

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[bot]
coderabbitai Bot previously approved these changes Jun 10, 2026

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

Updates the CI task wrappers that sudo to the ubuntu user so the login shell exits cleanly by preserving SHLVL in the environment, avoiding failures triggered by ~ubuntu/.bash_logout.

Changes:

  • Preserve SHLVL in sudo --preserve-env for the ubuntu subshell used to run bundle/rake.
  • Switch the ubuntu subshell invocation from bash --login -i to bash --login.

Reviewed changes

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

File Description
ci/tasks/os-images/build.sh Preserve SHLVL for the ubuntu login shell used to build OS images; drop interactive bash flag.
ci/tasks/build.sh Preserve SHLVL for the ubuntu login shell used to build stemcells; drop interactive bash flag.

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

Comment thread ci/tasks/os-images/build.sh Outdated
Comment thread ci/tasks/build.sh Outdated
@aramprice aramprice merged commit d929445 into ubuntu-jammy Jun 10, 2026
12 checks passed
@aramprice aramprice deleted the fix-sudo-env branch June 10, 2026 02:32
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