Skip to content

Tag-expressions: Keep an AT sign inside a tag name - #1352

Open
arieleven wants to merge 1 commit into
behave:mainfrom
arieleven:fix/tag-expression-at-sign-in-tag
Open

arieleven wants to merge 1 commit into
behave:mainfrom
arieleven:fix/tag-expression-at-sign-in-tag

Conversation

@arieleven

Copy link
Copy Markdown

The feature parser only strips the leading @ of a tag, so @owner:[email protected] is the tag owner:[email protected]. TagExpressionUtil.normalize_tag_expression() removed every @ from the expression, so --tags=@owner:[email protected] looked for owner:janeexample.com: it selected nothing, and --tags="not @owner:[email protected]" excluded nothing.

This strips only an @ that starts a tag (at the start of the text, after whitespace or after (), and makes normalize_tag() strip only the leading one, as its docstring says.

Added a parametrized test in tests/unit/tag_expression/test_builder.py (3 of its 4 cases fail without the change). pytest tests passes (1671 passed), and so do the features, issue.features and tools/test-features suites, with the same counts as on main.

The feature parser only strips the leading '@' of a tag, so
'@owner:[email protected]' becomes the tag 'owner:[email protected]'.
TagExpressionUtil removed every '@' from the tag-expression text instead,
so '--tags=@owner:[email protected]' looked for 'owner:janeexample.com':
it selected nothing, and 'not @owner:[email protected]' excluded nothing.

Only strip an '@' that starts a tag (at the start, after whitespace or
after '('), and only the leading one in normalize_tag().

This branch has not been deployed

No deployments
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