VEuPathDB / VEuPathDB/ApiCommonModel
Apollo release: emit update commands only where Apollo's stored fields differ
Nobody has claimed this yet.
- Dominant language
- Perl
- Stars
- 1
- Forks
- 1
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 5
Description
Problem
Apollo_curl emits an updateOrganismInfo line for every organism in the update bucket — 453 of them for b71 — and in the normal case every one is a no-op.
updateCommand sets three fields:
| Field | Value | Can it differ from what Apollo holds? |
|---|---|---|
publicMode |
$apollo->{public_mode}, read from Apollo and echoed straight back |
Never — identical by construction |
directory |
/data/apollo_data/$abbrev |
Only if the stored path prefix drifted |
blatdb |
/data/apollo_data/twoBit/$abbrev.2bit |
Only if it drifted |
The update bucket is keyed on abbrev, and Apollo's abbrev is parsed out of its stored directory (Apollo.pm:100, last path segment) — so an organism only reaches this bucket if its stored directory already ends in the abbrev we are about to write.
The release does not depend on these lines. Apollo stores a release-independent string; what moves organisms onto the new build is systems' relink (ln -s apollo_b${REL}/data apollo_data) plus the container restart. The curl does not participate.
Cost
- 453 writes against production Apollo per release, each a chance to fail
- the 2 lines that actually change something (1 rename, 1 prune in b71) are buried in 453 that do not
- no practical way to check 455 response bodies by eye, which matters while the
$APOLLO_ADMIN_PASSWORDexpansion question is open
What the lines currently buy
Drift correction on directory prefix and blatdb only — neither release-driven. This is declarative convergence, inherited from Paul Wilkinson's script, which never diffed anything.
Proposal
Emit an update only when a field actually differs, and report the rest as a verified count rather than as silence:
453 organism(s) already correct in Apollo -- no command needed
2 update(s) emitted: <abbrev> (blatdb), <abbrev> (directory)
The comparison is free — Apollo.pm:129-133 already parses directory, blatdb, common_name and public_mode off every Apollo organism.
This keeps the self-healing property (drift is still detected) while making Apollo_curl a readable diff instead of a full-roster assertion.
Constraints
Keep sending publicMode on every line that is emitted. It can never be the reason to emit, but omitting it risks Apollo defaulting it — precisely the re-publish-hidden-organisms bug updateCommand already dies to prevent (refusing to guess visibility).
Sequencing with #225. Once commonName is added to updateCommand, annotation-version bumps become a genuine diff and the conditional emit is what surfaces them — the file would list exactly the organisms whose name changed. Build the diff first, then add commonName into it.
Tests
Model/t/commands.t / Model/t/cli.t — an organism whose Apollo state matches emits no line; a drifted blatdb or directory prefix does; an emitted line still carries publicMode; the report states the already-correct count.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Apollo_curl flow and Apollo.pm:100 and :129-133, which parse the stored organism fields. Read Model/t/commands.t and Model/t/cli.t first, then cover matching state, drifted blatdb or directory prefixes, publicMode on emitted lines, and the already-correct count. Done means the tests verify only actual differences produce updates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- perl
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100