Skip to content

refactor: align jammy agent settings to cp+assets approach#646

Open
neddp wants to merge 1 commit into
ubuntu-jammyfrom
align-jammy-agent-settings-to-cp-style
Open

refactor: align jammy agent settings to cp+assets approach#646
neddp wants to merge 1 commit into
ubuntu-jammyfrom
align-jammy-agent-settings-to-cp-style

Conversation

@neddp

@neddp neddp commented Jun 14, 2026

Copy link
Copy Markdown
Member

Replace heredoc-based apply.sh scripts with static assets/agent.json files (the same approach already used on ubuntu-noble). This makes the two branches structurally identical so future jammy->noble merge forwards cannot silently resolve apply.sh conflicts in favor of the wrong version.
As seen here: #644

  • Delete prelude_agent.bash (PartitionerType: parted is now inlined as a static field in each assets/agent.json, as the function has unconditionally returned that string since 59a9c29 in 2019)
  • Replace all 8 bosh_*_agent_settings/apply.sh heredocs with a single cp $assets_dir/agent.json line
  • Add assets/agent.json for every stage carrying the full config (including UseMonitIptablesFirewall added in 8104abd)

Replace heredoc-based apply.sh scripts with static assets/agent.json
files (the same approach already used on ubuntu-noble). This makes the
two branches structurally identical so future jammy=>noble merge
forwards cannot silently resolve apply.sh conflicts in favour of the
wrong version.

- Delete prelude_agent.bash (PartitionerType: parted is now inlined as
  a static field in each assets/agent.json, as the function has
  unconditionally returned that string since 59a9c29 in 2019)
- Replace all 8 bosh_*_agent_settings/apply.sh heredocs with a single
  cp $assets_dir/agent.json line
- Add assets/agent.json for every stage carrying the full config
  (including UseMonitIptablesFirewall added in 8104abd)
@coderabbitai

coderabbitai Bot commented Jun 14, 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: ee31bf49-e5e1-4190-b0ea-437af8419ebe

📥 Commits

Reviewing files that changed from the base of the PR and between 3650c6a and 3e28db0.

📒 Files selected for processing (17)
  • stemcell_builder/lib/prelude_agent.bash
  • stemcell_builder/stages/bosh_alicloud_agent_settings/apply.sh
  • stemcell_builder/stages/bosh_alicloud_agent_settings/assets/agent.json
  • stemcell_builder/stages/bosh_aws_agent_settings/apply.sh
  • stemcell_builder/stages/bosh_aws_agent_settings/assets/agent.json
  • stemcell_builder/stages/bosh_azure_agent_settings/apply.sh
  • stemcell_builder/stages/bosh_azure_agent_settings/assets/agent.json
  • stemcell_builder/stages/bosh_cloudstack_agent_settings/apply.sh
  • stemcell_builder/stages/bosh_cloudstack_agent_settings/assets/agent.json
  • stemcell_builder/stages/bosh_google_agent_settings/apply.sh
  • stemcell_builder/stages/bosh_google_agent_settings/assets/agent.json
  • stemcell_builder/stages/bosh_openstack_agent_settings/apply.sh
  • stemcell_builder/stages/bosh_openstack_agent_settings/assets/agent.json
  • stemcell_builder/stages/bosh_softlayer_agent_settings/apply.sh
  • stemcell_builder/stages/bosh_softlayer_agent_settings/assets/agent.json
  • stemcell_builder/stages/bosh_vsphere_agent_settings/apply.sh
  • stemcell_builder/stages/bosh_vsphere_agent_settings/assets/agent.json
💤 Files with no reviewable changes (1)
  • stemcell_builder/lib/prelude_agent.bash

Walkthrough

Across eight IaaS-specific stemcell builder stages (AliCloud, AWS, Azure, CloudStack, Google, OpenStack, SoftLayer, vSphere), each apply.sh script is simplified: the sourcing of prelude_agent.bash and the inline heredoc that generated agent.json are replaced by a single cp from $assets_dir/agent.json into $chroot/var/vcap/bosh/agent.json. A corresponding static assets/agent.json file is introduced for each IaaS, encoding the same platform Linux settings and IaaS-specific infrastructure source configuration that was previously embedded inline. The now-unused get_partitioner_type_mapping bash function is removed from stemcell_builder/lib/prelude_agent.bash.

Suggested Reviewers

  • aramprice
  • mkocher
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: refactoring jammy agent settings to use the cp+assets approach instead of heredoc-based generation.
Description check ✅ Passed The description is comprehensive, detailing the three key changes (deleted prelude_agent.bash, simplified apply.sh scripts, added static agent.json files), the rationale, and referencing a related issue (#644).
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 align-jammy-agent-settings-to-cp-style

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending Merge | Prioritized

Development

Successfully merging this pull request may close these issues.

1 participant