@checkstack/gitops-backend 0.2.0 → 0.2.2
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/CHANGELOG.md +22 -0
- package/package.json +2 -2
- package/src/sync/reconciler.ts +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @checkstack/gitops-backend
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b53a40e: Fix GitOps entity update failures due to pending error records
|
|
8
|
+
|
|
9
|
+
- Ensured the `existingEntityId` parameter in the Reconciler engine is set to `undefined` instead of a `"pending-UUID"` when handling entities that failed to sync initially.
|
|
10
|
+
- Hardened the `Healthcheck` GitOps kind logic to explicitly ignore `"pending-"` IDs, preventing SQL update errors on synthetic provenance IDs.
|
|
11
|
+
- Fixed a bug where resolving YAML syntax errors would cause the subsequent sync to fail with `failed query: update [...]` because it attempted to update the nonexistent `"pending-"` entity instead of creating a new one.
|
|
12
|
+
|
|
13
|
+
## 0.2.1
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 57d54de: Fix GitOps Healthcheck reconciliation engine and Kind Registry UI
|
|
18
|
+
|
|
19
|
+
- Mandated fully qualified IDs for all healthcheck strategies and collector definitions.
|
|
20
|
+
- Refactored the Kind Registry UI to display schema documentation in beautifully formatted, interactive YAML examples.
|
|
21
|
+
- Entity Envelope Fields and Base Spec Schema are now displayed in collapsed accordions.
|
|
22
|
+
- Fixed condition logic that broke the collector documentation display.
|
|
23
|
+
- Enhanced UX by dynamically injecting fully-qualified strategy variants directly into the YAML examples.
|
|
24
|
+
|
|
3
25
|
## 0.2.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/gitops-backend",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"checkstack": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@checkstack/backend-api": "0.12.0",
|
|
17
|
-
"@checkstack/gitops-common": "0.
|
|
17
|
+
"@checkstack/gitops-common": "0.2.0",
|
|
18
18
|
"@checkstack/common": "0.6.5",
|
|
19
19
|
"@checkstack/command-backend": "0.1.19",
|
|
20
20
|
"@checkstack/queue-api": "0.2.13",
|
package/src/sync/reconciler.ts
CHANGED
|
@@ -308,7 +308,7 @@ async function reconcileEntity(params: {
|
|
|
308
308
|
// Plugins use context.resolveSecretsBySchema() to resolve specific fields.
|
|
309
309
|
const reconcileResult = await kindDef.reconcile({
|
|
310
310
|
entity: entity as typeof entity & { spec: Record<string, unknown> },
|
|
311
|
-
existingEntityId: existing
|
|
311
|
+
existingEntityId: existing && !existing.entityId.startsWith("pending-") ? existing.entityId : undefined,
|
|
312
312
|
context,
|
|
313
313
|
});
|
|
314
314
|
|
|
@@ -381,7 +381,8 @@ async function detectOrphans(params: {
|
|
|
381
381
|
kind: prov.kind,
|
|
382
382
|
});
|
|
383
383
|
|
|
384
|
-
|
|
384
|
+
// Do not call delete reconciler if it's a pending error record
|
|
385
|
+
if (kindDef?.delete && !prov.entityId.startsWith("pending-")) {
|
|
385
386
|
try {
|
|
386
387
|
await kindDef.delete({
|
|
387
388
|
entityName: prov.entityName,
|
|
@@ -484,18 +485,17 @@ async function upsertProvenance(params: {
|
|
|
484
485
|
return;
|
|
485
486
|
}
|
|
486
487
|
|
|
487
|
-
// First-time error: no entityId available yet
|
|
488
|
-
//
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
}
|
|
488
|
+
// First-time error: no entityId available yet because the entity failed to create.
|
|
489
|
+
// We MUST create a provenance record anyway so the error shows in the UI.
|
|
490
|
+
// We use a "pending-" prefix so the orphan detector knows not to call the delete reconciler.
|
|
491
|
+
const resolvedEntityId = entityId ?? `pending-${uuidv4()}`;
|
|
492
492
|
|
|
493
493
|
await db.insert(schema.provenance).values({
|
|
494
494
|
id: uuidv4(),
|
|
495
495
|
apiVersion: entity.apiVersion,
|
|
496
496
|
kind: entity.kind,
|
|
497
497
|
entityName: entity.metadata.name,
|
|
498
|
-
entityId,
|
|
498
|
+
entityId: resolvedEntityId,
|
|
499
499
|
providerId,
|
|
500
500
|
repository: file.repository,
|
|
501
501
|
filePath: file.filePath,
|