openxiangda 1.0.184 → 1.0.185
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/lib/application-environments.js +28 -0
- package/lib/cli.js +6 -1
- package/package.json +1 -1
|
@@ -115,6 +115,33 @@ function normalizeManagedReleaseSourceRevision(
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
function normalizeManagedChangeSourceBase(
|
|
119
|
+
target,
|
|
120
|
+
sourceBase,
|
|
121
|
+
releaseSourceRevision
|
|
122
|
+
) {
|
|
123
|
+
const logicalApp = target?.logicalApp || target?.state?.logicalApp;
|
|
124
|
+
if (!logicalApp?.sourceRepositoryId) {
|
|
125
|
+
return cloneJsonValue(sourceBase);
|
|
126
|
+
}
|
|
127
|
+
return normalizeManagedReleaseSourceRevision(
|
|
128
|
+
target,
|
|
129
|
+
{
|
|
130
|
+
...(sourceBase || {}),
|
|
131
|
+
repositoryId: sourceBase?.repo,
|
|
132
|
+
repoAliases: [
|
|
133
|
+
sourceBase?.repo,
|
|
134
|
+
releaseSourceRevision?.repo,
|
|
135
|
+
releaseSourceRevision?.repositoryId,
|
|
136
|
+
...(Array.isArray(releaseSourceRevision?.repoAliases)
|
|
137
|
+
? releaseSourceRevision.repoAliases
|
|
138
|
+
: []),
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
{ errorCode: 'RELEASE_SOURCE_BASE_REPOSITORY_MISMATCH' }
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
118
145
|
function hasStateResourceMappings(value) {
|
|
119
146
|
if (Array.isArray(value)) return value.length > 0;
|
|
120
147
|
if (!value || typeof value !== 'object') {
|
|
@@ -354,6 +381,7 @@ module.exports = {
|
|
|
354
381
|
buildCandidateBundle,
|
|
355
382
|
canonicalJson,
|
|
356
383
|
normalizeEnvironmentKind,
|
|
384
|
+
normalizeManagedChangeSourceBase,
|
|
357
385
|
normalizeManagedReleaseSourceRevision,
|
|
358
386
|
normalizeTargetName,
|
|
359
387
|
hasStateResourceMappings,
|
package/lib/cli.js
CHANGED
|
@@ -131,6 +131,7 @@ const {
|
|
|
131
131
|
bindEnvironmentTarget,
|
|
132
132
|
buildCandidateBundle,
|
|
133
133
|
normalizeEnvironmentKind,
|
|
134
|
+
normalizeManagedChangeSourceBase,
|
|
134
135
|
normalizeManagedReleaseSourceRevision,
|
|
135
136
|
readCandidate,
|
|
136
137
|
readJsonInput,
|
|
@@ -4921,7 +4922,6 @@ async function ensureChangeBaseline(
|
|
|
4921
4922
|
return stored;
|
|
4922
4923
|
}
|
|
4923
4924
|
const activeLease = getUsableStoredPublishLease(target);
|
|
4924
|
-
const sourceBase = resolveChangeSourceBase(changeId, flags);
|
|
4925
4925
|
const releaseSourceRevision = normalizeManagedReleaseSourceRevision(
|
|
4926
4926
|
target,
|
|
4927
4927
|
prepareReleaseSourceRevision({
|
|
@@ -4929,6 +4929,11 @@ async function ensureChangeBaseline(
|
|
|
4929
4929
|
}),
|
|
4930
4930
|
{ errorCode: 'RELEASE_SOURCE_REPOSITORY_MISMATCH' }
|
|
4931
4931
|
);
|
|
4932
|
+
const sourceBase = normalizeManagedChangeSourceBase(
|
|
4933
|
+
target,
|
|
4934
|
+
resolveChangeSourceBase(changeId, flags),
|
|
4935
|
+
releaseSourceRevision
|
|
4936
|
+
);
|
|
4932
4937
|
|
|
4933
4938
|
const data = await requestWithAuth(
|
|
4934
4939
|
config,
|