Skip to content

Commit c1cf24f

Browse files
committed
Limit OverlayAnalysis to internal repos
1 parent 55046b8 commit c1cf24f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/config-utils.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,7 @@ const calculateAugmentationMacro = test.macro({
815815
const actualAugmentationProperties =
816816
await configUtils.calculateAugmentation(
817817
getCachedCodeQL(),
818+
{ owner: "github", repo: "repo" },
818819
createFeatures([]),
819820
rawPacksInput,
820821
rawQueriesInput,
@@ -946,6 +947,7 @@ const calculateAugmentationErrorMacro = test.macro({
946947
() =>
947948
configUtils.calculateAugmentation(
948949
getCachedCodeQL(),
950+
{ owner: "github", repo: "repo" },
949951
createFeatures([]),
950952
rawPacksInput,
951953
rawQueriesInput,

src/config-utils.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ export async function getDefaultConfig({
507507

508508
const augmentationProperties = await calculateAugmentation(
509509
codeql,
510+
repository,
510511
features,
511512
packsInput,
512513
queriesInput,
@@ -621,6 +622,7 @@ async function loadConfig({
621622

622623
const augmentationProperties = await calculateAugmentation(
623624
codeql,
625+
repository,
624626
features,
625627
packsInput,
626628
queriesInput,
@@ -664,6 +666,7 @@ async function loadConfig({
664666
* the config file sent to the CLI.
665667
*
666668
* @param codeql The CodeQL object.
669+
* @param repository The repository to analyze.
667670
* @param features The feature enablement object.
668671
* @param rawPacksInput The packs input from the action configuration.
669672
* @param rawQueriesInput The queries input from the action configuration.
@@ -682,6 +685,7 @@ async function loadConfig({
682685
// exported for testing.
683686
export async function calculateAugmentation(
684687
codeql: CodeQL,
688+
repository: RepositoryNwo,
685689
features: FeatureEnablement,
686690
rawPacksInput: string | undefined,
687691
rawQueriesInput: string | undefined,
@@ -705,6 +709,7 @@ export async function calculateAugmentation(
705709
const { overlayDatabaseMode, useOverlayDatabaseCaching } =
706710
await getOverlayDatabaseMode(
707711
codeql,
712+
repository,
708713
features,
709714
sourceRoot,
710715
buildMode,
@@ -785,6 +790,7 @@ function parseQueriesFromInput(
785790
*/
786791
async function getOverlayDatabaseMode(
787792
codeql: CodeQL,
793+
repository: RepositoryNwo,
788794
features: FeatureEnablement,
789795
sourceRoot: string,
790796
buildMode: BuildMode | undefined,
@@ -809,7 +815,10 @@ async function getOverlayDatabaseMode(
809815
`Setting overlay database mode to ${overlayDatabaseMode} ` +
810816
"from the CODEQL_OVERLAY_DATABASE_MODE environment variable.",
811817
);
812-
} else if (await features.getValue(Feature.OverlayAnalysis, codeql)) {
818+
} else if (
819+
repository.owner in ["github", "dsp-testing"] &&
820+
(await features.getValue(Feature.OverlayAnalysis, codeql))
821+
) {
813822
if (isAnalyzingPullRequest()) {
814823
overlayDatabaseMode = OverlayDatabaseMode.Overlay;
815824
useOverlayDatabaseCaching = true;

0 commit comments

Comments
 (0)