mirror of
https://github.com/github/awesome-copilot.git
synced 2026-10-12 23:04:14 +00:00
Publish full external plugin quality gate logs (#3668)
* fix(external-plugins): publish full quality gate logs Upload full external plugin quality gate output as workflow artifacts and link those artifacts from PR and intake comments. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Limit safeName length to 64 characters Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot App
Copilot Autofix powered by AI
parent
1874d1b88b
commit
a89cd67e19
@@ -767,6 +767,7 @@ jobs:
|
||||
BASE_RESULT_JSON: ${{ needs.rerun-intake-parse.outputs.base-result }}
|
||||
BASE_VALID: ${{ needs.rerun-intake-parse.outputs.valid }}
|
||||
QUALITY_RESULT_JSON: ${{ needs.rerun-intake-quality-gates.outputs.quality-result }}
|
||||
QUALITY_LOG_URL: ${{ needs.rerun-intake-quality-gates.outputs.quality-log-url }}
|
||||
QUALITY_JOB_RESULT: ${{ needs.rerun-intake-quality-gates.result }}
|
||||
ISSUE_STATE: ${{ needs.rerun-intake-parse.outputs.issue-state }}
|
||||
ISSUE_LABELS: ${{ needs.rerun-intake-parse.outputs.issue-labels }}
|
||||
@@ -809,7 +810,14 @@ jobs:
|
||||
};
|
||||
}
|
||||
|
||||
finalResult = intake.applyQualityGateResult(baseResult, qualityResult, context.runId, context.repo.owner, context.repo.repo);
|
||||
finalResult = intake.applyQualityGateResult(
|
||||
baseResult,
|
||||
qualityResult,
|
||||
context.runId,
|
||||
context.repo.owner,
|
||||
context.repo.repo,
|
||||
process.env.QUALITY_LOG_URL
|
||||
);
|
||||
}
|
||||
|
||||
await intakeState.applyExternalPluginIntakeEvaluation({
|
||||
|
||||
@@ -94,6 +94,7 @@ jobs:
|
||||
BASE_RESULT_JSON: ${{ needs.evaluate-submission.outputs.evaluation }}
|
||||
BASE_VALID: ${{ needs.evaluate-submission.outputs.valid }}
|
||||
QUALITY_RESULT_JSON: ${{ needs.quality-gates.outputs.quality-result }}
|
||||
QUALITY_LOG_URL: ${{ needs.quality-gates.outputs.quality-log-url }}
|
||||
QUALITY_JOB_RESULT: ${{ needs.quality-gates.result }}
|
||||
ISSUE_STATE: ${{ needs.evaluate-submission.outputs.issue-state }}
|
||||
ISSUE_LABELS: ${{ needs.evaluate-submission.outputs.issue-labels }}
|
||||
@@ -136,7 +137,14 @@ jobs:
|
||||
};
|
||||
}
|
||||
|
||||
finalResult = intake.applyQualityGateResult(baseResult, qualityResult, context.runId, context.repo.owner, context.repo.repo);
|
||||
finalResult = intake.applyQualityGateResult(
|
||||
baseResult,
|
||||
qualityResult,
|
||||
context.runId,
|
||||
context.repo.owner,
|
||||
context.repo.repo,
|
||||
process.env.QUALITY_LOG_URL
|
||||
);
|
||||
}
|
||||
|
||||
await intakeState.applyExternalPluginIntakeEvaluation({
|
||||
|
||||
@@ -143,6 +143,18 @@ jobs:
|
||||
|
||||
const intakeState = await import(pathToFileURL(path.join(process.env.GITHUB_WORKSPACE, 'eng', 'external-plugin-intake-state.mjs')).href);
|
||||
const marker = '<!-- external-plugin-pr-quality -->';
|
||||
const artifacts = await github.paginate(github.rest.actions.listWorkflowRunArtifacts, {
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
run_id: workflowRun.id,
|
||||
per_page: 100,
|
||||
});
|
||||
const qualityLogArtifact = artifacts.find((artifact) =>
|
||||
artifact.name === 'external-plugin-pr-quality-logs' && !artifact.expired
|
||||
);
|
||||
const qualityLogUrl = qualityLogArtifact
|
||||
? `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${workflowRun.id}/artifacts/${qualityLogArtifact.id}`
|
||||
: '';
|
||||
const detectJobResult = payload.detect_job_result;
|
||||
const shouldRun = payload.should_run;
|
||||
const changedCount = payload.changed_count;
|
||||
@@ -345,6 +357,7 @@ jobs:
|
||||
'',
|
||||
`- **Changed entries detected:** ${changedCount}`,
|
||||
`- **Workflow state label:** \`${stateLabel}\``,
|
||||
qualityLogUrl ? `- **Full logs:** [Download quality gate artifact](${qualityLogUrl})` : '',
|
||||
'- **Status legend:** ✅ pass · ⚠️ warning · 🛑 fail',
|
||||
'',
|
||||
'### Per-plugin quality summary',
|
||||
|
||||
@@ -117,13 +117,24 @@ jobs:
|
||||
env:
|
||||
CHANGED_PLUGINS_JSON: ${{ needs.detect-changed-plugins.outputs.changed-plugins }}
|
||||
run: |
|
||||
result=$(node ./eng/external-plugin-pr-quality-gates.mjs --plugins-json "$CHANGED_PLUGINS_JSON")
|
||||
result=$(node ./eng/external-plugin-pr-quality-gates.mjs \
|
||||
--plugins-json "$CHANGED_PLUGINS_JSON" \
|
||||
--logs-directory "${RUNNER_TEMP}/external-plugin-pr-quality-logs")
|
||||
{
|
||||
echo 'quality-result<<EOF'
|
||||
echo "$result"
|
||||
echo 'EOF'
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Upload full quality gate logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: external-plugin-pr-quality-logs
|
||||
path: ${{ runner.temp }}/external-plugin-pr-quality-logs
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
|
||||
publish-quality-result:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [detect-changed-plugins, run-quality-gates]
|
||||
|
||||
@@ -11,6 +11,9 @@ on:
|
||||
quality-result:
|
||||
description: JSON result for quality checks
|
||||
value: ${{ jobs.quality.outputs.quality-result }}
|
||||
quality-log-url:
|
||||
description: URL for the full quality gate log artifact
|
||||
value: ${{ jobs.quality.outputs.quality-log-url }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -20,6 +23,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
quality-result: ${{ steps.quality.outputs.quality-result }}
|
||||
quality-log-url: ${{ steps.upload-logs.outputs.artifact-url }}
|
||||
steps:
|
||||
- name: Checkout main branch
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||
@@ -44,9 +48,21 @@ jobs:
|
||||
env:
|
||||
PLUGIN_JSON: ${{ inputs.plugin-json }}
|
||||
run: |
|
||||
result=$(node ./eng/external-plugin-quality-gates.mjs --plugin-json "$PLUGIN_JSON")
|
||||
result=$(node ./eng/external-plugin-quality-gates.mjs \
|
||||
--plugin-json "$PLUGIN_JSON" \
|
||||
--log-file "${RUNNER_TEMP}/external-plugin-quality-logs/quality-gates.log")
|
||||
{
|
||||
echo 'quality-result<<EOF'
|
||||
echo "$result"
|
||||
echo 'EOF'
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Upload full quality gate logs
|
||||
id: upload-logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: external-plugin-quality-logs
|
||||
path: ${{ runner.temp }}/external-plugin-quality-logs
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
|
||||
Reference in New Issue
Block a user