-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from Materials-Consortia/index_meta_db
Implement an Index meta-database. This may be run as a second parallel server.
- Loading branch information
Showing
25 changed files
with
2,639 additions
and
143 deletions.
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,3 @@ | ||
#!/bin/bash | ||
# Note: This returns exit code 0, if the two specs agree, otherwise exit code 1 | ||
docker run -t -v $(pwd):/specs:ro quen2404/openapi-diff /specs/index_openapi.json /specs/local_index_openapi.json |
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 |
---|---|---|
@@ -1,7 +1,16 @@ | ||
#!/bin/bash | ||
python -c "from optimade.server.main import app, update_schema; update_schema(app)" | ||
python -c "from optimade.server.main_index import app, update_schema; update_schema(app)" | ||
|
||
diff=$(jsondiff openapi.json local_openapi.json); | ||
index_diff=$(jsondiff index_openapi.json local_index_openapi.json); | ||
|
||
if [ ! "$diff" = "{}" ]; then | ||
echo -e "Generated OpenAPI spec did not match committed version.\nRun 'invoke update_openapijson' and re-commit.\nDiff:\n$diff"; | ||
echo -e "Generated OpenAPI spec for test server did not match committed version.\nRun 'invoke update_openapijson' and re-commit.\nDiff:\n$diff"; | ||
exit 1; | ||
fi | ||
|
||
if [ ! "$index_diff" = "{}" ]; then | ||
echo -e "Generated OpenAPI spec for Index meta-database did not match committed version.\nRun 'invoke update_openapijson' and re-commit.\nDiff:\n$index_diff"; | ||
exit 1; | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,3 +115,5 @@ venv.bak/ | |
|
||
Untitled.ipynb | ||
local_openapi.json | ||
local_index_openapi.json | ||
server.cfg |
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 |
---|---|---|
@@ -1,13 +1,25 @@ | ||
default_language_version: | ||
python: python3.7 | ||
|
||
repos: | ||
- repo: https://github.com/ambv/black | ||
rev: stable | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/ambv/black | ||
rev: stable | ||
hooks: | ||
- id: black | ||
name: Blacken | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
exclude: README.md | ||
- id: check-yaml | ||
- id: check-json | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
exclude: README.md | ||
- id: check-yaml | ||
- id: check-json | ||
- repo: local | ||
hooks: | ||
- id: json-diff | ||
name: OpenAPI diff | ||
description: Check for differences in openapi.json and index_openapi.json with local versions. | ||
entry: ./.ci/json_diff.sh | ||
language: system |
Oops, something went wrong.