feat: Data API (rescued from dev before reset) - #1059
Draft
rdahis wants to merge 11 commits into
Draft
Conversation
(cherry picked from commit 435b250)
(cherry picked from commit bdd3ba3)
(cherry picked from commit 0fc037f)
(cherry picked from commit ec6adf8)
(cherry picked from commit 49598f2)
(cherry picked from commit 3cc6056)
(cherry picked from commit 51f6df0)
(cherry picked from commit f865310)
(cherry picked from commit 2111338)
(cherry picked from commit 4e3adb6)
(cherry picked from commit 021d080)
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.
Purpose
Rescue the Data API backend work onto a
main-based branch beforedevis reset.The feature was developed in Feb–May 2025 and never reached production: its commits exist only on
origin/dev, which diverged frommainunder the old workflow and is scheduled to be reset. Thedata_apiapp is present on neithermainnorstaging.Draft on purpose. Per Git Flow this must be validated via PRs into
developmentandstagingfirst. Those will be opened once the branches are reset; this PR stays in draft until then and merges intomainlast.Description
11 commits cherry-picked with
-xfromorigin/dev, oldest→newest, original authorship preserved:435b250bdd3ba30fc037fec6adf849598f23cc605651f6df0f86531021113384e3adb6021d080Adds the
data_apiapp (models, admin, GraphQL, views, URLs, decorators, translation) and wires it intoINSTALLED_APPS, the GraphQL schema, and root URLs. AddsDataset.contains_data_api_endpoint_tablesandTable.is_data_api_endpoint, with the corresponding search index field and a search filter excluding endpoint-only datasets.Includes a model rename
435b250also carriesKey→DictionaryKeyinapi/v1, plus migration0056. This is kept deliberately: the newdata_apiapp defines its ownKeymodel, and without the rename Django admin shows two separate "Keys" sections. There is no database-level collision (data_api.Keydefaults to tabledata_api_key;v1.Keyusedkeys), so this is a clarity change rather than a required one — but0056renames a live table, which is the main thing to scrutinise here.Conflict resolutions worth reviewing
mainhas moved substantially since these commits. Conflicts were resolved surgically rather than by taking the incoming side wholesale, which would have revertedmain's work (e.g.admin.pydrifted 227+/41−,search_views.py199+/117−).api/v1/models.py— all 5 conflicts weremain-side caching/formatting drift with no Data API content;mainkept in full.api/v1/search_views.py— applied only theexclude(...)filter; deliberately did not restore theDEBUG: Form dataprint()block thatmainremoved.api/v1/admin.py— keptmain's trimmed field lists, adding only the Data API entries.apps/schema.py— registereddata_apiwhile keepingmain'sUserNotificationQuery.migrations/0054_alter_organization_area.py— keptmain's copy; the two differed only in a header comment.Migration chain lands cleanly:
data_api/0001depends onv1.0054and0056depends on0055, both already onmain.Checklist
Testing and evidence
Verified so far: all changed Python files compile; no conflict markers remain; migration dependency chain resolves against
main. Not yet run: migrations against a database, or the test suite. Both should happen on thedevelopmentPR.Next steps
devis reset.developmentandstaging; validate there — in particular the0056table rename.mainlast.Paired with the website-side PR in
basedosdados/website.🤖 Generated with Claude Code