@rallycry/conveyor-agent 10.0.4 → 10.0.5

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.
@@ -944,8 +944,10 @@ function createServiceLogger(service) {
944
944
  }
945
945
 
946
946
  // src/runner/git-utils.ts
947
- import { execSync } from "child_process";
947
+ import { execSync, exec } from "child_process";
948
948
  import { realpathSync } from "fs";
949
+ import { promisify } from "util";
950
+ var execAsync = promisify(exec);
949
951
  function syncWithBaseBranch(cwd, baseBranch) {
950
952
  if (!baseBranch) return true;
951
953
  try {
@@ -1057,20 +1059,15 @@ function stageAndCommit(cwd, message) {
1057
1059
  return null;
1058
1060
  }
1059
1061
  }
1060
- function tryPush(cwd, branch, skipVerify = false) {
1062
+ async function tryPush(cwd, branch, skipVerify = false) {
1061
1063
  const noVerify = skipVerify ? "--no-verify " : "";
1062
1064
  try {
1063
- execSync(`git push ${noVerify}origin ${branch}`, {
1064
- cwd,
1065
- stdio: ["ignore", "pipe", "pipe"],
1066
- timeout: 3e4
1067
- });
1065
+ await execAsync(`git push ${noVerify}origin ${branch}`, { cwd, timeout: 3e4 });
1068
1066
  return true;
1069
1067
  } catch {
1070
1068
  try {
1071
- execSync(`git push ${noVerify}--force-with-lease origin ${branch}`, {
1069
+ await execAsync(`git push ${noVerify}--force-with-lease origin ${branch}`, {
1072
1070
  cwd,
1073
- stdio: ["ignore", "pipe", "pipe"],
1074
1071
  timeout: 3e4
1075
1072
  });
1076
1073
  return true;
@@ -1079,9 +1076,9 @@ function tryPush(cwd, branch, skipVerify = false) {
1079
1076
  }
1080
1077
  }
1081
1078
  }
1082
- function isAuthError(cwd) {
1079
+ async function isAuthError(cwd) {
1083
1080
  try {
1084
- execSync("git push --dry-run", { cwd, stdio: ["ignore", "pipe", "pipe"], timeout: 3e4 });
1081
+ await execAsync("git push --dry-run", { cwd, timeout: 3e4 });
1085
1082
  return false;
1086
1083
  } catch (err) {
1087
1084
  if (err.killed) return true;
@@ -1243,14 +1240,14 @@ async function pushToOrigin(cwd, refreshToken, skipVerify = false) {
1243
1240
  } catch {
1244
1241
  }
1245
1242
  }
1246
- if (tryPush(cwd, currentBranch, skipVerify)) return true;
1247
- if (refreshToken && isAuthError(cwd)) {
1243
+ if (await tryPush(cwd, currentBranch, skipVerify)) return true;
1244
+ if (refreshToken && await isAuthError(cwd)) {
1248
1245
  const token = await refreshToken();
1249
1246
  if (token) {
1250
1247
  updateRemoteToken(cwd, token);
1251
1248
  process.env.GITHUB_TOKEN = token;
1252
1249
  process.env.GH_TOKEN = token;
1253
- return tryPush(cwd, currentBranch, skipVerify);
1250
+ return await tryPush(cwd, currentBranch, skipVerify);
1254
1251
  }
1255
1252
  }
1256
1253
  return false;
@@ -1779,11 +1776,11 @@ function execErrorDetail(err) {
1779
1776
  const message = withStreams.message ?? String(err);
1780
1777
  return stderr ? `${message} \u2014 stderr: ${stderr}` : message;
1781
1778
  }
1782
- function dumpPostgresIfPresent(exec = execSync2) {
1779
+ function dumpPostgresIfPresent(exec2 = execSync2) {
1783
1780
  if (!hasPostgresDep()) return Promise.resolve({ dumped: false });
1784
1781
  const outputPath = path.join(tmpdir(), `conveyor-pgdump-${randomUUID()}.sql`);
1785
1782
  try {
1786
- exec(buildPgDumpCommand({ outputPath }), {
1783
+ exec2(buildPgDumpCommand({ outputPath }), {
1787
1784
  stdio: ["ignore", "pipe", "pipe"],
1788
1785
  timeout: 6e4
1789
1786
  });
@@ -1794,10 +1791,10 @@ function dumpPostgresIfPresent(exec = execSync2) {
1794
1791
  return Promise.resolve({ dumped: false });
1795
1792
  }
1796
1793
  }
1797
- function applyPgDumpIfConfigured(dumpPath, exec = execSync2) {
1794
+ function applyPgDumpIfConfigured(dumpPath, exec2 = execSync2) {
1798
1795
  if (!hasPostgresDep()) return false;
1799
1796
  try {
1800
- exec(buildPsqlRestoreCommand({ dumpPath }), {
1797
+ exec2(buildPsqlRestoreCommand({ dumpPath }), {
1801
1798
  stdio: ["ignore", "pipe", "pipe"],
1802
1799
  timeout: 12e4
1803
1800
  });
@@ -6129,7 +6126,7 @@ function buildCreatePullRequestTool(connection, config) {
6129
6126
  "Commit message for staging uncommitted changes. If not provided, a default message based on the PR title will be used."
6130
6127
  ),
6131
6128
  skipVerify: z5.boolean().optional().describe(
6132
- "Pass --no-verify to the git push, bypassing the local pre-push quality gate (lint/typecheck/test). Use this if a previous attempt failed on the pre-push hook in an environment where you've already run the gates yourself \u2014 CI still runs on the resulting PR."
6129
+ "Controls the local pre-push quality gate (lint/typecheck/test). Defaults to true (--no-verify): the push skips the local gate because you should run gates yourself before opening the PR and CI re-runs them on the resulting PR. Running the full gate synchronously during the push would block the agent's event loop long enough to drop the Conveyor socket connection. Pass false to force the local pre-push hook to run."
6133
6130
  )
6134
6131
  },
6135
6132
  async ({ title, body, branch, baseBranch, commitMessage, skipVerify }) => {
@@ -6164,7 +6161,7 @@ Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>`;
6164
6161
  return void 0;
6165
6162
  }
6166
6163
  },
6167
- skipVerify ?? false
6164
+ skipVerify ?? true
6168
6165
  );
6169
6166
  if (pushSuccess) {
6170
6167
  connection.sendEvent({
@@ -9916,4 +9913,4 @@ export {
9916
9913
  runStartCommand,
9917
9914
  unshallowRepo
9918
9915
  };
9919
- //# sourceMappingURL=chunk-OOUQ2C4Z.js.map
9916
+ //# sourceMappingURL=chunk-S72TAMGA.js.map