Skip to content

Support additional okteto manifest filename patterns#287

Merged
rberrelleza merged 5 commits intomainfrom
feature/expand-manifest-patterns
Mar 5, 2026
Merged

Support additional okteto manifest filename patterns#287
rberrelleza merged 5 commits intomainfrom
feature/expand-manifest-patterns

Conversation

@rberrelleza
Copy link
Copy Markdown
Member

@rberrelleza rberrelleza commented Feb 13, 2026

Summary

Expands manifest file discovery to support additional naming patterns for Okteto manifests.

Changes

New Supported Patterns

In addition to the existing patterns, the extension now recognizes:

Previously supported:

  • okteto.yml, okteto.yaml
  • docker-compose.yml, docker-compose.yaml
  • okteto-pipeline.yml, okteto-pipeline.yaml

Now also supported:

  • okteto-*.yml, okteto-*.yaml (e.g., okteto-stack.yml, okteto-compose.yaml)
  • okteto.*.yml, okteto.*.yaml (e.g., okteto.dev.yml, okteto.prod.yaml)

Implementation

Updated glob pattern:

'**/{okteto,docker-compose,okteto-*,okteto.*}.{yml,yaml}'

Smart filtering:

  • Deploy commands (okteto.deploy, okteto.destroy, okteto.test): Accept all matching patterns
  • Up command (okteto.up): Only accept exact matches (okteto.yml, docker-compose.yml) - no pipeline or custom variants

Pattern matching logic:

const isDeployPattern = (filename: string): boolean => {
    if (supportedFilenames === supportedDeployFilenames) {
        return /^okteto-.*\.(yml|yaml)$/.test(filename) ||
               /^okteto\..*\.(yml|yaml)$/.test(filename) ||
               supportedFilenames.includes(filename);
    }
    return supportedFilenames.includes(filename);
};

Use Cases

This change enables:

  1. Environment-specific manifests: okteto.dev.yml, okteto.staging.yml, okteto.us-west.yml
  2. Feature manifests: okteto.feature-auth.yml, okteto.feature-api.yml
  3. Alternative naming: okteto.local.yaml, okteto.test.yaml

Testing

All existing tests pass:

✓ npm run lint       # 21 warnings (expected)
✓ npm test           # 52 passing
✓ npm run test:e2e   # 10 passing
✓ npm run package    # Built successfully (1.61 MB)

Backward Compatibility

✅ Fully backward compatible - all previously supported filenames continue to work exactly as before.

🤖 Generated with Claude Code

@rberrelleza rberrelleza force-pushed the feature/expand-manifest-patterns branch from 8192530 to 3811096 Compare March 4, 2026 21:14
rberrelleza and others added 4 commits March 4, 2026 23:16
Expand manifest file discovery to include:
- okteto-*.yml, okteto-*.yaml (e.g., okteto-stack.yml)
- okteto.*.yml, okteto.*.yaml (e.g., okteto.dev.yml, okteto.prod.yaml)

For deploy commands, any file matching these patterns is now supported.
For up commands, only exact matches (okteto.yml, okteto.yaml, docker-compose.yml, docker-compose.yaml) are allowed.

Updated glob pattern and added pattern matching logic to filter appropriately based on command type.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Refactored pattern matching logic into exported isManifestSupported function
for better testability.

New test coverage (14 tests, +27% increase):
- Deploy command patterns (allowPatterns=true)
  - Exact matches from supported list
  - okteto-*.{yml,yaml} patterns
  - okteto.*.{yml,yaml} patterns
  - Rejection of non-matching files
  - Edge cases with multiple dots/dashes
- Up command patterns (allowPatterns=false)
  - Exact matches only
  - Rejection of all pattern-based files
- Case sensitivity validation
- Empty and invalid input handling

Test results:
- 66 unit tests passing (was 52)
- 10 E2E tests passing
- Extension packages successfully (1.61 MB)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updated documentation:
- CHANGELOG.md: Added feature description and updated test count
- docs/manifest-patterns.md: New comprehensive guide covering:
  - All supported patterns and use cases
  - Command-specific behavior (Up vs Deploy)
  - Examples and best practices
  - Troubleshooting guide
  - Migration guide
- docs/index.md: Added link to manifest patterns documentation
- README.md: Added supported manifest files section
- TESTING.md: Added test cases for custom manifest patterns

Documentation covers:
- Pattern matching rules (okteto-*.yml, okteto.*.yml)
- Differences between Up and Deploy commands
- Use cases (environment-specific, feature branches, components)
- Multiple manifest handling
- Best practices and troubleshooting

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
All Okteto commands (Up, Deploy, Destroy, Test) now support the same
manifest patterns, removing previous restrictions on the Up command.

Changes:
- Removed allowPatterns parameter from isManifestSupported()
- All commands now accept okteto-*.{yml,yaml} and okteto.*.{yml,yaml} patterns
- Enables using environment-specific manifests (okteto.dev.yml) with Up command
- Simplified code and unified behavior across all commands

Updated tests (63 passing):
- Reorganized test cases to reflect unified behavior
- All pattern tests now verify support across all command types
- Removed command-specific filtering tests

Updated documentation:
- CHANGELOG.md: Updated feature description
- docs/manifest-patterns.md: Removed Up command restrictions
- README.md: Clarified all commands support all patterns
- TESTING.md: Updated test cases for unified behavior

Benefits:
- Simpler mental model - one set of rules for all commands
- More flexible workflows - use custom patterns with any command
- Consistent user experience across extension

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@rberrelleza rberrelleza force-pushed the feature/expand-manifest-patterns branch from 3811096 to e3d43cc Compare March 5, 2026 17:29
@rberrelleza rberrelleza merged commit 6d8e605 into main Mar 5, 2026
4 checks passed
@rberrelleza rberrelleza deleted the feature/expand-manifest-patterns branch March 5, 2026 18:39
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.

1 participant