Skip to content

misc fixes#4

Open
nashif wants to merge 1 commit intozephyrproject-rtos:mainfrom
nashif:topic/no_member
Open

misc fixes#4
nashif wants to merge 1 commit intozephyrproject-rtos:mainfrom
nashif:topic/no_member

Conversation

@nashif
Copy link
Copy Markdown
Member

@nashif nashif commented Apr 8, 2026

  • fix: if author is not assignable, the issue is still created
  • append original body of PR

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the backport GitHub Action to (1) include the original PR body in generated backport PRs and (2) ensure a failure issue is still created even when the original author cannot be assigned.

Changes:

  • Append the original PR body (with a header) to the generated backport PR body.
  • Add a fallback when issue creation with assignees: [author] fails, retrying issue creation unassigned.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

src/backport.ts Outdated
Comment on lines +298 to +308
const templatedBody = getBody({
base,
body: originalBody ?? "",
mergeCommitSha: commitToBackport,
number,
});
const body = originalBody
? `${templatedBody}\n\n---\n\n### Original PR body (#${String(
number,
)})\n\n${originalBody}`
: templatedBody;
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

originalBody is still passed into the body_template as the body variable, and then the original PR body is appended again afterwards. If a user’s body_template already includes <%= body %> (which is explicitly documented in action.yml), the backport PR body will contain the original text twice. Consider either (a) appending only when the template does not already include the body, or (b) introducing a new input/flag to control appending so existing templates aren’t affected.

Copilot uses AI. Check for mistakes.
Comment on lines +355 to +365
try {
await github.rest.issues.create({
...issuePayload,
assignees: [author],
});
} catch {
warning(
`Could not assign issue to ${author}; creating unassigned issue instead.`,
);
await github.rest.issues.create(issuePayload);
}
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The catch { ... } around github.rest.issues.create({...issuePayload, assignees: [author]}) treats any failure as an “author not assignable” case and retries by creating an unassigned issue. This can misreport the real error (rate limit, auth, invalid labels, etc.) and can also create duplicate issues if the first request actually succeeded but the client threw. Capture the error, only fall back for the specific validation error related to assignees (e.g., 422), and otherwise rethrow/log the original error.

Copilot uses AI. Check for mistakes.
if author is not assignable (for example, not in the org/repo), the
issue is still created and the action continues instead of aborting.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Assisted-by: GitHub Copilot:claude-opus-4.6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
@nashif nashif force-pushed the topic/no_member branch from 24e0426 to 2f66457 Compare April 8, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants