mirror of
https://github.com/github/awesome-copilot.git
synced 2026-05-28 17:41:45 +00:00
47701d25f4
* Add external plugin quality gates and override flow Introduce a dedicated reusable quality-gates workflow for external plugin submissions and wire intake/rerun orchestration to consume its results. Add quality-aware intake state handling, including a submitter-fix blocker state and richer intake comments. Also add a maintainer /mark-ready-for-review command workflow for explicit overrides, update related approval-label handling, and document the new external plugin review flow in CONTRIBUTING and AGENTS guidance. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix: use specific auth/network patterns in classifySmokeFailure Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com> * refactor: hoist INFRA_ERROR_PATTERNS to module level, fix timeout regex Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com> * fix: install Copilot CLI in external-plugin-quality-gates workflow Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
120 lines
4.4 KiB
YAML
120 lines
4.4 KiB
YAML
name: External Plugin Mark Ready Command
|
|
|
|
on:
|
|
issue_comment:
|
|
types: [created]
|
|
|
|
concurrency:
|
|
group: external-plugin-intake-${{ github.event.issue.number }}
|
|
cancel-in-progress: false
|
|
|
|
permissions:
|
|
contents: read
|
|
issues: write
|
|
|
|
jobs:
|
|
mark-ready:
|
|
runs-on: ubuntu-latest
|
|
if: >-
|
|
!github.event.issue.pull_request &&
|
|
startsWith(github.event.comment.body, '/mark-ready-for-review')
|
|
steps:
|
|
- name: Checkout staged branch
|
|
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
|
with:
|
|
ref: staged
|
|
|
|
- name: Apply explicit ready-for-review override
|
|
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0
|
|
with:
|
|
script: |
|
|
const path = require('path');
|
|
const { pathToFileURL } = require('url');
|
|
|
|
const intake = await import(pathToFileURL(path.join(process.env.GITHUB_WORKSPACE, 'eng', 'external-plugin-intake.mjs')).href);
|
|
const intakeState = await import(pathToFileURL(path.join(process.env.GITHUB_WORKSPACE, 'eng', 'external-plugin-intake-state.mjs')).href);
|
|
|
|
const parsed = intake.parseMarkReadyForReviewCommand(context.payload.comment.body);
|
|
if (!parsed) {
|
|
core.info('No supported /mark-ready-for-review command was found.');
|
|
return;
|
|
}
|
|
|
|
const actor = context.payload.comment.user?.login;
|
|
if (!actor || context.payload.comment.user?.type === 'Bot' || actor === 'github-actions[bot]') {
|
|
core.info('Ignoring command from a bot or unknown actor.');
|
|
return;
|
|
}
|
|
|
|
const permission = await github.rest.repos.getCollaboratorPermissionLevel({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
username: actor
|
|
});
|
|
const hasWriteAccess = ['admin', 'write', 'maintain'].includes(permission.data.permission);
|
|
if (!hasWriteAccess) {
|
|
core.info(`Ignoring /mark-ready-for-review because ${actor} does not have write access.`);
|
|
return;
|
|
}
|
|
|
|
const { data: currentIssue } = await github.rest.issues.get({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number
|
|
});
|
|
|
|
const labelNames = new Set((currentIssue.labels || []).map((label) => label.name));
|
|
if (!labelNames.has('external-plugin')) {
|
|
core.info('Ignoring command because issue is not an external plugin submission.');
|
|
return;
|
|
}
|
|
|
|
if (labelNames.has('approved')) {
|
|
core.info('Ignoring command because issue is already approved.');
|
|
return;
|
|
}
|
|
|
|
if (!labelNames.has('requires-submitter-fixes')) {
|
|
core.info('Ignoring command because issue is not currently blocked by submitter-fix gates.');
|
|
return;
|
|
}
|
|
|
|
await intakeState.syncExternalPluginIntakeLabels({
|
|
github,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issueNumber: context.issue.number,
|
|
desiredLabels: new Set(['external-plugin', 'ready-for-review'])
|
|
});
|
|
|
|
const marker = '<!-- external-plugin-mark-ready-override -->';
|
|
const reason = parsed.reason || 'No reason provided.';
|
|
const body = [
|
|
marker,
|
|
'## ✅ External plugin manually moved to ready-for-review',
|
|
'',
|
|
`Maintainer **${actor}** used \`${intake.MARK_READY_FOR_REVIEW_COMMAND}\` to move this submission from \`requires-submitter-fixes\` to \`ready-for-review\`.`,
|
|
'',
|
|
'### Reason',
|
|
'',
|
|
reason
|
|
].join('\n');
|
|
|
|
await intakeState.upsertExternalPluginIntakeComment({
|
|
github,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issueNumber: context.issue.number,
|
|
marker,
|
|
body
|
|
});
|
|
|
|
if (currentIssue.state === 'closed') {
|
|
await github.rest.issues.update({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
state: 'open'
|
|
});
|
|
}
|