-
Notifications
You must be signed in to change notification settings - Fork 0
chore: sync workflow templates #323
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -1023,6 +1023,10 @@ function resolveExplicitNonIssueWorkflowSourceContext(pr = {}) { | |||||||
| }; | ||||||||
| } | ||||||||
|
|
||||||||
| function resolveNonIssueWorkflowSourceContextForBodySync(pr = {}, issueNumber = null) { | ||||||||
| return issueNumber ? null : resolveExplicitNonIssueWorkflowSourceContext(pr); | ||||||||
| } | ||||||||
|
|
||||||||
| async function resolveSourceContextRepairComment({ | ||||||||
| github, | ||||||||
| owner, | ||||||||
|
|
@@ -1356,7 +1360,9 @@ async function run({github: rawGithub, context, core, inputs}) { | |||||||
| return; | ||||||||
| } | ||||||||
|
|
||||||||
| const explicitNonIssueSourceContext = resolveExplicitNonIssueWorkflowSourceContext(pr); | ||||||||
| const issueNumber = extractIssueNumberFromPull(pr); | ||||||||
| const sourceContext = resolvePrSourceContext(pr); | ||||||||
| const explicitNonIssueSourceContext = resolveNonIssueWorkflowSourceContextForBodySync(pr, issueNumber); | ||||||||
| if (explicitNonIssueSourceContext) { | ||||||||
| core.info( | ||||||||
| `PR #${pr.number} has explicit non-issue workflow source context (${formatSourceContextForLog(explicitNonIssueSourceContext)}); skipping issue-sourced body sync.`, | ||||||||
|
|
@@ -1382,8 +1388,6 @@ async function run({github: rawGithub, context, core, inputs}) { | |||||||
| return; | ||||||||
| } | ||||||||
|
|
||||||||
| const issueNumber = extractIssueNumberFromPull(pr); | ||||||||
| const sourceContext = resolvePrSourceContext(pr); | ||||||||
| if (!issueNumber) { | ||||||||
| if (sourceContext.isValid && !sourceContext.requiresIssue) { | ||||||||
| core.info( | ||||||||
|
|
@@ -1454,6 +1458,25 @@ async function run({github: rawGithub, context, core, inputs}) { | |||||||
| return; | ||||||||
| } | ||||||||
|
|
||||||||
| try { | ||||||||
| const comments = await github.paginate(github.rest.issues.listComments, { | ||||||||
| owner, | ||||||||
| repo, | ||||||||
| issue_number: pr.number, | ||||||||
| }); | ||||||||
| await resolveSourceContextRepairComment({ | ||||||||
| github, | ||||||||
| owner, | ||||||||
| repo, | ||||||||
| prNumber: pr.number, | ||||||||
| comments, | ||||||||
| sourceContext, | ||||||||
| core, | ||||||||
| }); | ||||||||
| } catch (error) { | ||||||||
| core.warning(`Failed to resolve workflow source repair comment: ${error.message}`); | ||||||||
|
||||||||
| core.warning(`Failed to resolve workflow source repair comment: ${error.message}`); | |
| const errorMessage = error instanceof Error ? error.message : String(error); | |
| core.warning(`Failed to resolve workflow source repair comment: ${errorMessage}`); |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1088,13 +1088,21 @@ def _artifact_selection_contract(selection: dict[str, Any], selection_path: Path | |||||
| for item in statuses | ||||||
| if item["status"] == "missing" or item["selected_count"] <= 0 | ||||||
| ] | ||||||
| missing_priority_families = selection.get("missing_priority_families") | ||||||
| if isinstance(missing_priority_families, (list, tuple)): | ||||||
| missing_priority_families = [ | ||||||
| str(family) for family in missing_priority_families if isinstance(family, str) | ||||||
|
||||||
| str(family) for family in missing_priority_families if isinstance(family, str) | |
| family for family in missing_priority_families if isinstance(family, str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolvePrSourceContext(pr)now exposesnoAutomation, but this workflow still proceeds with issue-sourced body sync even when the PR opts out of automation (e.g., "Do not automate" in the template orworkflow:no-automationlabel). Add an early guard to skip PR body updates whensourceContext.noAutomationis true (and decide whether to still upsert/resolve the repair comment).