Repository navigation
fix(code-index): place DAC2a destinations by graph type - #317
Merged
Merged
Conversation
The code index export writes the sorted graph types of every party, and the loader refuses a party row without them, so a release built before this change fails verification and is rebuilt before a deploy moves traffic.
destination_side reads each party's graph types: Country is bilateral, an official Organization multilateral, DACUnspecifiedParty residuals multilateral unless a bilateral total lists them, and DACRecipientUnallocatedByCountry residuals bilateral. Every destination total other than all recipients, all multilateral recipients and Organization-typed totals is bilateral. party_facts reads the Organization type instead of the entity resolver's organisation records. The hand-kept group totals, multilateral residuals and bilateral unallocated lists go.
A code index whose party rows carry no types is unreadable by this image, so the release format moves to 3 and each image reads its own pointer. The residuals bilateral totals list are memoised per index, the loader refuses a malformed types value, and prose that named the removed lists now names destination_side.
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.
code_index.scope_conventions.destination_sideplaces each DAC2a destination on the bilateral, multilateral or spanning side from the graph types the code index build already reads, so a recipient registered in Wikibase with its type needs no code edit. Each party row of the code index keeps its sorted graph types (PartyRow.types).Changes
code_index/export.pywrites each party's graph types, andcode_index/loader.pyrefuses a party row without a list of strings undertypes.graph_release.format.FORMATmoves to 3, since this image cannot read a release built without types.destination_sidetakes the code index and classifies a party typedCountryas bilateral and an officialOrganizationas multilateral. A residual is bilateral when a bilateral total lists it (the Mekong Delta Project, a residual of Asia), otherwise multilateral when typedDACUnspecifiedPartyand bilateral when typedDACRecipientUnallocatedByCountry. All recipients is spanning, all multilateral recipients andOrganization-typed totals are multilateral, and every other destination total is bilateral. The residuals bilateral totals list are memoised per index.multilaterals.party_factsreads theOrganizationtype instead of the entity resolver's organisation records (organisation_dcids, removed).DAC_BILATERAL_GROUP_TOTALS,DAC_MULTILATERAL_RECIPIENTS,DAC_BILATERAL_UNALLOCATED,_BILATERAL_TOTALSand_BILATERAL_RESIDUALS; the release declaration pins follow.DAC_BILATERAL_ORGANISATIONS(East African Community, Indus Basin Development Fund),REGION_NAMESandTOTAL_GROUPSstay.tests/fixtures/code_index/index.json.gzcarries the types of its 491 parties, read from the dev graph.Notes for reviewers
Organizationand missing from the resolver's organisation records, becomes a multilateral donor in Search.DACGroupreads as bilateral. If OECD adds a multilateral grouping as a total, it reads bilateral until it is typedOrganizationor handled here. Totals are never population members, so this cannot change a bilateral sum; it affects a request that names that total.no_pointerand the build publishes the first format-3 release before traffic moves. A hold on the format-2 pointer does not apply to format 3.Testing: targeted suites (tests/code_index, tests/graph_release, tests/scope/test_provider.py, the DAC2a engine, mint and materialise tests) pass locally; full suite on CI.