Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes YAML parsing to properly handle keys that contain dashes by implementing a key mapping strategy that temporarily sanitizes dash-containing keys during parsing and then restores the original keys in the output.
- Adds logic to detect and map keys with dashes to sanitized versions during dotenv parsing
- Implements a unique key generation mechanism to avoid collisions when multiple keys have similar patterns
- Restores original dash-containing keys in the final cache output
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test_files/kustomization.yaml | Adds test cases with dash-containing keys to validate the fix |
| input.go | Implements key mapping logic to handle dashes in variable names during YAML parsing |
| examples/4.read_types.cog.toml | Adds example configuration using a dash-containing key |
| cmd/cogs/main.go | Bumps version number to reflect the bug fix |
BriceAtB
approved these changes
Jul 28, 2025
codeaucafe
approved these changes
Jul 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes cogs yaml parsing when a yaml variable name has a dash/hyphen.