feat: load branch follower reuse config from source repos
This commit is contained in:
@@ -143,6 +143,7 @@ function compactNativePayload(payload) {
|
||||
if (value === null) return null;
|
||||
return {
|
||||
gitMirror: compactGitMirror(value.gitMirror),
|
||||
reuseConfig: compactReuseConfig(value.reuseConfig),
|
||||
tekton: compactTekton(value.tekton),
|
||||
taskRuns: compactTaskRuns(value.taskRuns),
|
||||
planArtifacts: compactPlanArtifacts(value.planArtifacts),
|
||||
@@ -154,6 +155,27 @@ function compactNativePayload(payload) {
|
||||
};
|
||||
}
|
||||
|
||||
function compactReuseConfig(reuseConfig) {
|
||||
const value = recordOrNull(reuseConfig);
|
||||
if (value === null) return null;
|
||||
return {
|
||||
ok: value.ok === true,
|
||||
present: value.present === true,
|
||||
path: stringOrNull(value.path),
|
||||
sourceCommit: stringOrNull(value.sourceCommit),
|
||||
stageRef: stringOrNull(value.stageRef),
|
||||
sha256: stringOrNull(value.sha256),
|
||||
serviceCount: numberOrNull(value.serviceCount),
|
||||
services: arrayRecords(value.services).slice(0, 8).map((service) => ({
|
||||
id: stringOrNull(service.id),
|
||||
runtimeReuse: recordOrNull(service.runtimeReuse),
|
||||
envReuse: recordOrNull(service.envReuse),
|
||||
})),
|
||||
errors: arrayStrings(value.errors).slice(0, 5),
|
||||
valuesRedacted: true,
|
||||
};
|
||||
}
|
||||
|
||||
function compactGitMirror(gitMirror) {
|
||||
const value = recordOrNull(gitMirror);
|
||||
if (value === null) return null;
|
||||
|
||||
Reference in New Issue
Block a user