Skip to content

Stop allocate-definitive-ids self-trigger loop - #2726

Merged
jamesamcl merged 1 commit into
masterfrom
fix-allocate-ids-loop
Jun 23, 2026
Merged

jamesamcl merged 1 commit into
masterfrom
fix-allocate-ids-loop

Conversation

@aleixpuigb

Copy link
Copy Markdown
Collaborator

Problem

After #2725 fixed the workflow so it actually runs, it began looping — it ran ~11 times back-to-back on master, each pushing a Replace temporary IDs by definitive IDs. commit.

Root cause: the allocate step runs robot ... kgcl:mint ... convert -f owl -o efo-edit.owl. ROBOT re-serialises the ~13 anonymous <rdf:Description> blocks in efo-edit.owl (obsolete-term IAO_0100001 replacement annotations) in a non-deterministic order. So every run rewrites the file even when there are no temporary IDs to mint. That commit touches efo-edit.owl, which matches the workflow's paths: filter, so it immediately re-triggers the workflow → infinite loop. (normalize_src is the same non-deterministic robot convert, so it can't stabilise it either.)

The temp ID allocation itself worked correctly — systemic inflammation got EFO_0920000 — the bug is purely the self-perpetuating trigger.

Fix

Guard the work on the presence of temporary EFO_099 IDs:

  • A Check for temporary IDs step greps efo-edit.owl.
  • Prepare MONDO import, Allocate definitive IDs, and Commit and push changes run only if temp IDs are present.

A genuine allocation now triggers at most one trailing no-op run (temp IDs already minted → grep finds none → all steps skipped → no commit), which terminates the chain. No-op runs are also cheap now — they skip the MONDO download entirely.

Notes

  • The workflow is currently disabled (I disabled it to stop the live loop). Re-enable it after merging this PR (Actions → "Allocate definitive EFO IDs" → ⋯ → Enable, or gh workflow enable "Allocate definitive EFO IDs").
  • Current master has no temporary IDs, so the guarded workflow will be a no-op until a new EFO_099xxxx term is added.
  • Residual cosmetic churn (~26 lines of rdf:Description reordering) will still appear inside real allocation commits; a deeper fix would be making the OWL serialization deterministic or giving those obsolete annotations explicit subjects — out of scope here.

Once the workflow actually ran (after the kgcl fix), it looped: `robot
convert -f owl` re-serialises efo-edit.owl's anonymous rdf:Description
blocks (obsolete-term replacement annotations) in a non-deterministic
order, so every run rewrote the file even with no temporary IDs to mint.
The resulting "Replace temporary IDs" commit touches efo-edit.owl, which
matches the push path filter and re-triggers the workflow -> infinite loop
(observed running ~11 times back-to-back on master).

Guard the work on the presence of temporary EFO_099 IDs: skip MONDO prep,
minting and the commit when none exist. A real allocation now triggers at
most one trailing no-op run (temp IDs already gone -> skip -> no commit),
which terminates the chain.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@aleixpuigb
aleixpuigb requested a review from jamesamcl June 23, 2026 15:36
@aleixpuigb aleixpuigb self-assigned this Jun 23, 2026
@jamesamcl
jamesamcl merged commit 86faf65 into master Jun 23, 2026
1 check passed
@aleixpuigb
aleixpuigb deleted the fix-allocate-ids-loop branch June 23, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants