Skip to content

refactor: define agent config in code - #458

Closed
KauzClay wants to merge 1 commit into
mainfrom
refactor-agent-config-integration-tests
Closed

refactor: define agent config in code#458
KauzClay wants to merge 1 commit into
mainfrom
refactor-agent-config-integration-tests

Conversation

@KauzClay

@KauzClay KauzClay commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What is this change about?

after adding copies of the agent config that used systemd, it seemed execessive to have 6 json config files used by tests

instead, we can just define a default config in code, let the test harnesss determine if sysetmd is being used, and edit the agent config as needed per test

ai-assisted=yes

Please provide contextual information.

[TNZ-106038] Refactor bosh-agent CI pipeline to run integration tests on all supported stemcell lines (Jammy, Noble, Resolute)

What tests have you run against this PR?

TODO

How should this change be described in bosh-agent release notes?

N/A

Does this PR introduce a breaking change?

No

Tag your pair, your PM, and/or team!

@mkocher

AI Review Feedback

All AI review comments (CodeRabbit, and Copilot when assigned) must be resolved before human reviewers will look at the PR. For each comment, either:

  • Make the suggested change, or
  • Reply to the comment explaining why it does not apply, then resolve the thread.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@KauzClay, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5de9bef7-0544-4c54-a930-82b8ed13bf7d

📥 Commits

Reviewing files that changed from the base of the PR and between 4066cdc and fcbb856.

📒 Files selected for processing (28)
  • integration/agent_config.go
  • integration/apply_test.go
  • integration/assets/file-settings-agent-no-default-tmp-dir-systemd.json
  • integration/assets/file-settings-agent-no-default-tmp-dir.json
  • integration/assets/file-settings-agent-root-partition-systemd.json
  • integration/assets/file-settings-agent-root-partition.json
  • integration/assets/file-settings-agent-systemd.json
  • integration/assets/file-settings-agent.json
  • integration/bundle_logs_test.go
  • integration/compile_package_test.go
  • integration/delete_arp_entries_test.go
  • integration/ephemeral_disk_test.go
  • integration/fetch_logs_test.go
  • integration/fetch_logs_with_signed_url_test.go
  • integration/file_settings_test.go
  • integration/instance_info_test.go
  • integration/integration_suite_test.go
  • integration/nats_firewall_test.go
  • integration/prepare_test.go
  • integration/raw_ephemeral_disk_test.go
  • integration/remove_file_test.go
  • integration/run_script_test.go
  • integration/sync_dns_test.go
  • integration/system_mounts_test.go
  • integration/test_environment.go
  • integration/update_settings_test.go
  • integration/user_permissions_test.go
  • integration/v1_apply_test.go

Walkthrough

The integration package now exports DefaultAgentConfig. TestEnvironment generates agent configuration files from app.Config values and removes settings-file asset lookup. Integration tests use the shared default configuration, with direct overrides for temporary-directory and partition scenarios. Several settings-file configuration assets were deleted.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the change, context, release notes, breaking changes, and ownership, but the required test results section still says "TODO". Replace "TODO" with a comprehensive list of tests that passed against this pull request.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: defining the agent configuration in code.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor-agent-config-integration-tests

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.

Comment thread integration/agent_config.go
Comment thread integration/ephemeral_disk_test.go Outdated
Comment thread integration/test_environment.go
Comment thread integration/test_environment.go Outdated

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@integration/test_environment.go`:
- Around line 695-712: Add focused tests for
TestEnvironment.CreateAgentConfigFile that verify the generated
agent-config.json contents, including preservation of an explicit
Platform.Linux.ServiceManager and fallback to t.serviceManager when it is empty.
Cover successful remote installation and assert the helper returns no error,
using the existing integration-test setup and command/file helpers.
- Around line 708-712: Update the configuration replacement flow around
CopyFileToPath to remove the preceding sudo rm command, preserving the existing
/var/vcap/bosh/agent.json until the staged copy succeeds and is moved into
place.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 38241090-06ce-4f6b-83e5-97f4e6f9008b

📥 Commits

Reviewing files that changed from the base of the PR and between c95561b and 4066cdc.

📒 Files selected for processing (28)
  • integration/agent_config.go
  • integration/apply_test.go
  • integration/assets/file-settings-agent-no-default-tmp-dir-systemd.json
  • integration/assets/file-settings-agent-no-default-tmp-dir.json
  • integration/assets/file-settings-agent-root-partition-systemd.json
  • integration/assets/file-settings-agent-root-partition.json
  • integration/assets/file-settings-agent-systemd.json
  • integration/assets/file-settings-agent.json
  • integration/bundle_logs_test.go
  • integration/compile_package_test.go
  • integration/delete_arp_entries_test.go
  • integration/ephemeral_disk_test.go
  • integration/fetch_logs_test.go
  • integration/fetch_logs_with_signed_url_test.go
  • integration/file_settings_test.go
  • integration/instance_info_test.go
  • integration/integration_suite_test.go
  • integration/nats_firewall_test.go
  • integration/prepare_test.go
  • integration/raw_ephemeral_disk_test.go
  • integration/remove_file_test.go
  • integration/run_script_test.go
  • integration/sync_dns_test.go
  • integration/system_mounts_test.go
  • integration/test_environment.go
  • integration/update_settings_test.go
  • integration/user_permissions_test.go
  • integration/v1_apply_test.go
💤 Files with no reviewable changes (6)
  • integration/assets/file-settings-agent-no-default-tmp-dir-systemd.json
  • integration/assets/file-settings-agent-no-default-tmp-dir.json
  • integration/assets/file-settings-agent-root-partition-systemd.json
  • integration/assets/file-settings-agent-root-partition.json
  • integration/assets/file-settings-agent-systemd.json
  • integration/assets/file-settings-agent.json

Comment thread integration/test_environment.go
Comment thread integration/test_environment.go Outdated
@KauzClay

KauzClay commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

probably should rebase this on top of #457

after adding copies of the agent config that used systemd, it seemed execessive to have 6 json config files used by tests

instead, we can just define a default config in code, let the test harnesss determine if sysetmd is being used, and edit the agent config as needed per test

ai-assisted=yes
[TNZ-106038] Refactor bosh-agent CI pipeline to run integration tests on all supported stemcell lines (Jammy, Noble, Resolute)
@KauzClay
KauzClay force-pushed the refactor-agent-config-integration-tests branch from 4066cdc to fcbb856 Compare August 3, 2026 18:18
@github-project-automation github-project-automation Bot moved this from Waiting for Changes | Open for Contribution to Pending Merge | Prioritized in Foundational Infrastructure Working Group Aug 3, 2026
@KauzClay

KauzClay commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

closing because we are folding this change into #457

@KauzClay KauzClay closed this Aug 4, 2026
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Aug 4, 2026
@KauzClay
KauzClay deleted the refactor-agent-config-integration-tests branch August 4, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant