-
Notifications
You must be signed in to change notification settings - Fork 0
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
All the fixes introduced while testing the production deployments #93
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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,272 @@ | ||
{ | ||
"id" : "628b28d6-9c26-11ef-948d-0b2d405fc82f", | ||
"name" : "Test Coda Metadata Schema", | ||
"instrument": "coda", | ||
"selector": "filename:starts_with:/ess/services/scicat-ingestor/software/test-data/small-coda", | ||
"order": 110, | ||
"variables" : { | ||
"job_id": { | ||
"source": "NXS", | ||
"path": "/entry/entry_identifier_uuid", | ||
"value_type": "string" | ||
}, | ||
"pid": { | ||
"source": "VALUE", | ||
"value": "20.500.12269/<ingestor_run_id>", | ||
"value_type": "string" | ||
}, | ||
"proposal_id": { | ||
"source": "NXS", | ||
"path": "/entry/experiment_identifier", | ||
"value_type": "string" | ||
}, | ||
"proposal_data": { | ||
"source": "SC", | ||
"url": "proposals/<proposal_id>", | ||
"field" : "", | ||
"value_type": "dict" | ||
}, | ||
"pi_firstname": { | ||
"source": "VALUE", | ||
"operator": "getitem", | ||
"value": "<proposal_data>", | ||
"field" : "pi_firstname", | ||
"value_type": "string" | ||
}, | ||
"pi_lastname": { | ||
"source": "VALUE", | ||
"operator": "getitem", | ||
"value": "<proposal_data>", | ||
"field" : "pi_lastname", | ||
"value_type": "string" | ||
}, | ||
"pi_email": { | ||
"source": "VALUE", | ||
"operator": "getitem", | ||
"value": "<proposal_data>", | ||
"field" : "pi_email", | ||
"value_type": "string" | ||
}, | ||
"dataset_original_name": { | ||
"source": "NXS", | ||
"path": "/entry/title", | ||
"value_type": "string" | ||
}, | ||
"dataset_name": { | ||
"source": "VALUE", | ||
"value" : "coda test - <dataset_original_name> - <ingestor_run_id>", | ||
"value_type": "string" | ||
}, | ||
"instrument_name": { | ||
"source": "NXS", | ||
"path": "/entry/instrument/name", | ||
"value_type": "string" | ||
}, | ||
"instruments_data": { | ||
"source": "SC", | ||
"url": "instruments?filter=%7B%22where%22%20%3A%20%7B%20%22name%22%20%3A%20%22coda%22%20%7D%20%7D", | ||
"field": "", | ||
"value_type": "list" | ||
}, | ||
"instrument_data": { | ||
"source": "VALUE", | ||
"operator": "getitem", | ||
"value": "<instruments_data>", | ||
"field" : 0, | ||
"value_type": "dict" | ||
}, | ||
"instrument_id": { | ||
"source": "VALUE", | ||
"operator": "getitem", | ||
"value": "<instrument_data>", | ||
"field" : "id", | ||
"value_type": "string" | ||
}, | ||
"start_time": { | ||
"source": "NXS", | ||
"path": "/entry/start_time", | ||
"value_type": "date" | ||
}, | ||
"end_time": { | ||
"source": "NXS", | ||
"path": "/entry/end_time", | ||
"value_type": "date" | ||
}, | ||
"run_number": { | ||
"source": "NXS", | ||
"path": "/entry/entry_identifier", | ||
"value_type": "integer" | ||
}, | ||
"acquisition_team_members_list": { | ||
"source": "NXS", | ||
"path" : "/entry/user_*/name", | ||
"value_type": "string[]" | ||
}, | ||
"acquisition_team_members": { | ||
"source": "VALUE", | ||
"operator" : "join_with_space", | ||
"value" : "<acquisition_team_members_list>", | ||
"value_type": "string" | ||
}, | ||
"owner_group": { | ||
"source": "VALUE", | ||
"value": "<proposal_id>", | ||
"value_type": "string" | ||
}, | ||
"access_groups": { | ||
"source": "VALUE", | ||
"value": ["scientific information management systems group"], | ||
"value_type": "string[]" | ||
}, | ||
"source_folder": { | ||
"source": "VALUE", | ||
"operator": "dirname", | ||
"value": "<filepath>", | ||
"value_type": "string" | ||
}, | ||
"keywords" : { | ||
"source": "VALUE", | ||
"value": ["TEST CODA","Scicat Ingestor 05","TEST RUN","CODA","<instrument_name>","CODA <instrument_name>"], | ||
"value_type": "string[]" | ||
} | ||
}, | ||
"schema": { | ||
"pid": { | ||
"field_type": "high_level", | ||
"machine_name": "pid", | ||
"value": "<pid>", | ||
"type": "string" | ||
}, | ||
"type" : { | ||
"field_type": "high_level", | ||
"machine_name": "type", | ||
"value": "raw", | ||
"type": "string" | ||
}, | ||
"proposal_id": { | ||
"field_type": "high_level", | ||
"machine_name": "proposalId", | ||
"value": "<proposal_id>", | ||
"type": "string" | ||
}, | ||
"dataset_name": { | ||
"field_type": "high_level", | ||
"machine_name": "datasetName", | ||
"value": "<dataset_name>", | ||
"type": "string" | ||
}, | ||
"principal_investigator": { | ||
"field_type": "high_level", | ||
"machine_name": "principalInvestigator", | ||
"value": "<pi_firstname> <pi_lastname>", | ||
"type": "string" | ||
}, | ||
"owner": { | ||
"field_type": "high_level", | ||
"machine_name": "owner", | ||
"value": "<pi_firstname> <pi_lastname>", | ||
"type": "string" | ||
}, | ||
"owner_email": { | ||
"field_type": "high_level", | ||
"machine_name": "ownerEmail", | ||
"value": "<pi_email>", | ||
"type": "email" | ||
}, | ||
"contact_email": { | ||
"field_type": "high_level", | ||
"machine_name": "contactEmail", | ||
"value": "<pi_email>", | ||
"type": "email" | ||
}, | ||
"instrument_id": { | ||
"field_type": "high_level", | ||
"machine_name": "instrumentId", | ||
"value": "<instrument_id>", | ||
"type": "string" | ||
}, | ||
"creation_location": { | ||
"field_type": "high_level", | ||
"machine_name": "creationLocation", | ||
"value": "ESS:CODA:<instrument_name>", | ||
"type": "string" | ||
}, | ||
"start_time_hl": { | ||
"field_type": "high_level", | ||
"machine_name": "startTime", | ||
"value": "<start_time>", | ||
"type": "date" | ||
}, | ||
"end_time_hl": { | ||
"field_type": "high_level", | ||
"machine_name": "endTime", | ||
"value": "<end_time>", | ||
"type": "date" | ||
}, | ||
"start_time_sm": { | ||
"field_type": "scientific_metadata", | ||
"machine_name": "start_time", | ||
"human_name": "Start Time", | ||
"value": "<start_time>", | ||
"type": "date" | ||
}, | ||
"end_time_sm": { | ||
"field_type": "scientific_metadata", | ||
"machine_name": "end_time", | ||
"human_name": "End Time", | ||
"value": "<end_time>", | ||
"type": "date" | ||
}, | ||
"run_number_sm": { | ||
"field_type": "scientific_metadata", | ||
"machine_name": "run_number", | ||
"human_name": "Run Number", | ||
"value": "<run_number>", | ||
"type": "integer" | ||
}, | ||
"job_id": { | ||
"field_type": "scientific_metadata", | ||
"machine_name": "job_id", | ||
"human_name": "ESS Data Collection Job Id", | ||
"value": "<job_id>", | ||
"type": "string" | ||
}, | ||
"acquisition_team_members": { | ||
"field_type": "scientific_metadata", | ||
"machine_name": "acquisition_team_members", | ||
"human_name": "Acquisition Team Members", | ||
"value": "<acquisition_team_members>", | ||
"type": "string" | ||
}, | ||
"owner_group": { | ||
"field_type": "high_level", | ||
"machine_name": "ownerGroup", | ||
"value": "<owner_group>", | ||
"type": "string" | ||
}, | ||
"access_groups": { | ||
"field_type": "high_level", | ||
"machine_name": "accessGroups", | ||
"value": "<access_groups>", | ||
"type": "string[]" | ||
}, | ||
"source_folder": { | ||
"field_type": "high_level", | ||
"machine_name": "sourceFolder", | ||
"value": "<source_folder>", | ||
"type": "string" | ||
}, | ||
"creation_time": { | ||
"field_type": "high_level", | ||
"machine_name": "creationTime", | ||
"value": "<now>", | ||
"type": "date" | ||
}, | ||
"keywords": { | ||
"field_type": "high_level", | ||
"machine_name": "keywords", | ||
"value": "<keywords>", | ||
"type": "string[]" | ||
} | ||
} | ||
} |
This file contains 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 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 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 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 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
File renamed without changes.
File renamed without changes.
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.
I'm not sure about the intention here. Can you elaborate more? @nitrosx
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.
In some cases, the variable value (aka var_value) is a list or a dict.
When that is the case, the variable value is converted to a json string, the substitution is executed and converted back to the original type.
Basically it is a trick to perform nested substitutions without traversing the whole nested structure.
Check also line 149.
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.
Ah it's making the string dumped
output_value
back to a dictionary/list. I see...It sounds like a bit of hack but it won't be a problem since
>
and<
are not easy to be mistaken with other symbols used in list or dictionary but we'd better document it.I'll do it in another PR with some unit tests.