Navigation Menu

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

Environment variables expansion fails if variable name contains dot/dash #57

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

snallami
Copy link
Member

@snallami snallami commented Feb 3, 2018

For version 2.5, environment variable names can contain dot or dashes. Project keys like $sonar.projectkey in Jenkins configuration are quite common.

New changes broke existing configuration if job is configured with project keys like $sonar.projectkey. Getting below error during build
"java.net.URISyntaxException: Illegal character in query at index 62: https://foo.com/api/events?resource=${sonar.projectKey}&format=json&categories=Alert "

Per Open Group , pretty much any character is allowed for environment variable name except equals. However we need to consider compatibility with all utilities as well.

This PR address issue with dot and/or dash characters in environment variable names.

@snallami
Copy link
Member Author

snallami commented Feb 3, 2018

BTW modified regex have below rules.

  1. first characters can be from set [a-zA-Z_]
  2. number (0-9), dot(.) and dash(-) cannot be first character

Copy link

@alexanderrtaylor alexanderrtaylor left a comment

Choose a reason for hiding this comment

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

This works locally for me and solves JENKINS-47321 which was marked as solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants