@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.
- package/dist/{chunk-GIWVCTYT.js → chunk-MCD2KII3.js} +8 -4
- package/dist/chunk-MCD2KII3.js.map +1 -0
- package/dist/{chunk-DNG7D77K.js → chunk-NZOQQZOA.js} +4 -2
- package/dist/chunk-NZOQQZOA.js.map +1 -0
- package/dist/{chunk-5M3DTAVU.js → chunk-SJXIMPUS.js} +43 -52
- package/dist/chunk-SJXIMPUS.js.map +1 -0
- package/dist/finalization-git-internal.d.ts +2 -0
- package/dist/finalization-git-internal.d.ts.map +1 -1
- package/dist/finalization-git.js +1 -1
- package/dist/index.js +2 -2
- package/dist/repository-change-process.d.ts.map +1 -1
- package/dist/repository-change-publication.d.ts.map +1 -1
- package/dist/repository-change-publication.js +18 -18
- package/dist/repository-change-publication.js.map +1 -1
- package/dist/repository-reconciliation.d.ts +8 -4
- package/dist/repository-reconciliation.d.ts.map +1 -1
- package/dist/turns/generate-commit-message.d.ts.map +1 -1
- package/dist/turns/generate-commit-message.js +1 -1
- package/package.json +5 -5
- package/src/finalization-git-internal.ts +9 -3
- package/src/repository-change-process.ts +15 -12
- package/src/repository-change-publication.ts +17 -15
- package/src/repository-reconciliation.ts +39 -56
- package/src/turns/generate-commit-message.ts +7 -3
- package/dist/chunk-5M3DTAVU.js.map +0 -1
- package/dist/chunk-DNG7D77K.js.map +0 -1
- package/dist/chunk-GIWVCTYT.js.map +0 -1
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
RemoteBranchChangedError,
|
|
3
3
|
commitAndPushWorkBranch,
|
|
4
4
|
repositoryHasChanges
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MCD2KII3.js";
|
|
6
6
|
import {
|
|
7
7
|
assertReconciliationTargetSafe,
|
|
8
8
|
createRepositoryChangeProcess,
|
|
9
|
-
|
|
9
|
+
reconcileRepository,
|
|
10
10
|
reconciliationPrompt,
|
|
11
11
|
recordRepositoryPublication,
|
|
12
12
|
repositoryWorktreeIsDirty,
|
|
13
13
|
retainConcurrentRebase
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
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
|
|
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?.[
|
|
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:
|
|
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:
|
|
924
|
-
repoPath:
|
|
925
|
-
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,
|