Skip to content

Commit

Permalink
[bot] Update dist directory
Browse files Browse the repository at this point in the history
  • Loading branch information
bigdaz authored and github-actions[bot] committed Apr 18, 2024
1 parent c198d84 commit 750cdda
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 47 deletions.
36 changes: 22 additions & 14 deletions dist/dependency-submission/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144345,6 +144345,9 @@ class DependencyGraphConfig {
getJobCorrelator() {
return DependencyGraphConfig.constructJobCorrelator(github.context.workflow, github.context.job, getJobMatrix());
}
getReportDirectory() {
return path_1.default.resolve(getWorkspaceDirectory(), 'dependency-graph-reports');
}
static constructJobCorrelator(workflow, jobId, matrixJson) {
const matrixString = this.describeMatrix(matrixJson);
const label = matrixString ? `${workflow}-${jobId}-${matrixString}` : `${workflow}-${jobId}`;
Expand Down Expand Up @@ -144694,7 +144697,7 @@ async function setup(config) {
maybeExportVariable('GITHUB_DEPENDENCY_GRAPH_REF', github.context.ref);
maybeExportVariable('GITHUB_DEPENDENCY_GRAPH_SHA', getShaFromContext());
maybeExportVariable('GITHUB_DEPENDENCY_GRAPH_WORKSPACE', (0, configuration_1.getWorkspaceDirectory)());
maybeExportVariable('DEPENDENCY_GRAPH_REPORT_DIR', path.resolve((0, configuration_1.getWorkspaceDirectory)(), 'dependency-graph-reports'));
maybeExportVariable('DEPENDENCY_GRAPH_REPORT_DIR', config.getReportDirectory());
if (option === configuration_1.DependencyGraphOption.Clear) {
core.exportVariable('DEPENDENCY_GRAPH_INCLUDE_PROJECTS', '');
core.exportVariable('DEPENDENCY_GRAPH_INCLUDE_CONFIGURATIONS', '');
Expand All @@ -144716,22 +144719,22 @@ async function complete(config) {
return;
case configuration_1.DependencyGraphOption.GenerateAndSubmit:
case configuration_1.DependencyGraphOption.Clear:
await submitDependencyGraphs(await findGeneratedDependencyGraphFiles());
await submitDependencyGraphs(await findDependencyGraphFiles());
return;
case configuration_1.DependencyGraphOption.GenerateAndUpload:
await uploadDependencyGraphs(await findGeneratedDependencyGraphFiles(), config);
await uploadDependencyGraphs(await findDependencyGraphFiles(), config);
}
}
catch (e) {
warnOrFail(config, option, e);
}
}
exports.complete = complete;
async function findGeneratedDependencyGraphFiles() {
const workspaceDirectory = (0, configuration_1.getWorkspaceDirectory)();
return await findDependencyGraphFiles(workspaceDirectory);
}
async function uploadDependencyGraphs(dependencyGraphFiles, config) {
if (dependencyGraphFiles.length === 0) {
core.info('No dependency graph files found to upload.');
return;
}
if (isRunningInActEnvironment()) {
core.info('Dependency graph upload not supported in the ACT environment.');
core.info(`Would upload: ${dependencyGraphFiles.join(', ')}`);
Expand Down Expand Up @@ -144761,6 +144764,10 @@ async function downloadAndSubmitDependencyGraphs(config) {
}
}
async function submitDependencyGraphs(dependencyGraphFiles) {
if (dependencyGraphFiles.length === 0) {
core.info('No dependency graph files found to submit.');
return;
}
if (isRunningInActEnvironment()) {
core.info('Dependency graph submit not supported in the ACT environment.');
core.info(`Would submit: ${dependencyGraphFiles.join(', ')}`);
Expand Down Expand Up @@ -144802,7 +144809,6 @@ async function submitDependencyGraphFile(jsonFile) {
core.notice(`Submitted ${relativeJsonFile}: ${response.data.message}`);
}
async function downloadDependencyGraphs() {
const workspaceDirectory = (0, configuration_1.getWorkspaceDirectory)();
const findBy = github.context.payload.workflow_run
? {
token: (0, configuration_1.getGithubToken)(),
Expand All @@ -144812,27 +144818,29 @@ async function downloadDependencyGraphs() {
}
: undefined;
const artifactClient = new artifact_1.DefaultArtifactClient();
const downloadPath = path.resolve(workspaceDirectory, 'dependency-graph');
const dependencyGraphArtifacts = (await artifactClient.listArtifacts({
latest: true,
findBy
})).artifacts.filter(candidate => candidate.name.startsWith(DEPENDENCY_GRAPH_PREFIX));
})).artifacts.filter(artifact => artifact.name.startsWith(DEPENDENCY_GRAPH_PREFIX));
for (const artifact of dependencyGraphArtifacts) {
const downloadedArtifact = await artifactClient.downloadArtifact(artifact.id, {
path: downloadPath,
findBy
});
core.info(`Downloading dependency-graph artifact ${artifact.name} to ${downloadedArtifact.downloadPath}`);
}
return findDependencyGraphFiles(downloadPath);
return findDependencyGraphFiles();
}
async function findDependencyGraphFiles(dir) {
const globber = await glob.create(`${dir}/dependency-graph-reports/*.json`);
async function findDependencyGraphFiles() {
const globber = await glob.create(`${getReportDirectory()}/**/*.json`);
const allFiles = await globber.glob();
const unprocessedFiles = allFiles.filter(file => !isProcessed(file));
unprocessedFiles.forEach(markProcessed);
core.info(`Found dependency graph files: ${unprocessedFiles.join(', ')}`);
return unprocessedFiles;
}
function getReportDirectory() {
return process.env.DEPENDENCY_GRAPH_REPORT_DIR;
}
function isProcessed(dependencyGraphFile) {
const markerFile = `${dependencyGraphFile}.processed`;
return fs_1.default.existsSync(markerFile);
Expand Down
2 changes: 1 addition & 1 deletion dist/dependency-submission/main/index.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/dependency-submission/post/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95773,6 +95773,9 @@ class DependencyGraphConfig {
getJobCorrelator() {
return DependencyGraphConfig.constructJobCorrelator(github.context.workflow, github.context.job, getJobMatrix());
}
getReportDirectory() {
return path_1.default.resolve(getWorkspaceDirectory(), 'dependency-graph-reports');
}
static constructJobCorrelator(workflow, jobId, matrixJson) {
const matrixString = this.describeMatrix(matrixJson);
const label = matrixString ? `${workflow}-${jobId}-${matrixString}` : `${workflow}-${jobId}`;
Expand Down
2 changes: 1 addition & 1 deletion dist/dependency-submission/post/index.js.map

Large diffs are not rendered by default.

36 changes: 22 additions & 14 deletions dist/setup-gradle/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144345,6 +144345,9 @@ class DependencyGraphConfig {
getJobCorrelator() {
return DependencyGraphConfig.constructJobCorrelator(github.context.workflow, github.context.job, getJobMatrix());
}
getReportDirectory() {
return path_1.default.resolve(getWorkspaceDirectory(), 'dependency-graph-reports');
}
static constructJobCorrelator(workflow, jobId, matrixJson) {
const matrixString = this.describeMatrix(matrixJson);
const label = matrixString ? `${workflow}-${jobId}-${matrixString}` : `${workflow}-${jobId}`;
Expand Down Expand Up @@ -144694,7 +144697,7 @@ async function setup(config) {
maybeExportVariable('GITHUB_DEPENDENCY_GRAPH_REF', github.context.ref);
maybeExportVariable('GITHUB_DEPENDENCY_GRAPH_SHA', getShaFromContext());
maybeExportVariable('GITHUB_DEPENDENCY_GRAPH_WORKSPACE', (0, configuration_1.getWorkspaceDirectory)());
maybeExportVariable('DEPENDENCY_GRAPH_REPORT_DIR', path.resolve((0, configuration_1.getWorkspaceDirectory)(), 'dependency-graph-reports'));
maybeExportVariable('DEPENDENCY_GRAPH_REPORT_DIR', config.getReportDirectory());
if (option === configuration_1.DependencyGraphOption.Clear) {
core.exportVariable('DEPENDENCY_GRAPH_INCLUDE_PROJECTS', '');
core.exportVariable('DEPENDENCY_GRAPH_INCLUDE_CONFIGURATIONS', '');
Expand All @@ -144716,22 +144719,22 @@ async function complete(config) {
return;
case configuration_1.DependencyGraphOption.GenerateAndSubmit:
case configuration_1.DependencyGraphOption.Clear:
await submitDependencyGraphs(await findGeneratedDependencyGraphFiles());
await submitDependencyGraphs(await findDependencyGraphFiles());
return;
case configuration_1.DependencyGraphOption.GenerateAndUpload:
await uploadDependencyGraphs(await findGeneratedDependencyGraphFiles(), config);
await uploadDependencyGraphs(await findDependencyGraphFiles(), config);
}
}
catch (e) {
warnOrFail(config, option, e);
}
}
exports.complete = complete;
async function findGeneratedDependencyGraphFiles() {
const workspaceDirectory = (0, configuration_1.getWorkspaceDirectory)();
return await findDependencyGraphFiles(workspaceDirectory);
}
async function uploadDependencyGraphs(dependencyGraphFiles, config) {
if (dependencyGraphFiles.length === 0) {
core.info('No dependency graph files found to upload.');
return;
}
if (isRunningInActEnvironment()) {
core.info('Dependency graph upload not supported in the ACT environment.');
core.info(`Would upload: ${dependencyGraphFiles.join(', ')}`);
Expand Down Expand Up @@ -144761,6 +144764,10 @@ async function downloadAndSubmitDependencyGraphs(config) {
}
}
async function submitDependencyGraphs(dependencyGraphFiles) {
if (dependencyGraphFiles.length === 0) {
core.info('No dependency graph files found to submit.');
return;
}
if (isRunningInActEnvironment()) {
core.info('Dependency graph submit not supported in the ACT environment.');
core.info(`Would submit: ${dependencyGraphFiles.join(', ')}`);
Expand Down Expand Up @@ -144802,7 +144809,6 @@ async function submitDependencyGraphFile(jsonFile) {
core.notice(`Submitted ${relativeJsonFile}: ${response.data.message}`);
}
async function downloadDependencyGraphs() {
const workspaceDirectory = (0, configuration_1.getWorkspaceDirectory)();
const findBy = github.context.payload.workflow_run
? {
token: (0, configuration_1.getGithubToken)(),
Expand All @@ -144812,27 +144818,29 @@ async function downloadDependencyGraphs() {
}
: undefined;
const artifactClient = new artifact_1.DefaultArtifactClient();
const downloadPath = path.resolve(workspaceDirectory, 'dependency-graph');
const dependencyGraphArtifacts = (await artifactClient.listArtifacts({
latest: true,
findBy
})).artifacts.filter(candidate => candidate.name.startsWith(DEPENDENCY_GRAPH_PREFIX));
})).artifacts.filter(artifact => artifact.name.startsWith(DEPENDENCY_GRAPH_PREFIX));
for (const artifact of dependencyGraphArtifacts) {
const downloadedArtifact = await artifactClient.downloadArtifact(artifact.id, {
path: downloadPath,
findBy
});
core.info(`Downloading dependency-graph artifact ${artifact.name} to ${downloadedArtifact.downloadPath}`);
}
return findDependencyGraphFiles(downloadPath);
return findDependencyGraphFiles();
}
async function findDependencyGraphFiles(dir) {
const globber = await glob.create(`${dir}/dependency-graph-reports/*.json`);
async function findDependencyGraphFiles() {
const globber = await glob.create(`${getReportDirectory()}/**/*.json`);
const allFiles = await globber.glob();
const unprocessedFiles = allFiles.filter(file => !isProcessed(file));
unprocessedFiles.forEach(markProcessed);
core.info(`Found dependency graph files: ${unprocessedFiles.join(', ')}`);
return unprocessedFiles;
}
function getReportDirectory() {
return process.env.DEPENDENCY_GRAPH_REPORT_DIR;
}
function isProcessed(dependencyGraphFile) {
const markerFile = `${dependencyGraphFile}.processed`;
return fs_1.default.existsSync(markerFile);
Expand Down
2 changes: 1 addition & 1 deletion dist/setup-gradle/main/index.js.map

Large diffs are not rendered by default.

36 changes: 22 additions & 14 deletions dist/setup-gradle/post/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141798,6 +141798,9 @@ class DependencyGraphConfig {
getJobCorrelator() {
return DependencyGraphConfig.constructJobCorrelator(github.context.workflow, github.context.job, getJobMatrix());
}
getReportDirectory() {
return path_1.default.resolve(getWorkspaceDirectory(), 'dependency-graph-reports');
}
static constructJobCorrelator(workflow, jobId, matrixJson) {
const matrixString = this.describeMatrix(matrixJson);
const label = matrixString ? `${workflow}-${jobId}-${matrixString}` : `${workflow}-${jobId}`;
Expand Down Expand Up @@ -142147,7 +142150,7 @@ async function setup(config) {
maybeExportVariable('GITHUB_DEPENDENCY_GRAPH_REF', github.context.ref);
maybeExportVariable('GITHUB_DEPENDENCY_GRAPH_SHA', getShaFromContext());
maybeExportVariable('GITHUB_DEPENDENCY_GRAPH_WORKSPACE', (0, configuration_1.getWorkspaceDirectory)());
maybeExportVariable('DEPENDENCY_GRAPH_REPORT_DIR', path.resolve((0, configuration_1.getWorkspaceDirectory)(), 'dependency-graph-reports'));
maybeExportVariable('DEPENDENCY_GRAPH_REPORT_DIR', config.getReportDirectory());
if (option === configuration_1.DependencyGraphOption.Clear) {
core.exportVariable('DEPENDENCY_GRAPH_INCLUDE_PROJECTS', '');
core.exportVariable('DEPENDENCY_GRAPH_INCLUDE_CONFIGURATIONS', '');
Expand All @@ -142169,22 +142172,22 @@ async function complete(config) {
return;
case configuration_1.DependencyGraphOption.GenerateAndSubmit:
case configuration_1.DependencyGraphOption.Clear:
await submitDependencyGraphs(await findGeneratedDependencyGraphFiles());
await submitDependencyGraphs(await findDependencyGraphFiles());
return;
case configuration_1.DependencyGraphOption.GenerateAndUpload:
await uploadDependencyGraphs(await findGeneratedDependencyGraphFiles(), config);
await uploadDependencyGraphs(await findDependencyGraphFiles(), config);
}
}
catch (e) {
warnOrFail(config, option, e);
}
}
exports.complete = complete;
async function findGeneratedDependencyGraphFiles() {
const workspaceDirectory = (0, configuration_1.getWorkspaceDirectory)();
return await findDependencyGraphFiles(workspaceDirectory);
}
async function uploadDependencyGraphs(dependencyGraphFiles, config) {
if (dependencyGraphFiles.length === 0) {
core.info('No dependency graph files found to upload.');
return;
}
if (isRunningInActEnvironment()) {
core.info('Dependency graph upload not supported in the ACT environment.');
core.info(`Would upload: ${dependencyGraphFiles.join(', ')}`);
Expand Down Expand Up @@ -142214,6 +142217,10 @@ async function downloadAndSubmitDependencyGraphs(config) {
}
}
async function submitDependencyGraphs(dependencyGraphFiles) {
if (dependencyGraphFiles.length === 0) {
core.info('No dependency graph files found to submit.');
return;
}
if (isRunningInActEnvironment()) {
core.info('Dependency graph submit not supported in the ACT environment.');
core.info(`Would submit: ${dependencyGraphFiles.join(', ')}`);
Expand Down Expand Up @@ -142255,7 +142262,6 @@ async function submitDependencyGraphFile(jsonFile) {
core.notice(`Submitted ${relativeJsonFile}: ${response.data.message}`);
}
async function downloadDependencyGraphs() {
const workspaceDirectory = (0, configuration_1.getWorkspaceDirectory)();
const findBy = github.context.payload.workflow_run
? {
token: (0, configuration_1.getGithubToken)(),
Expand All @@ -142265,27 +142271,29 @@ async function downloadDependencyGraphs() {
}
: undefined;
const artifactClient = new artifact_1.DefaultArtifactClient();
const downloadPath = path.resolve(workspaceDirectory, 'dependency-graph');
const dependencyGraphArtifacts = (await artifactClient.listArtifacts({
latest: true,
findBy
})).artifacts.filter(candidate => candidate.name.startsWith(DEPENDENCY_GRAPH_PREFIX));
})).artifacts.filter(artifact => artifact.name.startsWith(DEPENDENCY_GRAPH_PREFIX));
for (const artifact of dependencyGraphArtifacts) {
const downloadedArtifact = await artifactClient.downloadArtifact(artifact.id, {
path: downloadPath,
findBy
});
core.info(`Downloading dependency-graph artifact ${artifact.name} to ${downloadedArtifact.downloadPath}`);
}
return findDependencyGraphFiles(downloadPath);
return findDependencyGraphFiles();
}
async function findDependencyGraphFiles(dir) {
const globber = await glob.create(`${dir}/dependency-graph-reports/*.json`);
async function findDependencyGraphFiles() {
const globber = await glob.create(`${getReportDirectory()}/**/*.json`);
const allFiles = await globber.glob();
const unprocessedFiles = allFiles.filter(file => !isProcessed(file));
unprocessedFiles.forEach(markProcessed);
core.info(`Found dependency graph files: ${unprocessedFiles.join(', ')}`);
return unprocessedFiles;
}
function getReportDirectory() {
return process.env.DEPENDENCY_GRAPH_REPORT_DIR;
}
function isProcessed(dependencyGraphFile) {
const markerFile = `${dependencyGraphFile}.processed`;
return fs_1.default.existsSync(markerFile);
Expand Down
2 changes: 1 addition & 1 deletion dist/setup-gradle/post/index.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/wrapper-validation/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89925,6 +89925,9 @@ class DependencyGraphConfig {
getJobCorrelator() {
return DependencyGraphConfig.constructJobCorrelator(github.context.workflow, github.context.job, getJobMatrix());
}
getReportDirectory() {
return path_1.default.resolve(getWorkspaceDirectory(), 'dependency-graph-reports');
}
static constructJobCorrelator(workflow, jobId, matrixJson) {
const matrixString = this.describeMatrix(matrixJson);
const label = matrixString ? `${workflow}-${jobId}-${matrixString}` : `${workflow}-${jobId}`;
Expand Down
2 changes: 1 addition & 1 deletion dist/wrapper-validation/main/index.js.map

Large diffs are not rendered by default.

0 comments on commit 750cdda

Please sign in to comment.