@leitwerk-dev/coding 0.5.12 → 0.5.13

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.
@@ -2,17 +2,17 @@ import {
2
2
  RemoteBranchChangedError,
3
3
  commitAndPushWorkBranch,
4
4
  repositoryHasChanges
5
- } from "./chunk-GIWVCTYT.js";
5
+ } from "./chunk-MCD2KII3.js";
6
6
  import {
7
7
  assertReconciliationTargetSafe,
8
8
  createRepositoryChangeProcess,
9
- reconcilePublicationRepository,
9
+ reconcileRepository,
10
10
  reconciliationPrompt,
11
11
  recordRepositoryPublication,
12
12
  repositoryWorktreeIsDirty,
13
13
  retainConcurrentRebase
14
- } from "./chunk-5M3DTAVU.js";
15
- import "./chunk-DNG7D77K.js";
14
+ } from "./chunk-SJXIMPUS.js";
15
+ import "./chunk-NZOQQZOA.js";
16
16
  import "./chunk-ABQH2WZT.js";
17
17
  import "./chunk-PISZZXK4.js";
18
18
  import "./chunk-SKGB4CZS.js";
@@ -38,6 +38,7 @@ import "./chunk-PX6F3LHL.js";
38
38
  // src/repository-change-publication.ts
39
39
  import { asUnknownRecord } from "@leitwerk-dev/domain";
40
40
  import {
41
+ COMMIT_MESSAGE_PROJECT_METADATA_KEY,
41
42
  flow
42
43
  } from "@leitwerk-dev/process-sdk";
43
44
 
@@ -771,6 +772,9 @@ function createRepositoryChangePublication(adapter) {
771
772
  const patchRemote = (state, patch) => patchPublicationState(state, namespace(state), patch);
772
773
  async function commitWorkBranch(ctx, commitMessage, expectedRemoteHead = remote(ctx.state).headSha) {
773
774
  const repo = ctx.repo.get("repo");
775
+ const commitMessageMetadata = asUnknownRecord(
776
+ ctx.projects.find((candidate) => candidate.key === repo.key)?.metadata?.[COMMIT_MESSAGE_PROJECT_METADATA_KEY]
777
+ );
774
778
  const gitIdentity = await adapter.identity(ctx);
775
779
  if (adapter.maintenance)
776
780
  await ctx.callIntegrationTool(adapter.maintenance.ownershipTool, { projectKey: repo.key });
@@ -780,13 +784,14 @@ function createRepositoryChangePublication(adapter) {
780
784
  workBranch: repo.workBranch,
781
785
  commitMessage,
782
786
  gitIdentity,
787
+ signoff: commitMessageMetadata?.signoff === true,
783
788
  expectedRemoteHead,
784
789
  protectSubmodules: adapter.prepareSubmodules
785
790
  });
786
791
  }
787
792
  async function reconcile(ctx, current) {
788
793
  const repo = ctx.repo.get("repo");
789
- return reconcilePublicationRepository({
794
+ return reconcileRepository({
790
795
  projectKey: repo.key,
791
796
  repoPath: repo.fsPath,
792
797
  workBranch: repo.workBranch,
@@ -797,6 +802,7 @@ function createRepositoryChangePublication(adapter) {
797
802
  });
798
803
  }
799
804
  const runRepository = async (ctx) => {
805
+ const repo = ctx.repo.get("repo");
800
806
  let current = remote(ctx.state);
801
807
  const update = (patch) => {
802
808
  current = { ...current, ...patch, delivery: { ...current.delivery, ...patch.delivery } };
@@ -810,7 +816,6 @@ function createRepositoryChangePublication(adapter) {
810
816
  reconciliationCycles: 0,
811
817
  pipeline: changed ? null : current.pipeline
812
818
  });
813
- const repo = ctx.repo.get("repo");
814
819
  recordRepositoryPublication(
815
820
  {
816
821
  projectKey: repo.key,
@@ -856,11 +861,7 @@ function createRepositoryChangePublication(adapter) {
856
861
  ctx.reportProgress(deliveryProgress(current, adapter.label));
857
862
  return result(pr.merged ? "completed" : "aborted");
858
863
  }
859
- if (!current.headSha && (adapter.repositories || adapter.unchanged) && !repositoryHasChanges(
860
- ctx.repo.get("repo").fsPath,
861
- ctx.repo.get("repo").baseBranch,
862
- ctx.repo.get("repo").key
863
- )) {
864
+ if (!current.headSha && (adapter.repositories || adapter.unchanged) && !repositoryHasChanges(repo.fsPath, repo.baseBranch, repo.key)) {
864
865
  update({ noChanges: true });
865
866
  await adapter.unchanged?.(ctx);
866
867
  return result("completed");
@@ -879,7 +880,7 @@ function createRepositoryChangePublication(adapter) {
879
880
  try {
880
881
  published = await commitWorkBranch(
881
882
  ctx,
882
- ctx.state.finalization.commitMessages?.[ctx.repo.get("repo").key] ?? ctx.state.finalization.generatedCommitMessage ?? "",
883
+ ctx.state.finalization.commitMessages?.[repo.key] ?? ctx.state.finalization.generatedCommitMessage ?? "",
883
884
  publicationLease
884
885
  );
885
886
  } catch (error) {
@@ -905,9 +906,9 @@ function createRepositoryChangePublication(adapter) {
905
906
  let adjustmentPublished = false;
906
907
  if (adjustment.publishRequired || adjustment.origin === "rebase" || adapter.maintenance) {
907
908
  ctx.reportProgress(deliveryProgress(current, adapter.label, "publish_adjustment"));
908
- if (adapter.maintenance)
909
+ if (adjustment.origin === "rebase" && adapter.maintenance)
909
910
  await ctx.callIntegrationTool(adapter.maintenance.ownershipTool, {
910
- projectKey: ctx.repo.get("repo").key
911
+ projectKey: repo.key
911
912
  });
912
913
  let published;
913
914
  try {
@@ -918,11 +919,10 @@ function createRepositoryChangePublication(adapter) {
918
919
  } catch (error) {
919
920
  if (error instanceof ConcurrentRebaseSourceError) {
920
921
  if (error.published) return reconcileAgain();
921
- const project = ctx.repo.get("repo");
922
922
  retainConcurrentRebase({
923
- projectKey: project.key,
924
- repoPath: project.fsPath,
925
- workBranch: project.workBranch,
923
+ projectKey: repo.key,
924
+ repoPath: repo.fsPath,
925
+ workBranch: repo.workBranch,
926
926
  baselineSha: error.repair.originalHead,
927
927
  rebasedHead: error.repair.headSha,
928
928
  targetBase: error.repair.baseSha,