Merge pull request #2208 from pikasTech/fix/agentrun-repository-conflict-warning
Pipelines as Code CI / hwlab-web-probe-sentinel-nc01- Success
Pipelines as Code CI / platform-infra-gitea-nc01- Success
Pipelines as Code CI / unidesk-host- Success

将共享仓库缓存一致性冲突降为非阻塞告警
This commit is contained in:
Lyon
2026-07-15 20:27:23 +08:00
committed by GitHub
@@ -128,8 +128,19 @@ function assertUniqueManagedRepositoryOwnership(specs: readonly AgentRunLaneSpec
for (const repository of spec.gitMirror.repositories) {
const identity = `${cacheIdentity}/${repository.repository}`;
const owner = cacheRepositories.get(identity);
if (owner !== undefined) throw new Error(`AgentRun managed repository ${identity} is owned by both ${owner} and ${spec.lane}`);
cacheRepositories.set(identity, spec.lane);
if (owner !== undefined) {
console.warn(JSON.stringify({
code: "agentrun-managed-repository-shared-cache",
level: "warning",
blocking: false,
mutation: false,
repository: identity,
owners: [owner, spec.lane],
message: `AgentRun managed repository ${identity} is shared by lanes ${owner} and ${spec.lane}`,
}));
} else {
cacheRepositories.set(identity, spec.lane);
}
}
}
}