Add drift check for savings-fund onboarding documents#1555
Closed
stenehrlich-tuleva wants to merge 1 commit into
Closed
Add drift check for savings-fund onboarding documents#1555stenehrlich-tuleva wants to merge 1 commit into
stenehrlich-tuleva wants to merge 1 commit into
Conversation
The TKF onboarding signing step links to the fund's legal documents (terms, prospectus, key information). Those URLs were hardcoded and duplicated across both the individual and company onboarding flows, so they silently go stale whenever the documents are re-issued. Consolidate the three duplicated arrays into a single SAVINGS_FUND_DOCUMENTS constant, and add a check that compares the shipped URLs against the documents currently published on the public fund page via its ACF fields (terms_file / prospectus_file / key_investor_info_file). publishedDocumentsFromAcf fails closed if a field is missing or empty. The live comparison is a gated test (CHECK_PUBLISHED_DOCUMENTS=true) so it can run on a schedule without flaking normal CI. The shipped URLs are intentionally still the stale versions here; they are brought current via the content-update workflow, which turns the live check green. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1555 +/- ##
==========================================
- Coverage 81.96% 81.93% -0.03%
==========================================
Files 317 319 +2
Lines 6570 6605 +35
Branches 1437 1443 +6
==========================================
+ Hits 5385 5412 +27
- Misses 797 804 +7
- Partials 388 389 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Closing this drift-check approach. For now the stale links are fixed by the interim PR #1558 (bumps both onboarding flows to the in-force Feb 2026 documents), and the broader WordPress-backed solution is parked on branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Täiendav Kogumisfond onboarding signing step links to the fund's legal documents (terms, prospectus, key information). Those URLs were hardcoded and duplicated across both the individual and company onboarding flows, so they silently go stale whenever the documents are re-issued (they currently point at the
12.01.2026versions, which have since been superseded).This PR:
SAVINGS_FUND_DOCUMENTSconstant (used by both flows and the test).savingsFundDocumentsCheck.ts) that compares the shipped URLs against the documents currently published on the public fund page, read straight from its ACF fields (terms_file/prospectus_file/key_investor_info_file).publishedDocumentsFromAcffails closed if a field is missing or empty.savingsFundDocumentsCheck.live.test.ts) that runs only whenCHECK_PUBLISHED_DOCUMENTS=true, so it can run on a schedule without flaking normal CI.Note
The shipped URLs are intentionally still the stale versions in this PR — this lands the safety net first. They're brought current via the content-update workflow (separate step), which turns the live check green.
Depends on
show_in_reston the documents ACF group so the live check can read those fields over REST.Test plan
savingsFundDocumentsCheck.test.tsunit tests (extraction, fail-closed, shipped mapping) — green.build/test).CHECK_PUBLISHED_DOCUMENTS=true TZ=UTC npx react-scripts test --testPathPattern=savingsFundDocumentsCheck.live(meaningful once the wordpress-theme change is deployed).Refs TulevaEE/TKF-VPII2026#63
🤖 Generated with Claude Code