Skip to content

Fix: Exclude seed models from default plan end date calculation#5720

Merged
themisvaltinos merged 3 commits intomainfrom
themis/seed_end
Mar 6, 2026
Merged

Fix: Exclude seed models from default plan end date calculation#5720
themisvaltinos merged 3 commits intomainfrom
themis/seed_end

Conversation

@themisvaltinos
Copy link
Contributor

Seed models are evaluated when first loaded and their interval end is set at that point. This might become a problem when a pr introduces a new model that depends on an existing seed. in that case the seed is the only model with intervals in prod so its stale interval end becomes the default plan end date. Now if default_pr_start is configured (say "6 days ago" or a specific hardcoded value) it can resolve to a timestamp newer than the seeds frozen interval end causing the plan to fail with:

PlanError: Plan end date: '2025-03-03 00:00:00' must be after the plan start date: '2026-01-04 00:00:00'

This excludes the seed models intervals from the default end calculation to avoid this, the test shows an example of how this can happen.

@themisvaltinos themisvaltinos requested a review from a team March 5, 2026 20:32
assert max_ends[seed_fqns[0]] == to_timestamp("2024-06-01")

# the plan start date 2025-01-01 is after the seeds end date but shouldnt cause the plan to fail
context.plan(
Copy link
Collaborator

Choose a reason for hiding this comment

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

This test could be improved by inspecting the Plan object returned from context.plan() and verifying what dates it used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point added to check the dates from the plan

@themisvaltinos themisvaltinos merged commit 6e69ce6 into main Mar 6, 2026
36 checks passed
@themisvaltinos themisvaltinos deleted the themis/seed_end branch March 6, 2026 08:19
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