Skip to content

fix: preserve trailing separators in key generation#5594

Merged
kodiakhq[bot] merged 4 commits into
v2from
fix/lat-63-preserve-key-separators
Mar 20, 2026
Merged

fix: preserve trailing separators in key generation#5594
kodiakhq[bot] merged 4 commits into
v2from
fix/lat-63-preserve-key-separators

Conversation

@markphelps

@markphelps markphelps commented Mar 20, 2026

Copy link
Copy Markdown
Collaborator

This pull request improves the validation logic and key formatting utilities, and enhances their associated tests. The main focus is on supporting underscores and hyphens in keys, ensuring that punctuation is rejected, and preserving separator characters in generated keys.

Fixes: #5591

Validation improvements:

  • Added new tests for keyValidation to verify that keys with underscores and hyphens are accepted, and keys with punctuation are rejected.
  • Updated imports in validation.test.ts to include keyValidation.

Key formatting enhancements:

  • Modified the stringAsKey function to preserve leading and trailing underscores and hyphens, rather than trimming them.
  • Added tests to helpers.test.ts to confirm that stringAsKey preserves in-progress separator characters like underscores and hyphens.

- Keep trailing underscores and hyphens in key normalization\n- Add regression coverage for key regex acceptance of underscore and hyphen\n\nCo-Authored-By: Paperclip <[email protected]>
@markphelps
markphelps requested a review from a team as a code owner March 20, 2026 13:52
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi @markphelps! Thanks for your contribution to this project.

It looks like one or more of your commits are missing a DCO (Developer Certificate of Origin) sign-off. The DCO is a simple way for you to certify that you have the right to submit this code under the project's license.

How to fix this:

# For future commits, use the -s flag
git commit -s -m "Your commit message"

# To sign off on existing commits in this PR
git rebase HEAD~$(git rev-list --count origin/v2..HEAD) --signoff
git push --force-with-lease

The -s flag adds this line to your commit message:
Signed-off-by: Your Name <[email protected]>

📋 View the failing DCO check for more details

For more information about the DCO, visit: https://developercertificate.org/

- Avoid stripping user-typed leading/trailing separators unless they were introduced by normalization\n- Preserve existing unsupported-character trimming behavior\n\nCo-Authored-By: Paperclip <[email protected]>
@codecov

codecov Bot commented Mar 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.68%. Comparing base (88e0463) to head (3df5f90).
⚠️ Report is 1 commits behind head on v2.

Additional details and impacted files
@@           Coverage Diff           @@
##               v2    #5594   +/-   ##
=======================================
  Coverage   60.68%   60.68%           
=======================================
  Files         141      141           
  Lines       13998    13998           
=======================================
  Hits         8494     8494           
  Misses       4780     4780           
  Partials      724      724           
Flag Coverage Δ
integrationtests 34.70% <ø> (ø)
unittests 51.54% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@erka erka added automerge Used by Kodiak bot to automerge PRs v2 Flipt v2 labels Mar 20, 2026
@kodiakhq
kodiakhq Bot merged commit c970ef1 into v2 Mar 20, 2026
33 checks passed
@kodiakhq
kodiakhq Bot deleted the fix/lat-63-preserve-key-separators branch March 20, 2026 14:39
@github-project-automation github-project-automation Bot moved this to Done in Flipt V2 Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Used by Kodiak bot to automerge PRs size:M This PR changes 30-99 lines, ignoring generated files. v2 Flipt v2

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: Cannot input anything other than alphanumerical characters in the key field

2 participants