Skip to content

[phylo automation] run only builds for species with new data#72

Open
jameshadfield wants to merge 2 commits into
mainfrom
fix-rebuild-action
Open

[phylo automation] run only builds for species with new data#72
jameshadfield wants to merge 2 commits into
mainfrom
fix-rebuild-action

Conversation

@jameshadfield

@jameshadfield jameshadfield commented Jul 6, 2026

Copy link
Copy Markdown
Member

Previously the check-new-data job only checked the ebov metadata for updates and, on any change, triggered a phylogenetic run of all builds. Now that bdbv, sudv and ebov are all uploaded by ingest, check each species independently and run only the builds for species whose data actually changed. A workflow_dispatch still forces every build to run.

Relatedly, for each species there's now two metadata files _open and _restricted, so we get the hash for each and join them together.

Closes #71

@joverlee521 @victorlin would you mind taking a quick look? I don't think we've used this exact approach elsewhere

@victorlin victorlin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement 👍

Comment on lines +88 to +89
for access in open restricted; do
key="files/workflows/ebola/${species}/metadata_${access}.tsv.zst"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should FASTA be checked too, like in many other repos?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought (but should check!) that any sequence updates would get a PPX version bump and therefore a new metadata hash. Let me confirm this, otherwise yes I'll check the FASTA

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if that's how it's supposed to work, why not add the extra few lines of code to check anyways ("trust but verify")? head-object is cheap.

If we stick with metadata-only checks here, let's have a comment explaining why and do the same for other repos that source from Pathoplexus.

Comment thread .github/workflows/ingest-to-phylogenetic.yaml Outdated
Comment on lines +139 to +149
# A workflow_dispatch forces every build to run; otherwise only run the
# builds for species whose metadata hash changed (i.e. a cache miss).
if [[ "$IS_DISPATCH" == "true" || "$BDBV_HIT" != "true" ]]; then
builds+=(bdbv/all-outbreaks bdbv/drc-uganda-2026)
fi
if [[ "$IS_DISPATCH" == "true" || "$SUDV_HIT" != "true" ]]; then
builds+=(sudv/all-outbreaks)
fi
if [[ "$IS_DISPATCH" == "true" || "$EBOV_HIT" != "true" ]]; then
builds+=(ebov/all-outbreaks)
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I wish we didn't have to maintain this list of builds. It's easy enough to fix, but someone has to notice the automated runs didn't include the expected builds.

Slightly more complicated, but we could parse the builds in build-configs/nextstrain-automation/config.yaml and remove by species prefix. Then we'd only have to maintain the single list in the config.yaml.

@jameshadfield jameshadfield Jul 6, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, claude had suggested this during this work but I felt it was simpler to duplicate the builds. Let me actually prototype the alternative before deciding.

The alternative is to actions/checkout in check-new-data and derive builds by filtering config.yaml's builds list by species prefix — more robust to build additions (e.g. a future bdbv/… build would be picked up automatically), but adds a checkout + a YAML parser (yq) to a job that currently checks out nothing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of b06f774? A little more bash magic than I'd write myself (e.g. mapfile) but I think the complexity is manageable and well documented

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, seems reasonable to me. (I've only seen readarray, but it's just an alias for mapfile.)

jameshadfield and others added 2 commits July 7, 2026 10:36
Previously the check-new-data job only checked the ebov metadata for
updates and, on any change, triggered a phylogenetic run of all builds.
Now that bdbv, sudv and ebov are all uploaded by ingest, check each
species independently and run only the builds for species whose data
actually changed. A workflow_dispatch still forces every build to run.

Relatedly, "ebov metadata" refers to two files _open and _restricted,
so we get the hash for each and join them together.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
As suggested in review [1], we can avoid duplicating the builds by filtering the
config-defined builds by their species prefix

[1] #72 (comment)
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.

Fix ingest-to-phylo stale data check

3 participants