Skip to content

Allow more capital characters and numbers in flag keys and variant keys#257

Merged
zhouzhuojie merged 3 commits into
masterfrom
ra/relax-regex-to-allow-numbers-capitals
May 15, 2019
Merged

Allow more capital characters and numbers in flag keys and variant keys#257
zhouzhuojie merged 3 commits into
masterfrom
ra/relax-regex-to-allow-numbers-capitals

Conversation

@raviambati
Copy link
Copy Markdown

@raviambati raviambati commented May 15, 2019

Allowing capital letters and numbers in flag keys and variant keys. This helps with use cases where keys are being migrated from legacy systems to flagr.

Description

Change flag key regex to accommodate to allow any word character, digits and hyphen.

Motivation and Context

This resolves issue 254.
#254

How Has This Been Tested?

Changed unit tests and tested locally by creating keys with capital letters and digits and other combinations.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #257 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #257   +/-   ##
=====================================
  Coverage      82%    82%           
=====================================
  Files          26     26           
  Lines        1528   1528           
=====================================
  Hits         1253   1253           
  Misses        207    207           
  Partials       68     68
Impacted Files Coverage Δ
pkg/util/util.go 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11a33a8...09aaad6. Read the comment docs.

@raviambati raviambati requested a review from zhouzhuojie May 15, 2019 22:42
Copy link
Copy Markdown
Collaborator

@zhouzhuojie zhouzhuojie left a comment

Choose a reason for hiding this comment

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

🎉 lgtm

Comment thread pkg/util/util_test.go
b, msg = IsSafeKey(" spaces in key are not allowed ")
assert.False(t, b)
assert.NotEmpty(t, msg)
assert.NotEmpty(t, msg)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit, there's an extra space we can remove

@zhouzhuojie zhouzhuojie merged commit 0373eb2 into master May 15, 2019
@zhouzhuojie zhouzhuojie deleted the ra/relax-regex-to-allow-numbers-capitals branch May 15, 2019 22:50
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.

3 participants