Why s this happen - [DEPENDENCY] blueprint githubRepository: failed to update blueprint…
Private research annotation
Sign in to add a private research label or note.
- User
Why s this happen - [DEPENDENCY] blueprint githubRepository: failed to update blueprint fields: API request to ***/blueprints/githubRepository PUT failed: 404 Not Found. Body: {"ok":false,"error":"not_found","message":"Relation with identifier "githubBranch_b4bc6c05-2dd8-499d-9268-fd1313babc2c" was not found","details":{"resource":"relation","byField":"identifier","withValue":"githubBranch_b4bc6c05-2dd8-499d-9268-fd1313babc2c","aggregationProperty":"failed_branch_config_rules","pathFilter":{"fromBlueprint":"_rule_result","path":["githubBranch_b4bc6c05-2dd8-499d-9268-fd1313babc2c","repository"]}}}
Assistant
Let me look at the import code to understand how blueprints and aggregation properties are handled.
Assistant
Root cause clear now.
Problem:
githubRepositoryhas an aggregation propertyfailed_branch_config_ruleswith apathFilter.paththat starts with a relation identifier on_rule_result(a system blueprint). That relation doesn't exist yet during Phase 2d because system blueprints are updated in Phase 3, which runs after Phase 2d.The 2-pass retry handles agg-props-referencing-agg-props on non-system blueprints. It can't help here because
_rule_result's relations aren't set until Phase 3.Fix: save agg-props that fail both passes, then retry once more after Phase 3 completes. Let me implement.
Assistant
Now add the pass-3 retry after Phase 3:
Assistant
Now check if the same issue exists in
migrate.go:Assistant
Migrate.go uses a simpler single-pass
runBlueprintPhasefor agg props — same root problem could exist there but less likely since migrate targets an org that already has system blueprints set up. The user's error is from import. Let me verify the fix compiles:Assistant
Clean. Here's the summary:
Root cause:
githubRepository's aggregation propertyfailed_branch_config_ruleshas apathFilterreferencing a relation identifier (githubBranch_b4bc6c05-...) on_rule_result, a system blueprint. System blueprints are updated in Phase 3. Aggregation properties run in Phase 2d — before Phase 3. So both existing passes fail because_rule_result's relations don't exist yet.Fix (
import.go): Phase 2d now saves any agg props still failing after passes 1+2 intoaggPropsAfterSystemBPs. A new Phase 3b runs those after Phase 3 completes system blueprint updates. Only Phase 3b failures are recorded as errors.- User
Could this be adding any issues as a third pass goes through?
Assistant
One potential issue — let me check if
allExistingBPsis populated before Phase 3b runs, since system blueprint IDs need to be in it:Assistant
Good question. Two potential concerns:
1.
allExistingBPsstale for pass 3? No — it's populated viaGetBlueprints(line 566-573) which fetches ALL blueprints from the target including system blueprints._rule_resultis already in it. TheallExistingBPs[id]check in Phase 3b guards the blueprint being updated (e.g.githubRepository), not the dependency — andgithubRepositorywas created in Phase 1 so it's definitely in the map.2. Double-applying agg props? No —
aggPropsAfterSystemBPsonly contains IDs that failed both passes. Blueprints that succeeded in pass 1 or 2 are filtered out beforeaggPropsAfterSystemBPsis assigned. Re-applying is idempotent anyway (full PUT of the same values).One minor thing I did change: in the original, pass-2 failures were immediately added to
i.errors. In my version they're deferred to pass 3. That means a genuinely unresolvable agg-prop error gets reported one pass later — same error, same content, just after Phase 3 instead of before it. No impact on correctness.- User
But we are ignoring _rule_results by default right?
Assistant
Good catch.
_rule_resultis excluded from exports by default (only included with--include-rule-results). So it won't be insystemBPs, Phase 3 won't set up its relations, and Phase 3b retries the same thing with the same missing relation. The fix doesn't actually help in the common case — it just defers the same error by one pass.The real situation:
githubRepository's agg prop has apathFilterreferencing a relation on_rule_resultthat was created by the GitHub integration in the source org but doesn't exist yet in the target org. That's a genuine dependency on integration setup, not import ordering.My fix is wrong. Let me revert Phase 3b:
Assistant
Back to original behavior. The error is real and correct — the target org doesn't have the
githubBranch_b4bc6c05...relation on_rule_resultbecause that relation is created by the GitHub integration, not by import. The[DEPENDENCY]classification is accurate. There's nothing to fix in the import logic here.