-
Notifications
You must be signed in to change notification settings - Fork 6
[FIX] sync curation extraction #1248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
33bc2e7
track curation_uuid in studyset_study
jdkent 7c19ff1
modify frontend to accomodate exporting curation_uuid
jdkent 76a41db
make sure stub follows user specified changes
jdkent 8f05eb4
update openapi
jdkent 2d25d31
fix tests in neurostore
jdkent e1dd796
fix revision
jdkent c668e7f
fix ingestion test
jdkent 66f38b2
expose studyset_studies
jdkent ef92015
refactor
jdkent 0e77732
fix cypress test
jdkent e011869
suppress warnings with overlaps
jdkent 01ea6aa
try to fix ingestion test
jdkent 277e332
fix cypress test
jdkent d39b0c9
use the stub_uuid
jdkent 9383f80
fix more blind spots
jdkent 91f4693
update studyset_study PUT logic
jdkent e0b7d03
fix the extraction logic
jdkent d355a6e
maybe fix
jdkent 5c17ebf
add test that emulates the change
jdkent 9bd199c
change the logic of ingestion
jdkent 8869696
undo unnecessary changes
jdkent 612f569
fix style issues
jdkent 8bd8c33
fix data check guards
jdkent c16539c
add script and fix tests
jdkent 8052574
fix style
jdkent 1949a9e
make base study call more friendly
jdkent 96aa675
fix the frontend client api usage
jdkent 4278624
review of code
jdkent 27f6369
fix style
jdkent b9cea5a
fix style again
jdkent 9f723e4
remove redundant code
jdkent c60150a
Apply suggestions from code review
jdkent 0b86b2c
fix line length issue
jdkent 33ff8c4
do not use overlaps, be explicit about purpose of columns
jdkent d903f00
Update store/backend/migrations/versions/8e3f3d8a9b5b_add_curation_st…
jdkent e284036
realign the basestudies endpoint
jdkent 82dfb37
fix linting errors
jdkent 34c8d7d
fix: minor code improvements, remove unused code
nicoalee 7de1401
remove curation_stub_map from public api
jdkent 7841dc7
remove unused index
jdkent a4a063c
fix: remove unused imports
nicoalee d17e769
fix backfill script
jdkent 89cf2fe
assume postgres port
jdkent 6423e8e
arguments were not aligned to create a project
jdkent 055a464
fix backfill script
jdkent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
43 changes: 43 additions & 0 deletions
43
compose/neurosynth-frontend/src/helpers/Extraction.helpers.spec.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import { describe, expect, it } from 'vitest'; | ||
| import { mapStubsToStudysetPayload } from './Extraction.helpers'; | ||
| import { BaseStudyReturn, StudyReturn } from 'neurostore-typescript-sdk'; | ||
|
|
||
| const makeBaseStudy = (id: string, versionIds: string[]): BaseStudyReturn => ({ | ||
| id, | ||
| versions: versionIds.map<StudyReturn>((vid, idx) => ({ | ||
| id: vid, | ||
| updated_at: idx.toString(), // for sorting fallback | ||
| })), | ||
| }); | ||
|
|
||
| describe('mapStubsToStudysetPayload', () => { | ||
| it('zips stubs to base studies by index and carries stub UUIDs', () => { | ||
| const stubs = [{ id: 'stub-1' }, { id: 'stub-2' }]; | ||
| const baseStudies: Array<BaseStudyReturn> = [makeBaseStudy('bs1', ['v1a']), makeBaseStudy('bs2', ['v2a'])]; | ||
|
|
||
| const payload = mapStubsToStudysetPayload(stubs, baseStudies); | ||
| expect(payload).toEqual([ | ||
| { id: 'v1a', curation_stub_uuid: 'stub-1' }, | ||
| { id: 'v2a', curation_stub_uuid: 'stub-2' }, | ||
| ]); | ||
| }); | ||
|
|
||
| it('prefers an existing study ID when present', () => { | ||
| const stubs = [{ id: 'stub-1' }]; | ||
| const existing = new Set<string>(['existing-id']); | ||
| const baseStudies: Array<BaseStudyReturn> = [makeBaseStudy('bs1', ['existing-id', 'new-id'])]; | ||
|
|
||
| const payload = mapStubsToStudysetPayload(stubs, baseStudies, existing); | ||
| expect(payload[0]).toEqual({ id: 'existing-id', curation_stub_uuid: 'stub-1' }); | ||
| }); | ||
|
|
||
| it('returns the locked existing mapping even if ingest lacks that version', () => { | ||
| const stubs = [{ id: 'stub-1' }]; | ||
| // ingest returned only a different version | ||
| const baseStudies: Array<BaseStudyReturn> = [makeBaseStudy('bs1', ['different-id'])]; | ||
| const lockedMap = new Map<string, string>([['stub-1', 'existing-id']]); | ||
|
|
||
| const payload = mapStubsToStudysetPayload(stubs, baseStudies, undefined, lockedMap); | ||
| expect(payload[0]).toEqual({ id: 'existing-id', curation_stub_uuid: 'stub-1' }); | ||
| }); | ||
| }); |
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
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
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
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
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
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
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
46 changes: 0 additions & 46 deletions
46
compose/neurosynth-frontend/src/hooks/studysets/useGetStudysets.tsx
This file was deleted.
Oops, something went wrong.
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
Submodule neurostore-typescript-sdk
updated
123 files
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Three undefined parameters suggest the API signature may have changed. Consider using named parameters or an options object to make the call site more maintainable and less error-prone.