Compare commits

...

5 Commits

Author SHA1 Message Date
Asger F
30096f3a94 Revert "JS: Add compileForOverlayEval"
This reverts commit 39f74d808b.
2025-11-04 15:11:50 +01:00
Asger F
9bed94856d Revert "JS: Recursively delete source archive so emptiness detection works"
This reverts commit 0acfacefbf.
2025-11-04 15:11:48 +01:00
Asger F
41f9208357 Revert "Actions: dont fail if no JS/TS code was found"
This reverts commit c4d23d16ed.
2025-11-04 15:11:47 +01:00
Asger F
4988b801e0 Revert "Update javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java"
This reverts commit 105213df03.
2025-11-04 15:11:45 +01:00
Asger F
be2818b1f9 Revert "JS: Fix check to account for override in tests"
This reverts commit 81bb07a7ba.
2025-11-04 15:11:43 +01:00
3 changed files with 6 additions and 16 deletions

View File

@@ -489,23 +489,21 @@ public class AutoBuild {
diagnosticsToClose.forEach(DiagnosticWriter::close);
}
// Fail extraction if no relevant files were found.
boolean seenRelevantFiles = EnvironmentVariables.isActionsExtractor()
? seenFiles // assume all files are relevant for Actions extractor
: hasSeenCode();
if (!seenRelevantFiles) {
if (!hasSeenCode()) {
if (seenFiles) {
warn("Only found JavaScript or TypeScript files that were empty or contained syntax errors.");
} else {
warn("No JavaScript or TypeScript code found.");
}
// Ensuring that the finalize steps detects that no code was seen.
// This is necessary to ensure we don't produce an overlay-base database without externs.
// ensuring that the finalize steps detects that no code was seen.
Path srcFolder = Paths.get(EnvironmentVariables.getWipDatabase(), "src");
try {
FileUtil8.recursiveDelete(srcFolder);
// Non-recursive delete because "src/" should be empty.
FileUtil8.delete(srcFolder);
} catch (NoSuchFileException e) {
Exceptions.ignore(e, "the directory did not exist");
} catch (DirectoryNotEmptyException e) {
Exceptions.ignore(e, "just leave the directory if it is not empty");
}
return 0;
}

View File

@@ -18,9 +18,6 @@ public class EnvironmentVariables {
public static final String CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE_ENV_VAR =
"CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE";
public static final String CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE_ENV_VAR =
"CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE";
public static final String CODEQL_DIST_ENV_VAR = "CODEQL_DIST";
/**
@@ -97,8 +94,4 @@ public class EnvironmentVariables {
public static String getWipDatabase() {
return Env.systemEnv().getNonEmpty(CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE_ENV_VAR);
}
public static boolean isActionsExtractor() {
return Env.systemEnv().getNonEmpty(CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE_ENV_VAR) != null;
}
}

View File

@@ -23,4 +23,3 @@ dataExtensions:
- semmle/javascript/security/domains/**/*.model.yml
- ext/*.model.yml
warnOnImplicitThis: true
compileForOverlayEval: true