Skip to content

Conversation

@delkopiso
Copy link

Fixes #1630

Summary

This PR fixes an issue where destination config files always used the .yml extension, even when the base config file used .yaml. Now the destination file preserves the same extension as the base config file.

Changes

Core Fix

  • lib/kamal/configuration.rb: Modified destination_config_file method to preserve the base file's extension instead of hardcoding .yml

Test Coverage

  • test/configuration_test.rb: Added tests to verify both .yml and .yaml extensions work correctly with destinations
  • Test fixtures: Added .yaml versions of existing test files (deploy_for_dest.yaml, deploy_for_dest.world.yaml)

Behavior Changes

Before

kamal deploy --config-file my-app.yaml -d staging
# Looked for: my-app.staging.yml ❌

After

kamal deploy --config-file my-app.yaml -d staging
# Looks for: my-app.staging.yaml ✅

kamal deploy --config-file my-app.yml -d staging  
# Looks for: my-app.staging.yml ✅ (unchanged)

Backward Compatibility

Fully backward compatible - existing .yml config files continue to work exactly as before. Only affects users who want to use .yaml extensions consistently.

Test Plan

  • Existing tests pass (ensures no regression)
  • New tests verify .yaml extension preservation
  • New tests verify .yml extension still works (backward compatibility)

The fix is minimal, focused, and maintains full backward compatibility while providing the expected behavior for users who prefer .yaml extensions.

Copilot AI review requested due to automatic review settings August 18, 2025 22:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where destination config files always used the .yml extension regardless of the base config file's extension. Now destination files preserve the same extension as the base config file (.yml or .yaml).

  • Modified destination_config_file method to extract and preserve the base file's extension
  • Added comprehensive test coverage for both .yml and .yaml extensions
  • Created new test fixtures with .yaml extension to support the enhanced tests

Reviewed Changes

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

File Description
lib/kamal/configuration.rb Updated destination_config_file method to preserve base file extension
test/configuration_test.rb Added tests verifying both .yml and .yaml extension preservation
test/fixtures/deploy_for_dest.yaml New test fixture with .yaml extension
test/fixtures/deploy_for_dest.world.yaml New destination-specific test fixture with .yaml extension

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

Destination config files don't preserve base file extension

1 participant