Skip to content
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

[ENH] Automated upload functionality #107

Merged
merged 98 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
e03f46e
Test `fetch-repos` workflow
rmanaem Aug 23, 2024
7fa28a8
Added `fetch-repos` script
rmanaem Aug 23, 2024
531fe8b
Updated `fetch-repos` workflow
rmanaem Aug 23, 2024
4d4213b
Checking the working directory
rmanaem Aug 23, 2024
3964769
Find the working directory
rmanaem Aug 23, 2024
67b4951
Use `actions/checkout@v4`
rmanaem Aug 23, 2024
9d7b942
Fixed the pathing issue
rmanaem Aug 23, 2024
b5cd3ff
Save output file in static folder
rmanaem Aug 23, 2024
fe9a534
Fixed the `GITHUB_TOKEN` env
rmanaem Aug 23, 2024
d6a1076
Testing pushing without GH TOKEN
rmanaem Aug 23, 2024
a58e593
Trying something
rmanaem Aug 23, 2024
03724e3
Using NB_PR_PAT
rmanaem Aug 23, 2024
4562c25
Using `NB_PROJECT_PAT`
rmanaem Aug 23, 2024
1c23976
Push to feat-80
rmanaem Aug 23, 2024
fe52ee7
Trying something
rmanaem Aug 23, 2024
f14cc51
Got new error, making progress
rmanaem Aug 23, 2024
a6e8af3
This might be it
rmanaem Aug 23, 2024
75b5eae
Using `GITHUB_TOKEN`
rmanaem Aug 23, 2024
c968a7e
Another attempt
rmanaem Aug 23, 2024
68c494d
Does this work?
rmanaem Aug 23, 2024
67a681f
Updated repos.json with latest repository names
github-actions[bot] Aug 23, 2024
0b7e077
Iterating
rmanaem Aug 23, 2024
4ace7ff
[BOT] Updated repos.json with latest repository names
neurobagel-bot[bot] Aug 23, 2024
167afff
Trying to get the bot name right
rmanaem Aug 23, 2024
b3ca462
[BOT] Updated repos.json with latest repository names
Aug 23, 2024
ddb99db
[BOT] Updated repos.json with latest repository names
Aug 23, 2024
0fc6327
Trying to get the bot name right
neurobagel-bot[bot] Aug 23, 2024
e7e3d7e
Updated `fetch-repo` script to check annotation status
rmanaem Aug 24, 2024
c14f14a
Updated `fetch-repos` script
neurobagel-bot[bot] Aug 24, 2024
f3ee1c8
Updated repos.json with latest repository names
neurobagel-bot[bot] Aug 24, 2024
ca1aa99
Added debug log
rmanaem Aug 24, 2024
ee7d72b
Why is json coming out empty?
rmanaem Aug 24, 2024
5aa5f66
Updated repos.json with latest repository names
neurobagel-bot[bot] Aug 24, 2024
1d8e16e
Trying something
rmanaem Aug 24, 2024
51da91d
Updated repos.json with latest repository names
neurobagel-bot[bot] Aug 24, 2024
ff3f814
Trying something else
rmanaem Aug 24, 2024
d30e797
Updated repos.json with latest repository names
neurobagel-bot[bot] Aug 24, 2024
f9bb5bd
Added check for valid json response from GH API
rmanaem Aug 24, 2024
af9e3e0
Updated repos.json with latest repository names
neurobagel-bot[bot] Aug 24, 2024
9a9f19f
Trying something
rmanaem Aug 24, 2024
2eb0127
Try this
rmanaem Aug 24, 2024
9f00144
Updated repos.json with latest repository names
neurobagel-bot[bot] Aug 24, 2024
ba6a53c
Updated `fetch-repos` workflow file
rmanaem Aug 27, 2024
ac4b21c
Implemented `Upload` component
rmanaem Aug 27, 2024
7a1f278
Updated `simple` e2e test
rmanaem Aug 27, 2024
e4c4242
Fetch participants.tsv and participants.json
rmanaem Aug 27, 2024
977c14c
Try this
rmanaem Aug 27, 2024
161afee
Updated repos.json
neurobagel-bot[bot] Aug 27, 2024
df2a2e2
Updated `fetch-repos` script
rmanaem Aug 27, 2024
7e87d00
Updated repos.json
neurobagel-bot[bot] Aug 27, 2024
928de12
Implemented `RepoCard` component
rmanaem Aug 28, 2024
5084b45
Implemented `CardContainer` component
rmanaem Aug 28, 2024
eabbe42
Implemented `RepoInfo` interface
rmanaem Aug 28, 2024
8c1c8fb
Implemented filtering functionality
rmanaem Aug 29, 2024
2ba1020
Implemented `InstructionsDialog` component
rmanaem Aug 29, 2024
4f57f57
Added instructions dialog and number of available datasets
rmanaem Aug 29, 2024
5916dbc
Implemented `Download` component
rmanaem Aug 29, 2024
56eac25
Addressed linting errors
rmanaem Aug 29, 2024
60671fa
Implemented tabs
rmanaem Aug 29, 2024
72ce403
Refactored `RepoCard` and added link to the jsonld files
rmanaem Aug 29, 2024
4c82c26
See if this works
rmanaem Aug 29, 2024
8f7c437
Updated repos.json
neurobagel-bot[bot] Aug 29, 2024
30dd4bc
That works reverting unnecessary changes
rmanaem Aug 29, 2024
d23bd91
Updated repos.json
neurobagel-bot[bot] Aug 30, 2024
345f3f3
Update `fetch-repos` workflow file
rmanaem Aug 30, 2024
ad3b169
Refactored `RepoCard` and implemented error handling
rmanaem Aug 30, 2024
e2f2df4
Implemented error handling
rmanaem Aug 30, 2024
ae6e83a
Merge branch 'main' into feat-80
rmanaem Sep 3, 2024
4c42e05
Merge branch 'main' into feat-80
rmanaem Sep 3, 2024
ac935a4
Fixed a typo in condition
rmanaem Sep 3, 2024
7114119
Implemented `DownloadIcon`
rmanaem Sep 4, 2024
c36eb10
Implemented form for upload workflow
rmanaem Sep 4, 2024
3063180
Refactored `CardContainer` component
rmanaem Sep 4, 2024
3a6b668
Implemented `Navbar` component
rmanaem Sep 5, 2024
3f7a70b
Fixed the Navbar title and badge layout
rmanaem Sep 5, 2024
8fe082e
Fixed the alert toggling bug
rmanaem Sep 5, 2024
44edb29
Implemented routing and removed tabs
rmanaem Sep 5, 2024
88a3af8
Made `InstructionDialog` component generic and renamed to `NBDialog`
rmanaem Sep 5, 2024
4ae0470
Implemented `Instructions` component
rmanaem Sep 5, 2024
39401bf
Updated `CardContainer` component
rmanaem Sep 5, 2024
d4fa6e2
Small change
rmanaem Sep 5, 2024
9748f69
Implemented upload button
rmanaem Sep 5, 2024
5ba9815
Removed links
rmanaem Sep 5, 2024
29ca8a7
Refactored `Upload` component
rmanaem Sep 5, 2024
e101b8b
Integrated `Upload` component in `NBDialog` as part of `RepoCard`
rmanaem Sep 5, 2024
e94b886
Refactored relevant components to reflect the new changes
rmanaem Sep 5, 2024
b06d495
Fixed the readOnly issue with the repo name field
rmanaem Sep 5, 2024
fc3785b
Updated Upload dialog title
rmanaem Sep 5, 2024
05687b6
Implemented Affiliations field
rmanaem Sep 5, 2024
5ce3286
Renamed `Upload` component to `UploadForm`
rmanaem Sep 5, 2024
6ccb90d
Updated `simple` e2e test
rmanaem Sep 5, 2024
085652c
Fixed the performance issue via virtualization
rmanaem Sep 5, 2024
1d6b422
Merge branch 'main' into feat-91
rmanaem Sep 23, 2024
7911142
Updated `UploadForm` component
rmanaem Sep 23, 2024
4e71d32
Implemented a progress bar and success status for the submit button
rmanaem Sep 23, 2024
7089982
Implemented alert to display PR link in case of successful upload
rmanaem Sep 23, 2024
12a7e9e
Addressed PR comments
rmanaem Sep 24, 2024
8ac420b
Implemented `APIRequests` test
rmanaem Sep 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export default defineConfig({
e2e: {
experimentalStudio: true,
baseUrl: 'http://localhost:5173',
viewportWidth: 1920,
viewportHeight: 1080,
setupNodeEvents(on, config) {
codeCoverageTask(on, config);
return config;
Expand Down
45 changes: 45 additions & 0 deletions cypress/e2e/APIRequests.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { successResponse } from 'cypress/fixtures/mocked-responses';

describe('API Requests', () => {
it('Tests the upload request with a mock response and inspects the request body', () => {
cy.intercept(
{
method: 'PUT',
url: '/openneuro/upload*',
},
(req) => {
req.reply(successResponse);
}
).as('uploadFile');

cy.visit('http://localhost:5173');

cy.get('[data-cy="upload-ds000001-button"]').click();
cy.get('[data-cy="user-name-field"]').type('John Doe');
cy.get('[data-cy="email-field"]').type('[email protected]');
cy.get('[data-cy="changes-summary-field"]').type('This is a summary of the changes');

cy.get('input[type="file"]').attachFile('participants.json');

cy.contains('File uploaded: participants.json');

cy.get('[data-cy="submit-button"]').click();

cy.wait('@uploadFile').then((interception) => {
const requestBody = interception.request.body;

expect(requestBody).to.include(
'Content-Disposition: form-data; name="data_dictionary"; filename="participants.json"'
);

expect(requestBody).to.include('Content-Disposition: form-data; name="name"');
expect(requestBody).to.include('John Doe');

expect(requestBody).to.include('Content-Disposition: form-data; name="email"');
expect(requestBody).to.include('[email protected]');

expect(requestBody).to.include('Content-Disposition: form-data; name="changes_summary"');
expect(requestBody).to.include('This is a summary of the changes');
});
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/simple.cy.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
describe('Simple Test', () => {
it('Renders elements', () => {
cy.visit('http://localhost:5173');
cy.get('[data-cy="upload-tab"]').click();
cy.get('[data-cy="dataset-id-field"]').should('be.visible');
cy.get('[data-cy="upload-ds000001-button"]').click();
cy.get('[data-cy="repo-name-field"]').should('be.visible');
cy.get('[data-cy="upload-file-button"]').should('be.visible');
cy.get('[data-cy="submit-button"]').should('be.visible');
});
Expand Down
4 changes: 4 additions & 0 deletions cypress/fixtures/mocked-responses.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const successResponse = {
pull_request_url: 'https://someurl.com',
message: 'Successfully uploaded file to OpenNeuroDatasets-JSONLD.',
};
49 changes: 49 additions & 0 deletions cypress/fixtures/participants.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"age": {
"Annotations": {
"IsAbout": {
"TermURL": "nb:Age",
"Label": ""
},
"Transformation": {
"TermURL": "nb:FromInt",
"Label": "integer data"
},
"MissingValues": ["", "n/a", " "]
},
"Description": "There should have been a description here, but there wasn't. :("
},
"participant_id": {
"Annotations": {
"IsAbout": {
"TermURL": "nb:ParticipantID",
"Label": ""
},
"Identifies": "participant"
},
"Description": "There should have been a description here, but there wasn't. :("
},
"sex": {
"Annotations": {
"IsAbout": {
"TermURL": "nb:Sex",
"Label": ""
},
"Levels": {
"F": {
"TermURL": "snomed:248152002",
"Label": ""
},
"M": {
"TermURL": "snomed:248153007",
"Label": ""
},
"M,": {
"TermURL": "snomed:248153007",
"Label": ""
}
}
},
"Description": "There should have been a description here, but there wasn't. :("
}
}
2 changes: 2 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@
// }
// }
// }

import 'cypress-file-upload';
Loading