@sentry/junior-github 0.273.0 → 0.274.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -197,6 +197,8 @@ var GITHUB_PULL_REQUEST_EVENTS = [
197
197
  "pull_request.closed_unmerged",
198
198
  "pull_request.merge_conflict"
199
199
  ];
200
+ var STACK_CHECK = "Check if the pull request is in a stack: `gh api 'repos/OWNER/REPO/stacks?pull_request=NUMBER'`.";
201
+ var STACK_CONFLICT_STEPS = "run `gh stack rebase`, resolve each conflict so that both changes stay intact, stage the files, and run `gh stack rebase --continue`. Run the checks again, run `gh stack push`, and confirm that each open pull request in the stack can merge. Report the files that had conflicts.";
200
202
  var GITHUB_PULL_REQUEST_EVENT_GUIDANCE = {
201
203
  "pull_request.checks.failed": "Fix only failures that the pull request causes. Do not skip, disable, or weaken a check to make it pass.",
202
204
  // An approval with a body also arrives as review.commented in the same
@@ -204,7 +206,7 @@ var GITHUB_PULL_REQUEST_EVENT_GUIDANCE = {
204
206
  "pull_request.review.approved": "When the approval includes actionable feedback, address it like any other review feedback.",
205
207
  "pull_request.comment.created": 'After acting on actionable feedback, call github_updatePullRequestFeedback with the exact repo, commentId, and commentKind from Verified details, and status "addressed" or "declined".',
206
208
  "pull_request.review_comment.created": 'After acting on actionable feedback, call github_updatePullRequestFeedback with the exact repo, commentId, and commentKind from Verified details, and status "addressed" or "declined". Then resolve the thread with github_resolvePullRequestReviewThread.',
207
- "pull_request.merge_conflict": "Fetch baseBranch from Verified details and merge it into the pull request branch. Do not rebase. Resolve each conflict so that both the pull request change and the base branch change stay intact. Run the checks again, push, and confirm that the pull request can merge. Report the files that had conflicts."
209
+ "pull_request.merge_conflict": `${STACK_CHECK} If it is, run \`gh stack checkout NUMBER\`, then ${STACK_CONFLICT_STEPS} If it is not, fetch baseBranch from Verified details and merge it into the pull request branch. Do not rebase. Resolve each conflict so that both the pull request change and the base branch change stay intact. Run the checks again, push, and confirm that the pull request can merge. Report the files that had conflicts.`
208
210
  };
209
211
  function gitHubPullRequestEventGuidance(guidance) {
210
212
  const merged = { ...GITHUB_PULL_REQUEST_EVENT_GUIDANCE };
@@ -218,7 +220,7 @@ function gitHubPullRequestEventGuidance(guidance) {
218
220
  }
219
221
  var GITHUB_PULL_REQUEST_OUTCOME_GUIDANCE = {
220
222
  "pull_request.review.approved": "Mention each person in People involved, or the person who asked for the pull request if that line is missing. Say who approved it and link it. Do not merge it unless asked.",
221
- "pull_request.merged": "Mention each person in People involved, or the person who asked for the pull request if that line is missing. Say that it merged and link it."
223
+ "pull_request.merged": `${STACK_CHECK} If open pull requests in the stack remain above it and Junior pushed their branches, restack them before you reply. Do not ask first. Run \`gh stack checkout NUMBER\` with the lowest open pull request, then \`gh stack sync\`. If sync reports a conflict, ${STACK_CONFLICT_STEPS} Then mention each person in People involved, or the person who asked for the pull request if that line is missing. Say that it merged and link it. When you restacked, say so in the same reply.`
222
224
  };
223
225
  function gitHubPullRequestCreateWatch(config) {
224
226
  const outcomeEvents = Object.keys(
package/dist/index.js CHANGED
@@ -59,7 +59,7 @@ import {
59
59
  readGrantPermissions,
60
60
  requireEnv,
61
61
  resolveUserAccount
62
- } from "./chunk-E5QVQE4U.js";
62
+ } from "./chunk-EALXNZGU.js";
63
63
 
64
64
  // src/tool-support/attribution.ts
65
65
  var GITHUB_REQUEST_ATTRIBUTION_START = "<!-- junior-request-attribution:start -->";
package/dist/testing.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  normalizeGitHubEvents
3
- } from "./chunk-E5QVQE4U.js";
3
+ } from "./chunk-EALXNZGU.js";
4
4
  export {
5
5
  normalizeGitHubEvents
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-github",
3
- "version": "0.273.0",
3
+ "version": "0.274.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -32,7 +32,7 @@
32
32
  "drizzle-orm": "^0.45.2",
33
33
  "marked": "^18.1.2",
34
34
  "zod": "^4.5.4",
35
- "@sentry/junior-plugin-api": "0.273.0"
35
+ "@sentry/junior-plugin-api": "0.274.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@oxlint/plugins": "1.79.0",
@@ -11,7 +11,7 @@ Guide evidence-first GitHub repository work from inspection through a reviewable
11
11
  - Treat shallow clones as inspection checkouts; deepen before history work; never force-push around missing ancestry.
12
12
  - Install dependencies with the lockfile frozen mode before verification when needed.
13
13
  - Finish every code change with a pushed PR, without asking, unless the user opts out or asked for investigation only. Open it ready when work and checks are done; open a draft when work, checks, or decisions remain. An open scope question goes in the PR body, not in a stop.
14
- - After each push to a branch with an open PR, check mergeability. Resolve conflicts without asking, by merging the PR base branch (usually the default branch). Never rebase for this. GitHub sends no event for a new conflict, and conflicted PRs get no new checks. The plugin publishes `pull_request.merge_conflict` for a watched PR only when another webhook event arrives for it, so the post-push check stays.
14
+ - After each push to a branch with an open PR, check mergeability. Resolve conflicts without asking, by merging the PR base branch (usually the default branch). Never rebase for this, except in a stack: a stack merges only with a linear history, so stacked PRs restack with `gh stack`. When a stacked PR merges, restack the open PRs above it, because GitHub sends them no event when its own rebase stops at a conflict. GitHub sends no event for a new conflict, and conflicted PRs get no new checks. The plugin publishes `pull_request.merge_conflict` for a watched PR only when another webhook event arrives for it, so the post-push check stays.
15
15
  - Write conventional PR titles and short plain-English bodies; keep check results out of the PR body.
16
16
  - Report exact validation and permission failures.
17
17
 
@@ -38,6 +38,7 @@ Open this when making repository edits, not for read-only inspection.
38
38
  - Run `gh pr view NUMBER --repo owner/repo --json mergeable,baseRefName`.
39
39
  - `UNKNOWN`: GitHub is still calculating it. Wait about 5 seconds and check again, up to 3 times. If it stays `UNKNOWN`, report that and continue.
40
40
  - `CONFLICTING`: resolve it now. Do not ask first. GitHub checks mergeability against the PR base (`baseRefName`), which is usually the default branch. Fetch the base and merge `origin/BASE` into the PR branch. Do not rebase. Resolve each conflict so that both the PR change and the base branch change stay intact. Run the checks again, push, and check mergeability again.
41
+ - Stacked PR (`gh api 'repos/owner/repo/stacks?pull_request=NUMBER'` returns a stack): a stack merges only with a linear history, so rebase instead of merge. Run `gh stack checkout NUMBER` and `gh stack rebase`, resolve each conflict, run `gh stack rebase --continue`, run the checks, and `gh stack push`.
41
42
  4. Resolve the actual default branch.
42
43
  5. Update an existing PR for the branch with `github_updatePullRequest`, or create with `github_createPullRequest` (`draft: true` only when work, checks, or decisions remain; otherwise ready for review).
43
44
  6. PR title matches the current dominant change, same conventional form as commits.
@@ -48,4 +49,4 @@ Open this when making repository edits, not for read-only inspection.
48
49
 
49
50
  ## Follow
50
51
 
51
- When PR creation returns a subscribable hint, subscribe to suggested review/CI events. Fix routine review feedback and failed checks without a thread update. Reply only when the requester needs to act, or when the PR merges or closes.
52
+ When PR creation returns a subscribable hint, subscribe to suggested review/CI events. Fix routine review feedback and failed checks without a thread update. When a PR in a stack merges, restack the open PRs above it with `gh stack sync` before you reply; GitHub sends them no event when its own rebase stops at a conflict. Reply only when the requester needs to act, or when the PR merges or closes.