-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C#: Autobuilder fixes #609
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
C#: Autobuilder fixes #609
Conversation
This commit fixes a few issues that were identified during the last dist upgrade, and which were introduced/revealed on 836daaf. - Expand environment variables that are passed from `lgtm.yml` to the autobuilder, for example `solution: $LGTM_SRC/mysolution.sln`. - Distinguish between when a build rule is applied automatically and when it is applied manually via `lgtm.yml`. - Catch `FileNotFoundException`s when parsing project files and solution files.
calumgrant
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small things. My main question is whether we should be supporting $ on Windows, or just use $ on all platforms.
| Select(s => AsStringWithExpandedEnvVars(s, actions)).ToArray(); | ||
| } | ||
|
|
||
| static readonly Regex linuxEnvRegEx = new Regex(@"\$([A-Z_][A-Z_0-9]*)", RegexOptions.Compiled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
| Select(s => AsStringWithExpandedEnvVars(s, actions)).ToArray(); | ||
| } | ||
|
|
||
| static readonly Regex linuxEnvRegEx = new Regex(@"\$([A-Z_][A-Z_0-9]*)", RegexOptions.Compiled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps also lowercase letters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
|
|
||
| // `Environment.ExpandEnvironmentVariables` only works with Windows-style | ||
| // environment variables | ||
| var windowsStyle = actions.IsWindows() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably support both expansion styles on all platforms. In particular, the documentation doesn't even mention the Windows-style at all, and users may expect it to work using $ even on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM_SRC is introduced as an environment variable here, so I think we should use the syntax for environment variables on the given platform. In the same way, if LGTM_SRC is used in a build_command, it is interpreted as a command script on Windows, so will have to use %LGTM_SRC% instead of $LGTM_SRC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good argument.
7e999f7 to
1e9fe00
Compare
Go: Add Log Injection query (CWE-117)
This commit fixes a few issues that were identified during the last dist upgrade, and which were introduced/revealed on 836daaf.
lgtm.ymlto the autobuilder, for examplesolution: $LGTM_SRC/mysolution.sln.lgtm.yml.FileNotFoundExceptions when parsing project files and solution files.