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

C#: Remove legacy odasa support #8322

Merged
merged 3 commits into from Mar 10, 2022
Merged

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Mar 3, 2022

The following environment variables are no longer supported:

ODASA_BUILD_ERROR_DIR
ODASA_CSHARP_LAYOUT
ODASA_SNAPSHOT
SEMMLE_DIST
SEMMLE_EXTRACTOR_OPTIONS
SEMMLE_PLATFORM_TOOLS
SEMMLE_PRESERVE_SYMLINKS
SOURCE_ARCHIVE
TRAP_FOLDER

@github-actions github-actions bot added the C# label Mar 3, 2022
@hvitved hvitved force-pushed the csharp/remove-odasa-legacy branch from 9add5e8 to dd5bd37 Mar 7, 2022
@hvitved hvitved marked this pull request as ready for review Mar 7, 2022
@hvitved hvitved requested a review from as a code owner Mar 7, 2022
michaelnebel
michaelnebel previously approved these changes Mar 7, 2022
Copy link
Contributor

@michaelnebel michaelnebel left a comment

LGTM. Very nice with some cleanup.
Have added a couple of comments. Nothing that should block a merge.


SourceArchiveDir =
Actions.GetEnvironmentVariable($"CODEQL_EXTRACTOR_{this.Options.Language.UpperCaseName}_SOURCE_ARCHIVE_DIR") ??
Actions.GetEnvironmentVariable("SOURCE_ARCHIVE") ??
throw new InvalidEnvironmentException($"The environment variable CODEQL_EXTRACTOR_{this.Options.Language.UpperCaseName}_SOURCE_ARCHIVE_DIR or SOURCE_ARCHIVE has not been set.");
Copy link
Contributor

@michaelnebel michaelnebel Mar 7, 2022

Choose a reason for hiding this comment

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

SOURCE_ARCHIVE needs to be removed from exception message.

Copy link
Contributor Author

@hvitved hvitved Mar 9, 2022

Choose a reason for hiding this comment

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

Good spot.

@@ -70,7 +70,7 @@ public BuildCommand(string exe, string? argumentsOpt, bool silent, string? worki
this.environment = environment;
}

public override string ToString() => exe + " " + arguments;
public override string ToString() => arguments.Length > 0 ? exe + " " + arguments : exe;
Copy link
Contributor

@michaelnebel michaelnebel Mar 7, 2022

Choose a reason for hiding this comment

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

Maybe use !string.IsNullOrEmpty.

Copy link
Contributor Author

@hvitved hvitved Mar 9, 2022

Choose a reason for hiding this comment

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

arguments cannot be null (we are using C# 8 nullable reference types), so we only need the emptiness check.

Copy link
Contributor

@michaelnebel michaelnebel Mar 9, 2022

Choose a reason for hiding this comment

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

Yes, let's keep it as it is :-)

hvitved added 3 commits Mar 9, 2022
The following environment variables are no longer supported:

```
ODASA_BUILD_ERROR_DIR
ODASA_CSHARP_LAYOUT
ODASA_SNAPSHOT
SEMMLE_DIST
SEMMLE_EXTRACTOR_OPTIONS
SEMMLE_PLATFORM_TOOLS
SEMMLE_PRESERVE_SYMLINKS
SOURCE_ARCHIVE
TRAP_FOLDER
```
@hvitved hvitved force-pushed the csharp/remove-odasa-legacy branch from 12369d8 to 7f0fa15 Mar 9, 2022
@hvitved
Copy link
Contributor Author

@hvitved hvitved commented Mar 9, 2022

Rebased to resolve merge conflict.

Copy link
Contributor

@michaelnebel michaelnebel left a comment

Very nice!

@hvitved hvitved merged commit 5b97458 into github:main Mar 10, 2022
18 checks passed
@hvitved hvitved deleted the csharp/remove-odasa-legacy branch Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants