Remove alias / duplicate spec.yml files#2719
Conversation
WalkthroughSeveral job spec YAML files were removed or emptied (jobs/blobstore/spec.yml, jobs/director/spec.yml, jobs/health_monitor/spec.yml, jobs/nats/spec.yml, jobs/postgres-13/spec.yml, jobs/postgres/spec.yml). Health-monitor and NATS job specs and templates were changed to split a single CA certificate into separate director and UAA CA cert templates/properties. Multiple libraries (bosh-monitor, bosh-nats-sync) and their tests were updated to accept separate Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR aligns the release with the BOSH job convention of using ${JOB}/spec by removing duplicate spec.yml files and updating the integration helper to read from the extensionless spec file.
Changes:
- Update Postgres version integration helper to load
jobs/postgres/specinstead ofjobs/postgres/spec.yml. - Remove duplicate job spec YAML files (
jobs/postgres/spec.yml,jobs/postgres-13/spec.yml) now thatjobs/*/specexists.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/spec/integration_support/postgres_version_helper.rb | Switches job spec path lookup from spec.yml to spec and updates the mismatch error message. |
| jobs/postgres/spec.yml | Removes duplicate job spec file in favor of jobs/postgres/spec. |
| jobs/postgres-13/spec.yml | Removes duplicate job spec file in favor of jobs/postgres-13/spec. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/spec/integration_support/postgres_version_helper.rb`:
- Line 11: The raised error message is misleading: it uses the wrong path string
and swaps the reported values. Update the raise string so the path reads
something like "jobs/postgres_spec" (replace the current "jobs/postgres?spec")
and map the variables correctly so the spec/release value uses release_version
and the local value uses local_version (i.e., "Postgres major version mismatch:
jobs/postgres_spec: #{release_version}; local: #{local_version}."). Ensure you
modify the raise call that references local_version and release_version in
postgres_version_helper.rb.
🪄 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
Run ID: d12a146a-8803-4132-a752-ddf65bd5ad3e
📒 Files selected for processing (7)
jobs/blobstore/spec.ymljobs/director/spec.ymljobs/health_monitor/spec.ymljobs/nats/spec.ymljobs/postgres-13/spec.ymljobs/postgres/spec.ymlsrc/spec/integration_support/postgres_version_helper.rb
💤 Files with no reviewable changes (6)
- jobs/health_monitor/spec.yml
- jobs/nats/spec.yml
- jobs/director/spec.yml
- jobs/blobstore/spec.yml
- jobs/postgres-13/spec.yml
- jobs/postgres/spec.yml
The bosh convention is `${JOB}/spec`.
b76db88 to
7d34d09
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/spec/integration_support/postgres_version_helper.rb (1)
10-12:⚠️ Potential issue | 🟡 MinorSwap the reported versions in the mismatch message.
The path is now correct, but the values are still reversed:
jobs/postgres/specis printinglocal_version, andlocalis printingrelease_version. That makes the exception misleading when the versions diverge.Proposed fix
- raise "Postgres major version mismatch: jobs/postgres/spec: #{local_version}; local: #{release_version}." + raise "Postgres major version mismatch: jobs/postgres/spec: #{release_version}; local: #{local_version}."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/spec/integration_support/postgres_version_helper.rb` around lines 10 - 12, The error message raised when major versions mismatch is printing the versions reversed; in the raise call inside the block that checks local_major_version == release_major_version, swap the interpolated variables so the "jobs/postgres/spec:" segment shows release_version and the "local:" segment shows local_version; update the raise string in the method that uses local_major_version, release_major_version, local_version and release_version accordingly to reflect correct values.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@src/spec/integration_support/postgres_version_helper.rb`:
- Around line 10-12: The error message raised when major versions mismatch is
printing the versions reversed; in the raise call inside the block that checks
local_major_version == release_major_version, swap the interpolated variables so
the "jobs/postgres/spec:" segment shows release_version and the "local:" segment
shows local_version; update the raise string in the method that uses
local_major_version, release_major_version, local_version and release_version
accordingly to reflect correct values.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1b6da530-aaa9-4fd3-bf90-77f08b40ea26
📒 Files selected for processing (7)
jobs/blobstore/spec.ymljobs/director/spec.ymljobs/health_monitor/spec.ymljobs/nats/spec.ymljobs/postgres-13/spec.ymljobs/postgres/spec.ymlsrc/spec/integration_support/postgres_version_helper.rb
💤 Files with no reviewable changes (6)
- jobs/director/spec.yml
- jobs/health_monitor/spec.yml
- jobs/blobstore/spec.yml
- jobs/nats/spec.yml
- jobs/postgres/spec.yml
- jobs/postgres-13/spec.yml
389d883 to
7d34d09
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@spec/health_monitor_templates_spec.rb`:
- Around line 73-74: Replace the weak type assertions on
parsed_yaml['director']['director_ca_cert'] and
parsed_yaml['director']['uaa_ca_cert'] with exact path equality checks:
determine the expected absolute file paths used by the template (or derive them
via the same helper/fixture used in the spec setup) and assert
parsed_yaml['director']['director_ca_cert'].to eq(expected_director_ca_path) and
parsed_yaml['director']['uaa_ca_cert'].to eq(expected_uaa_ca_path) so the spec
verifies the rendered paths rather than just their types.
In `@src/bosh-nats-sync/lib/nats_sync/auth_provider.rb`:
- Line 24: Replace the use of Base64.encode64 when building the HTTP Basic
Authorization header so it doesn't insert newlines; specifically change the call
to Base64.strict_encode64 for the value constructed in auth_provider.rb (the
string building that currently uses
Base64.encode64("#{`@user`}:#{`@password`}").strip) so the Authorization header
generation in the auth provider (where "Basic #{...}" is composed) emits a
single-line RFC 4648-compliant base64 value.
🪄 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
Run ID: 3e849299-1d38-4582-8135-4344d33a02d8
📒 Files selected for processing (23)
jobs/health_monitor/specjobs/health_monitor/templates/director_ca_cert.pem.erbjobs/health_monitor/templates/health_monitor.yml.erbjobs/health_monitor/templates/uaa.pem.erbjobs/health_monitor/templates/uaa_ca_cert.pem.erbjobs/nats/specjobs/nats/templates/bosh_nats_sync_config.yml.erbjobs/nats/templates/director_ca_cert.pem.erbjobs/nats/templates/uaa.pem.erbjobs/nats/templates/uaa_ca_cert.pem.erbspec/health_monitor_templates_spec.rbspec/nats_templates_spec.rbsrc/bosh-monitor/lib/bosh/monitor/auth_provider.rbsrc/bosh-monitor/spec/unit/bosh/monitor/auth_provider_spec.rbsrc/bosh-monitor/spec/unit/bosh/monitor/director_spec.rbsrc/bosh-monitor/spec/unit/bosh/monitor/plugins/event_logger_spec.rbsrc/bosh-monitor/spec/unit/bosh/monitor/plugins/resurrector_spec.rbsrc/bosh-nats-sync/lib/nats_sync/auth_provider.rbsrc/bosh-nats-sync/lib/nats_sync/users_sync.rbsrc/bosh-nats-sync/spec/assets/sample_config.ymlsrc/bosh-nats-sync/spec/nats_sync/auth_provider_spec.rbsrc/bosh-nats-sync/spec/nats_sync/runner_spec.rbsrc/bosh-nats-sync/spec/nats_sync/users_sync_spec.rb
💤 Files with no reviewable changes (2)
- jobs/health_monitor/templates/uaa.pem.erb
- jobs/nats/templates/uaa.pem.erb
The bosh convention is
${JOB}/spec.