@sentry/junior-github 0.272.0 → 0.273.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.
- package/dist/{chunk-CSMMYLAS.js → chunk-E5QVQE4U.js} +4 -0
- package/dist/git-config.d.ts +7 -2
- package/dist/index.js +30 -24
- package/dist/testing.js +1 -1
- package/package.json +2 -2
|
@@ -198,6 +198,10 @@ var GITHUB_PULL_REQUEST_EVENTS = [
|
|
|
198
198
|
"pull_request.merge_conflict"
|
|
199
199
|
];
|
|
200
200
|
var GITHUB_PULL_REQUEST_EVENT_GUIDANCE = {
|
|
201
|
+
"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
|
+
// An approval with a body also arrives as review.commented in the same
|
|
203
|
+
// Turn, so this guidance must not tell the agent to hold off on that body.
|
|
204
|
+
"pull_request.review.approved": "When the approval includes actionable feedback, address it like any other review feedback.",
|
|
201
205
|
"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".',
|
|
202
206
|
"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.',
|
|
203
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."
|
package/dist/git-config.d.ts
CHANGED
|
@@ -43,5 +43,10 @@ export declare function setGitHooksPathEnv(env: PluginEnv, hooksPath: string): v
|
|
|
43
43
|
export declare function repositoryHook(name: string): string;
|
|
44
44
|
/** Build the hook that replaces model-supplied commit attribution. */
|
|
45
45
|
export declare function prepareCommitMsgHook(): string;
|
|
46
|
-
/**
|
|
47
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Write Junior's Git hooks and global Git config inside the sandbox.
|
|
48
|
+
*
|
|
49
|
+
* This runs on every sandbox acquire, and each sandbox call is one provider
|
|
50
|
+
* round trip, so all of the setup is one command.
|
|
51
|
+
*/
|
|
52
|
+
export declare function prepareSandboxGit(ctx: SandboxPrepareHookContext): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
readGrantPermissions,
|
|
60
60
|
requireEnv,
|
|
61
61
|
resolveUserAccount
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-E5QVQE4U.js";
|
|
63
63
|
|
|
64
64
|
// src/tool-support/attribution.ts
|
|
65
65
|
var GITHUB_REQUEST_ATTRIBUTION_START = "<!-- junior-request-attribution:start -->";
|
|
@@ -5081,14 +5081,38 @@ else
|
|
|
5081
5081
|
fi
|
|
5082
5082
|
`;
|
|
5083
5083
|
}
|
|
5084
|
-
|
|
5084
|
+
var PREPARE_GIT_SCRIPT = `set -eu
|
|
5085
|
+
hooks_dir=$1
|
|
5086
|
+
shift
|
|
5087
|
+
mkdir -p "$hooks_dir"
|
|
5088
|
+
while [ "$#" -gt 0 ]; do
|
|
5089
|
+
printf '%s' "$2" > "$hooks_dir/$1"
|
|
5090
|
+
chmod 755 "$hooks_dir/$1"
|
|
5091
|
+
shift 2
|
|
5092
|
+
done
|
|
5093
|
+
git config --global core.hooksPath "$hooks_dir"
|
|
5094
|
+
git config --global commit.gpgsign false
|
|
5095
|
+
git config --global credential.helper ""
|
|
5096
|
+
git config --global http.emptyAuth true
|
|
5097
|
+
`;
|
|
5098
|
+
async function prepareSandboxGit(ctx) {
|
|
5099
|
+
const hooks = [
|
|
5100
|
+
["prepare-commit-msg", prepareCommitMsgHook()],
|
|
5101
|
+
...REPOSITORY_HOOK_NAMES.map((name) => [name, repositoryHook(name)])
|
|
5102
|
+
];
|
|
5085
5103
|
const result = await ctx.sandbox.run({
|
|
5086
|
-
cmd: "
|
|
5087
|
-
args: [
|
|
5104
|
+
cmd: "bash",
|
|
5105
|
+
args: [
|
|
5106
|
+
"-c",
|
|
5107
|
+
PREPARE_GIT_SCRIPT,
|
|
5108
|
+
"bash",
|
|
5109
|
+
gitHooksPath(ctx.sandbox.juniorRoot),
|
|
5110
|
+
...hooks.flat()
|
|
5111
|
+
]
|
|
5088
5112
|
});
|
|
5089
5113
|
if (result.exitCode !== 0) {
|
|
5090
5114
|
throw new Error(
|
|
5091
|
-
`Failed to
|
|
5115
|
+
`Failed to prepare sandbox git: ${result.stderr || result.stdout}`
|
|
5092
5116
|
);
|
|
5093
5117
|
}
|
|
5094
5118
|
}
|
|
@@ -6284,25 +6308,7 @@ function githubPlugin(options = {}) {
|
|
|
6284
6308
|
);
|
|
6285
6309
|
},
|
|
6286
6310
|
workspacePrepare: prepareWorkspace,
|
|
6287
|
-
|
|
6288
|
-
const hooksPath = gitHooksPath(ctx.sandbox.juniorRoot);
|
|
6289
|
-
await ctx.sandbox.writeFile({
|
|
6290
|
-
path: `${hooksPath}/prepare-commit-msg`,
|
|
6291
|
-
mode: 493,
|
|
6292
|
-
content: prepareCommitMsgHook()
|
|
6293
|
-
});
|
|
6294
|
-
for (const name of REPOSITORY_HOOK_NAMES) {
|
|
6295
|
-
await ctx.sandbox.writeFile({
|
|
6296
|
-
path: `${hooksPath}/${name}`,
|
|
6297
|
-
mode: 493,
|
|
6298
|
-
content: repositoryHook(name)
|
|
6299
|
-
});
|
|
6300
|
-
}
|
|
6301
|
-
await configureGit(ctx, "core.hooksPath", hooksPath);
|
|
6302
|
-
await configureGit(ctx, "commit.gpgsign", "false");
|
|
6303
|
-
await configureGit(ctx, "credential.helper", "");
|
|
6304
|
-
await configureGit(ctx, "http.emptyAuth", "true");
|
|
6305
|
-
},
|
|
6311
|
+
sandboxPrepare: prepareSandboxGit,
|
|
6306
6312
|
async beforeToolExecute(ctx) {
|
|
6307
6313
|
if (ctx.tool.name !== "bash") {
|
|
6308
6314
|
return;
|
package/dist/testing.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior-github",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.273.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.
|
|
35
|
+
"@sentry/junior-plugin-api": "0.273.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@oxlint/plugins": "1.79.0",
|