@xdevops/issue-auto-finish 1.0.83 → 1.0.84

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.
@@ -3713,6 +3713,26 @@ async function executePhaseLoop(ctx, deps, wtGit, wtPlan, wtGitMap) {
3713
3713
  );
3714
3714
  const needsDeployment = deps.shouldDeployServers(issue.iid);
3715
3715
  let serversStarted = false;
3716
+ if (needsDeployment && startIdx > 0) {
3717
+ const skippedDeployPhase = pipelineDef.phases.slice(0, startIdx).some((p) => p.deploysPreview);
3718
+ if (skippedDeployPhase && !phaseCtx.ports) {
3719
+ const existingPorts = deps.getPortsForIssue(issue.iid);
3720
+ if (existingPorts) {
3721
+ logger16.info("Restored preview ports from allocator", { iid: issue.iid, ...existingPorts });
3722
+ phaseCtx.ports = existingPorts;
3723
+ ctx.wtCtx.ports = existingPorts;
3724
+ serversStarted = true;
3725
+ } else {
3726
+ logger16.info("Restarting preview servers for resumed pipeline", { iid: issue.iid });
3727
+ const ports = await deps.startPreviewServers(ctx.wtCtx, issue);
3728
+ if (ports) {
3729
+ phaseCtx.ports = ports;
3730
+ ctx.wtCtx.ports = ports;
3731
+ serversStarted = true;
3732
+ }
3733
+ }
3734
+ }
3735
+ }
3716
3736
  for (let i = startIdx; i < pipelineDef.phases.length; i++) {
3717
3737
  if (isShuttingDown()) {
3718
3738
  throw new ServiceShutdownError();
@@ -4414,7 +4434,8 @@ var PipelineOrchestrator = class {
4414
4434
  startPreviewServers: (wtCtx, issue) => this.startPreviewServers(wtCtx, issue),
4415
4435
  stopPreviewServers: (iid) => this.stopPreviewServers(iid),
4416
4436
  tryCreateMergeRequest: (issue, branch, workDir, previewUrl) => this.tryCreateMergeRequest(issue, branch, workDir, previewUrl),
4417
- buildPreviewUrl: (iid) => this.buildPreviewUrl(iid)
4437
+ buildPreviewUrl: (iid) => this.buildPreviewUrl(iid),
4438
+ getPortsForIssue: (iid) => this.portAllocator.getPortsForIssue(iid)
4418
4439
  };
4419
4440
  }
4420
4441
  async _processIssueImpl(issue) {
@@ -4454,6 +4475,9 @@ var PipelineOrchestrator = class {
4454
4475
  branchName,
4455
4476
  pipelineMode: issuePipelineDef.mode
4456
4477
  };
4478
+ if (record.ports) {
4479
+ phaseCtx.ports = record.ports;
4480
+ }
4457
4481
  const ctx = {
4458
4482
  issue,
4459
4483
  branchName,
@@ -4688,7 +4712,7 @@ E2E \u6D4B\u8BD5\u5C06\u5C1D\u8BD5\u4F7F\u7528 config.json \u4E2D\u7684\u9ED8\u8
4688
4712
  wtCtx.ports = ports;
4689
4713
  try {
4690
4714
  this.tracker.updateState(issueIid, record.state, {
4691
- ports: { frontend: ports.frontendPort, backend: ports.backendPort },
4715
+ ports,
4692
4716
  previewStartedAt: (/* @__PURE__ */ new Date()).toISOString()
4693
4717
  });
4694
4718
  await this.devServerManager.startServers(wtCtx, ports);
@@ -5098,4 +5122,4 @@ export {
5098
5122
  PipelineOrchestrator,
5099
5123
  BrainstormService
5100
5124
  };
5101
- //# sourceMappingURL=chunk-UDCMSDNT.js.map
5125
+ //# sourceMappingURL=chunk-7YCDMVIF.js.map