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

Feat: allow for exemption of repos from dependency graph integrator #1385

Merged
merged 7 commits into from
Jan 13, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,19 @@ async function sendOneRepoToDepGraphIntegrator(

export function repoIsExempted(
kelvin-chappell marked this conversation as resolved.
Show resolved Hide resolved
repo: Repository,
exceptedCustomProperties: github_repository_custom_properties[],
exemptedCustomProperties: github_repository_custom_properties[],
language: DepGraphLanguage,
): boolean {
const repoIsExcepted = exceptedCustomProperties.find(
const exemptedRepo = exemptedCustomProperties.find(
(property) => repo.id === property.repository_id,
);
tjsilver marked this conversation as resolved.
Show resolved Hide resolved
if (repoIsExcepted) {
if (exemptedRepo && exemptedRepo.value === language) {
tjsilver marked this conversation as resolved.
Show resolved Hide resolved
logger.log({
message: `${repo.name} is excepted from dependency graph integration`,
numExceptedCustomProperties: exceptedCustomProperties.length,
message: `${repo.name} is exempted from dependency graph integration for ${language}`,
numexemptedCustomProperties: exemptedCustomProperties.length,
});
}
return repoIsExcepted !== undefined;
return exemptedRepo !== undefined;
}

export function getSuitableReposWithoutWorkflows(
Expand All @@ -155,7 +156,9 @@ export function getSuitableReposWithoutWorkflows(
);

return reposWithDepGraphLanguages
.filter((repo) => !repoIsExempted(repo, exemptedCustomProperties))
.filter(
(repo) => !repoIsExempted(repo, exemptedCustomProperties, language),
)
.filter((repo) => {
const workflowUsagesForRepo = productionWorkflowUsages.filter(
(workflow) => workflow.full_name === repo.full_name,
Expand Down
Loading