Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow colon inside source tags #351

Merged
merged 3 commits into from
Jun 4, 2024
Merged

Allow colon inside source tags #351

merged 3 commits into from
Jun 4, 2024

Conversation

jhamon
Copy link
Collaborator

@jhamon jhamon commented Jun 4, 2024

Problem

Some partners have requested that colon, :, be added to the set of allowed characters inside source tags.

Solution

Add colon to the set of allowed characters.

Type of Change

  • New feature (non-breaking change which adds functionality)

Test Plan

Unit tests updated to reflect new allowed character.

@jhamon jhamon marked this pull request as ready for review June 4, 2024 20:09
@jhamon jhamon requested a review from ssmith-pc June 4, 2024 20:09
Copy link
Contributor

@austin-denoble austin-denoble left a comment

Choose a reason for hiding this comment

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

Nice, this should be just as straightforward in the other clients since we handled it similarly. 🚢

Copy link
Contributor

@ssmith-pc ssmith-pc left a comment

Choose a reason for hiding this comment

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

🚀

@@ -11,7 +11,7 @@ def _build_source_tag_field(source_tag):
# 3. Trim left/right whitespace
# 4. Condense multiple spaces to one, and replace with underscore
tag = source_tag.lower()
tag = re.sub(r'[^a-z0-9_ ]', '', tag)
tag = re.sub(r'[^a-z0-9_ \:]', '', tag)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's not necessary to escape the colon if it's used by itself like this

>>> re.sub(r'[^a-z0-9_ :]', '', tag)
'my:tag'

@jhamon jhamon merged commit 1292853 into main Jun 4, 2024
81 checks passed
@jhamon jhamon deleted the jhamon/sourcetag-colons branch June 4, 2024 20:44
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