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

Fix pattern for needle tag #6024

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Conversation

perlpunk
Copy link
Contributor

@perlpunk perlpunk commented Oct 24, 2024

Developer console showed me this error:

Pattern attribute value ^[A-Za-z0-9-_]+$ is not a valid regular expression:
Uncaught SyntaxError: Invalid regular expression: /^[A-Za-z0-9-_]+$/v:
Invalid character class

Apparently dashes have to be escaped. Moving it to the end of the character class (this would have fixed it for a perl regex) did not help.

@perlpunk
Copy link
Contributor Author

I guess a test should be possible. The "Add" button should not be clickable if the pattern doesn't match.

@perlpunk perlpunk marked this pull request as draft October 24, 2024 13:01
Copy link
Contributor

@Martchus Martchus left a comment

Choose a reason for hiding this comment

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

I guess it would make sense to change the title as well but the change itself looks good. Testing could be done in the Selenium-based test of the needle editor but is likely not required for this trivial change.

Developer console showed me this error:

    Pattern attribute value ^[A-Za-z0-9-_]+$ is not a valid regular expression:
    Uncaught SyntaxError: Invalid regular expression: /^[A-Za-z0-9-_]+$/v:
    Invalid character class

Apparently dashes have to be escaped. Moving it to the end of the character
class (this would have fixed it for a perl regex) did not help.
@perlpunk
Copy link
Contributor Author

Since we actually never tested this, I added a test for it.

@perlpunk perlpunk marked this pull request as ready for review October 28, 2024 13:05
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.98%. Comparing base (9a22ad5) to head (18f2730).
Report is 6 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6024   +/-   ##
=======================================
  Coverage   98.98%   98.98%           
=======================================
  Files         395      395           
  Lines       39344    39354   +10     
=======================================
+ Hits        38944    38954   +10     
  Misses        400      400           

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

@mergify mergify bot merged commit e85916c into os-autoinst:master Oct 28, 2024
46 checks passed
@perlpunk perlpunk deleted the fix-pattern branch October 28, 2024 15:26
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