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

Recreate SQL Dependency PR #200

Merged
merged 277 commits into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
277 commits
Select commit Hold shift + click to select a range
5761dc6
#165: Edit target for config file due to previous commit
MRichards99 Oct 29, 2020
baa1768
#165: Add Poetry configuration
MRichards99 Oct 29, 2020
90badd6
#165: Add .python-version to gitignore
MRichards99 Oct 29, 2020
a478ab1
#165: Add flake8 config changes needed from additional plugins used
MRichards99 Oct 29, 2020
b890d98
#165: Allow dependencies to be installed according to Poetry's depen…
MRichards99 Oct 29, 2020
348acf1
#165: Add pre-commit hook config
MRichards99 Oct 29, 2020
7e7154c
#165: Apply pre-commit hooks to all files
MRichards99 Oct 29, 2020
14276a4
#165: Add additional pre-commit hooks
MRichards99 Oct 29, 2020
21dcee2
#165: Update version of standard pre commit hooks used
MRichards99 Oct 29, 2020
b28446c
#165: Add flake8 plugins to Poetry and nox session
MRichards99 Oct 29, 2020
be6e229
#165: Remove unused requirements files
MRichards99 Oct 30, 2020
4077f10
#165: Add documentation to the new dev environment created by the ch…
MRichards99 Nov 2, 2020
b4aa172
#165: Make small formatting changes to README
MRichards99 Nov 2, 2020
e32543b
#165: Add dev environment creation summary
MRichards99 Nov 2, 2020
0f232dd
#165: Change README's project structure
MRichards99 Nov 2, 2020
a9f3b08
#184: Add trailing commas to meet flake8 output
MRichards99 Nov 3, 2020
3b208a0
#184: Fix local import names
MRichards99 Nov 3, 2020
ffe23fe
#184: Reorder import statements
MRichards99 Nov 3, 2020
51fabee
#184: Remove reassignment of Python builtins
MRichards99 Nov 3, 2020
9b85ea7
#184: Avoid catching bare exceptions
MRichards99 Nov 3, 2020
81671f4
#184: Ensure every line meets 88 character length
MRichards99 Nov 3, 2020
4846a3d
#184: Edit docs to reflect Nox session renaming
MRichards99 Nov 3, 2020
93e1e3b
#184: Rebuild openapi.yaml file to reflect recent changes
MRichards99 Nov 3, 2020
33193de
#184: Add file specific ignore for 'random' usage
MRichards99 Nov 3, 2020
ed8aa34
#184: Fix misc. linting issues
MRichards99 Nov 4, 2020
de6255d
#184: Ensure all test classes names use PascalCase
MRichards99 Nov 4, 2020
af816bf
#184: Fix G200 from flake8-logging-format
MRichards99 Nov 5, 2020
a694129
#184: Make certain function less complex
MRichards99 Nov 5, 2020
1596f73
#183: Allow openapi.yaml generation to be disabled
MRichards99 Nov 5, 2020
82aa40d
#184: Update dependencies with security issues found by safety
MRichards99 Nov 6, 2020
7723d69
#182: Add log location configuration option
MRichards99 Nov 5, 2020
45b5896
#182: Allow log file to be configured
MRichards99 Nov 5, 2020
04f25f1
Merge branch 'feature/configure-log-file-location-#182' into feature/…
MRichards99 Nov 9, 2020
96b3728
#150: Add pytest to dev dependencies
MRichards99 Nov 9, 2020
29f8111
#150: Add nox 'tests' session
MRichards99 Nov 9, 2020
b752c85
#184: Fix previous changes to log.exception() lines
MRichards99 Nov 9, 2020
b655de1
Merge branch 'feature/fix-code-linting-#184' into feature/test-multip…
MRichards99 Nov 9, 2020
343f8d4
#150: Add tests for DateHandler
MRichards99 Nov 9, 2020
230eaca
#150: Make config file path configurable
MRichards99 Nov 10, 2020
d1b045f
#150: Add tests for config
MRichards99 Nov 10, 2020
257082e
#150: Add pytest-cov to the repo
MRichards99 Nov 10, 2020
57fcd68
#150: Add configuration options required for repo's tests
MRichards99 Nov 10, 2020
7455c48
#150: Add tests for test configuration options
MRichards99 Nov 10, 2020
572e89c
#150: Combine config test username and password
MRichards99 Nov 10, 2020
71720d0
#150: Add pytest fixtures for filter testing
MRichards99 Nov 11, 2020
d5b189b
#150: Add tests for ICAT where filters
MRichards99 Nov 11, 2020
3c350ee
#150: Add tests for ICAT order filters
MRichards99 Nov 11, 2020
90f3b4b
#150: Add tests for ICAT distinct filters
MRichards99 Nov 11, 2020
7fe62ff
#150: Add tests for ICAT include filters
MRichards99 Nov 11, 2020
34d46ba
#150: Add tests for ICAT skip filters
MRichards99 Nov 11, 2020
f4ef19f
#150: Add tests for ICAT limit filters
MRichards99 Nov 11, 2020
55397e5
#150: Add test for backend creation
MRichards99 Nov 11, 2020
9625cc1
Merge branch 'master' into feature/test-multiple-backends-#150
MRichards99 Nov 13, 2020
e621f42
#150: Add tests for filter handler
MRichards99 Nov 16, 2020
463e3db
Merge pull request #188 from ral-facilities/feature/configure-log-fil…
MRichards99 Nov 18, 2020
2caae79
Merge pull request #187 from ral-facilities/feature/disable-openapi-y…
MRichards99 Nov 18, 2020
7bf1141
#150: Ensure list flatten always returns the list in the same order
MRichards99 Nov 19, 2020
5444bd5
#150: Add way of injecting data into ICAT for testing endpoint and I…
MRichards99 Nov 19, 2020
d7b88dd
#150: Add beginning of tests for ICATQuery
MRichards99 Nov 19, 2020
07e42ec
#150: Add skeleton classes for remaining ICAT backend tests
MRichards99 Nov 20, 2020
ebf8b2e
#150: Fix failing filter tests
MRichards99 Nov 23, 2020
a3c16e1
#150: Rename pytest fixture for ICAT data injection
MRichards99 Nov 23, 2020
df48005
#150: Correct argument case
MRichards99 Nov 23, 2020
367eebb
#150: Add function to remove ICAT meta attributes and new test
MRichards99 Nov 23, 2020
6de60c7
#150: Add test to break a query
MRichards99 Nov 23, 2020
08b8fb6
#150: Add fixture to return auth header
MRichards99 Nov 23, 2020
00923bd
#150: Add fixture for flask test app
MRichards99 Nov 23, 2020
833f8e9
#150: Add tests for valid GET requests
MRichards99 Nov 23, 2020
9e0c56b
#150: Add update test
MRichards99 Nov 24, 2020
9c3ece5
#150: Add fixture to inject multiple investigation results
MRichards99 Nov 24, 2020
fdafb7a
#150: Add test for skip & limit filter merge
MRichards99 Nov 24, 2020
fc7f3a1
#150: Add tests for PATCH endpoints
MRichards99 Nov 24, 2020
510943e
#150: Add invalid test for data updates
MRichards99 Nov 24, 2020
6477491
#150: Modify existing test to actually point to an update by ID endp…
MRichards99 Nov 24, 2020
451e4d7
#150: Add invalid update by ID test
MRichards99 Nov 24, 2020
ba62e44
#150: Change ICATValidationError to raise a BadRequestError
MRichards99 Nov 24, 2020
bead8cf
#150: Add more invalid tests for update endpoint
MRichards99 Nov 25, 2020
a2fd644
#150: Add tests for no result requests
MRichards99 Nov 25, 2020
03c7c8f
#150: Add tests for DELETE endpoints
MRichards99 Nov 25, 2020
9edd0e9
#150: Add pytest plugin to improve assertion diffs
MRichards99 Nov 25, 2020
ce048da
#150: Fix data creation
MRichards99 Nov 25, 2020
e358ec7
#150: Add valid test for data creation
MRichards99 Nov 25, 2020
e1f07b7
#150: Add invalid tests for data creation
MRichards99 Nov 25, 2020
b16098e
#150: Add test to create single investigation
MRichards99 Nov 25, 2020
ba59926
#150: Move endpoint tests to their own files/classes
MRichards99 Nov 25, 2020
5125106
Merge pull request #179 from ral-facilities/feature/update-swagger-ge…
MRichards99 Nov 26, 2020
79bdbbe
#150: Add tests to check all endpoints exist and have correct HTTP m…
MRichards99 Nov 26, 2020
861b4f8
#150: Add session handling tests for ICAT backend
MRichards99 Nov 27, 2020
1470b22
#150: Add invalid tests for ISIS specific endpoints
MRichards99 Nov 27, 2020
25f2282
#150: Simplify icat_query fixture
MRichards99 Nov 30, 2020
275cb43
#150: Use one-off session ID for logout test
MRichards99 Nov 30, 2020
7aae8c8
#150: Refactor creation of investigation test data
MRichards99 Nov 30, 2020
9ed2694
#150: Fix test failures due to refactor
MRichards99 Nov 30, 2020
5910404
#150: Add valid tests for table endpoints
MRichards99 Nov 30, 2020
49ef7f8
#150: Increase coverage of PythonICATIncludeFilter
MRichards99 Nov 30, 2020
90f14a1
#150: Fix order filter test failures
MRichards99 Nov 30, 2020
e85f378
#150: Solve linting issues
MRichards99 Nov 30, 2020
2c37baa
#150: Remove planning comments made at start of branch
MRichards99 Nov 30, 2020
c977be0
Merge branch 'feature/remove-sql-dependency-from-backends-#154' into …
MRichards99 Nov 30, 2020
64f9981
#150: Move Flask/API setup into functions
MRichards99 Nov 30, 2020
b12e7cd
Merge pull request #180 from ral-facilities/feature/fix-exception-han…
MRichards99 Dec 2, 2020
864e020
Merge pull request #178 from ral-facilities/feature/fix-swagger-data-…
MRichards99 Dec 2, 2020
9e34729
Merge branch 'feature/remove-sql-dependency-from-backends-#154' into …
MRichards99 Dec 2, 2020
116ca2a
Merge branch 'feature/add-code-linting-#165' into feature/fix-code-li…
MRichards99 Dec 2, 2020
9532d91
#150: Checkpoint in making backend configurable for testing
MRichards99 Dec 2, 2020
6902921
#150: Expand flask test app so the backend can be configured
MRichards99 Dec 2, 2020
7a6a8ef
#150: Move QueryFilterFactory to its own file
MRichards99 Dec 3, 2020
70dc393
#150: Allow backend type to be set when a flask test fixture runs
MRichards99 Dec 3, 2020
3890c55
#150: Add separate flask app fixtures for each backend
MRichards99 Dec 3, 2020
db97d8a
#150: Fix failing endpoint rule tests
MRichards99 Dec 3, 2020
adc48d1
#150: Fix imports on database helpers
MRichards99 Dec 3, 2020
dd9a92a
#150: Correct import for QueryFilterFactory
MRichards99 Dec 3, 2020
c676f46
#150: Fix imports on test helpers
MRichards99 Dec 3, 2020
c29f68e
#150: Fix logging issues when dealing with session IDs which are str…
MRichards99 Dec 3, 2020
dce47c1
#150: Remove unneeded import
MRichards99 Dec 3, 2020
bcea7ec
#150: Fix FlaskAppTest based on changes to main.py
MRichards99 Dec 3, 2020
c866be3
#150: General cleanup of recent work
MRichards99 Dec 3, 2020
b8324db
#150: Restructure test files
MRichards99 Dec 3, 2020
cff2ce4
#150: Rewrite DB entity helper tests in pytest
MRichards99 Dec 3, 2020
cf89d7e
#150: Rewrite database helper tests
MRichards99 Dec 3, 2020
b97b19b
#150: Rewrite JSON validity tests
MRichards99 Dec 3, 2020
a07f0db
#150: Rewrite DB session decorator tests
MRichards99 Dec 3, 2020
89d58d6
#150: Rename valid ICAT creds header
MRichards99 Dec 3, 2020
e8f1139
#150: Rewrite session ID from header tests
MRichards99 Dec 3, 2020
74215cd
#150: Complete TODOs from 'backend can be set for tests' work
MRichards99 Dec 3, 2020
d6f6ab8
#150: Rewrite get_filter_from_query_string tests
MRichards99 Dec 4, 2020
97bf1a4
#150: Rewrite queries_records tests
MRichards99 Dec 4, 2020
f5c4558
#150: Add test to ensure all required abstract methods are present f…
MRichards99 Dec 4, 2020
a4ca2df
Update README.md
MRichards99 Dec 4, 2020
b6c7c66
#150: Add get by ID tests for DB backend
MRichards99 Dec 4, 2020
bbca31c
#150: Add tests for /count for DB backend
MRichards99 Dec 4, 2020
6baf55d
#150: Move endpoint rules tests
MRichards99 Dec 4, 2020
578f897
#150: Ensure filenames are unique across test suite
MRichards99 Dec 4, 2020
42359fc
#150: Create localised conftest files
MRichards99 Dec 4, 2020
b2af27d
#150: Add remaining data creation fixtures for DB backend tests
MRichards99 Dec 4, 2020
1b91217
#150: Add get with filter tests for DB backend
MRichards99 Dec 4, 2020
8c1941d
#150: Fix openapi YAML creation
MRichards99 Dec 7, 2020
3eec346
#150: Add findone tests for DB backend
MRichards99 Dec 7, 2020
c5a867c
#150: Actually fix openapi YAML creation
MRichards99 Dec 7, 2020
0c59b58
#150: Add ISIS endpoint testing for DB backend
MRichards99 Dec 7, 2020
b80347f
#165: Update repo tree structure
MRichards99 Dec 7, 2020
3682165
Merge branch 'feature/add-code-linting-#165' of github.com:ral-facili…
MRichards99 Dec 7, 2020
0366d08
#165: Allow tmp directory to be configured for nox sessions
MRichards99 Dec 8, 2020
4039233
#150: Add documentation for running the tests
MRichards99 Dec 8, 2020
3b6251c
Merge branch 'feature/fix-code-linting-#184' into feature/test-multip…
MRichards99 Dec 8, 2020
b01eaf5
#184: Fix linting issues as brought up in PR
MRichards99 Dec 8, 2020
fe88196
#184: Make response descriptions have consistent syntax
MRichards99 Dec 8, 2020
1013e82
Merge branch 'feature/add-code-linting-#165' into feature/fix-code-li…
MRichards99 Dec 8, 2020
5f10ecc
Merge branch 'feature/fix-code-linting-#184' into feature/test-multip…
MRichards99 Dec 8, 2020
96f5aec
#190: Make small changes to existing docs
MRichards99 Dec 8, 2020
8b24725
#190: Update README.md for ICAT backend
MRichards99 Dec 9, 2020
f2f7f55
#165: Add a note to remind users to have user's Python added to PATH
MRichards99 Dec 9, 2020
60c56f6
#190: Rename query_filter_factory.py
MRichards99 Dec 9, 2020
93d0980
#190: Make change to project tree based on previous commit
MRichards99 Dec 18, 2020
ed448ca
#165: Disable auto file deletion for NamedTemporaryFile
MRichards99 Dec 18, 2020
36dfeb0
Merge branch 'feature/add-code-linting-#165' into feature/fix-code-li…
MRichards99 Dec 18, 2020
91f90a1
Merge branch 'feature/fix-code-linting-#184' into feature/test-multip…
MRichards99 Dec 18, 2020
adc1f40
Merge branch 'feature/improve-logging-icat-backend-#164' into feature…
MRichards99 Jan 4, 2021
ec1dd64
Merge branch 'feature/improve-logging-icat-backend-#164' into feature…
MRichards99 Jan 4, 2021
135965c
#165: Remove details regarding tmpdir cmd option
MRichards99 Jan 4, 2021
821e8b9
Merge branch 'feature/remove-sql-dependency-from-backends-#154' into …
MRichards99 Jan 4, 2021
c4b63eb
Merge branch 'feature/add-code-linting-#165' into feature/fix-code-li…
MRichards99 Jan 4, 2021
01449cc
Merge branch 'feature/fix-code-linting-#184' into feature/test-multip…
MRichards99 Jan 4, 2021
baff80d
Update datagateway_api/common/backends.py
MRichards99 Jan 4, 2021
e826e20
#150: Make requested changes on PR review
MRichards99 Jan 4, 2021
6dea07e
Merge branch 'feature/test-multiple-backends-#150' of github.com:ral-…
MRichards99 Jan 4, 2021
9b4907c
Merge pull request #186 from ral-facilities/feature/fix-code-linting-…
MRichards99 Jan 4, 2021
ca0efc6
Merge pull request #185 from ral-facilities/feature/add-code-linting-…
MRichards99 Jan 4, 2021
f320600
#190: Make requested changes from PR linked to this issue
MRichards99 Jan 4, 2021
73bb72d
#190: Add link to icat.manual repo for tutorials on setting up an IC…
MRichards99 Jan 5, 2021
fb3900b
#190: Add --without-hashes options to poetry export cmd
MRichards99 Jan 5, 2021
5301cfd
Merge pull request #192 from ral-facilities/feature/add-icat-backend-…
MRichards99 Jan 5, 2021
b11001d
Merge pull request #191 from ral-facilities/feature/test-multiple-bac…
MRichards99 Jan 5, 2021
863d1f2
#163: Add baseline GitHub Actions workflow
MRichards99 Jan 6, 2021
81acc92
#163: Copy the example config to config.json
MRichards99 Jan 6, 2021
47d1c01
#163: Add conditionals to nox sessions
MRichards99 Jan 6, 2021
8a4fcd0
#163: Change example ICAT_URL to SciGateway preprod
MRichards99 Jan 6, 2021
0823e12
#163: Add step to create log file for testing
MRichards99 Jan 6, 2021
feaedf4
#163: Separate log file location and log_location config change
MRichards99 Jan 6, 2021
bd7bbc0
#163: Change key to lowercase, to match the actual key
MRichards99 Jan 6, 2021
617aff1
#163: Actually add the value and file envs
MRichards99 Jan 6, 2021
4e4fac1
#163: Use jq to edit log location
MRichards99 Jan 6, 2021
2500207
#163: Add GH Actions status badge
MRichards99 Jan 6, 2021
33b7531
#163: Set log location for exampple config file
MRichards99 Jan 6, 2021
d8b618d
#163: Force each Python version build to run sequentially
MRichards99 Jan 6, 2021
2d33c0c
#193: Add NOT like operation to WHERE filter on ICAT backend
MRichards99 Jan 7, 2021
9455685
#193: Add NOT like operatior for WHERE filter to DB backend
MRichards99 Jan 7, 2021
a6c35ae
Merge pull request #194 from ral-facilities/feature/add-not-like-filt…
MRichards99 Jan 7, 2021
05b2337
#163: Add steps to build a local instance of ICAT
MRichards99 Jan 7, 2021
cdf2b1c
#163: Add missing uses line
MRichards99 Jan 7, 2021
1e7a9ce
#163: Make path explict
MRichards99 Jan 7, 2021
c9d290d
#163: Lots of debugging
MRichards99 Jan 7, 2021
4672e03
#163: Comment out Ansible Actions usage
MRichards99 Jan 13, 2021
d6ac7b2
#163: Change icat-ansible to use non-forked version
MRichards99 Jan 13, 2021
30ec28f
#163: Specify noxfile
MRichards99 Jan 13, 2021
c2391c2
#163: Update example config to use localhost values
MRichards99 Jan 13, 2021
71ad07b
#163: Change inventory file
MRichards99 Jan 13, 2021
05cd039
#163: Replace default payara user
MRichards99 Jan 13, 2021
5d246d8
#163: Remove blank step
MRichards99 Jan 13, 2021
5c78a76
#163: Correct sed command
MRichards99 Jan 13, 2021
cfa20d8
#163: Change debug to localhost
MRichards99 Jan 13, 2021
7d1d0b4
#163: Change example ICAT_URL to localhost
MRichards99 Jan 13, 2021
22d987e
#163: Add step to use icat_db_generator
MRichards99 Jan 13, 2021
ed470b3
#163: Change dummy data cmd
MRichards99 Jan 13, 2021
7b43ead
#163: Edit dummy data cmd
MRichards99 Jan 13, 2021
83714a1
#163: Change test_valid_db_url to new DB_URL
MRichards99 Jan 13, 2021
9299cf7
#163: Update py dependency
MRichards99 Jan 13, 2021
d4c1163
#163: Debugging for Actions workflow
MRichards99 Jan 7, 2021
71e70e8
#163: Comment out Ansible Actions usage
MRichards99 Jan 13, 2021
64ab5ba
#163: Change icat-ansible to use non-forked version
MRichards99 Jan 13, 2021
585afbf
#163: Change inventory file
MRichards99 Jan 13, 2021
ec72663
#163: Replace default payara user
MRichards99 Jan 13, 2021
c084d98
#163: Remove blank step
MRichards99 Jan 13, 2021
9ac5ec0
#163: Correct sed command
MRichards99 Jan 13, 2021
6079255
#163: Change debug to localhost
MRichards99 Jan 13, 2021
23e5c77
#163: Remove debugging steps
MRichards99 Jan 14, 2021
a3c6963
#163: Add comments to workflow
MRichards99 Jan 14, 2021
d672986
#163: Update SQLAlchemy
MRichards99 Jan 15, 2021
a7d5193
#163: Remove parallel restriction
MRichards99 Jan 15, 2021
f6181d3
#154: Make EntityHelper into an abstract class
MRichards99 Jan 15, 2021
abae518
#154: Fix issue with the API when served via WSGI
MRichards99 Jan 15, 2021
31e3002
#163: Update pymysql
MRichards99 Jan 15, 2021
0a50a69
#163: Add more versions of Python to build against
MRichards99 Jan 15, 2021
2792e7d
#163: Remove specific python version on non-specific nox sessions
MRichards99 Jan 15, 2021
e1341cd
#163: Update setup-python Action
MRichards99 Jan 15, 2021
8391a5c
#163: Remove non-working Python versions
MRichards99 Jan 15, 2021
9ebc58c
#163: Remove Python 3.4 from CI build
MRichards99 Jan 15, 2021
5ab6c93
#163: Allow Poetry to use Python 3.5
MRichards99 Jan 15, 2021
b04abbd
#163: Remove Python 3.5 support
MRichards99 Jan 15, 2021
9a19073
#163: Add separate jobs for each nox session
MRichards99 Jan 15, 2021
7117e61
#163: Remove unneeded nox sessions from tests job
MRichards99 Jan 15, 2021
d5a40a5
#162: Disable fail-fast on test jobs
MRichards99 Jan 15, 2021
d0c3a0a
#163: Change conditional for when CI runs
MRichards99 Jan 15, 2021
5281922
#163: Disable current branch from running CI when pushed
MRichards99 Jan 15, 2021
689c2a1
#163: Allow CI to be triggered manually
MRichards99 Jan 18, 2021
dd223c5
#167: Add codecov dependency
MRichards99 Jan 18, 2021
a938083
#167: Add coverage nox session
MRichards99 Jan 18, 2021
e43b39e
#167: Add status badge for codecov
MRichards99 Jan 18, 2021
55ecf7a
#167: Add coverage Actions workflow
MRichards99 Jan 18, 2021
16e434b
#167: Add arg for noxfile.py
MRichards99 Jan 18, 2021
b5c22a2
#167: Add coverage steps in build and test
MRichards99 Jan 18, 2021
3c8ba50
#167: Remove coverage workflow
MRichards99 Jan 18, 2021
ce6f2fc
#167: Remove current branch to launch CI build
MRichards99 Jan 18, 2021
680a5e7
#167: Remove coverage nox session
MRichards99 Jan 18, 2021
9542fc8
#167: Remove codecov as a dependency
MRichards99 Jan 18, 2021
d012130
#163: Update PR template
MRichards99 Jan 19, 2021
bccce12
Merge pull request #197 from ral-facilities/feature/code-coverage-#167
MRichards99 Jan 19, 2021
fae9695
Merge pull request #196 from ral-facilities/feature/implement-ci-#163
MRichards99 Jan 19, 2021
deb1539
Merge branch 'master' into feature/remove-sql-dependency-from-backend…
MRichards99 Jan 21, 2021
c84eccf
#154: Fix broken tests
MRichards99 Jan 21, 2021
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
10 changes: 10 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# .flake8
[flake8]
select = A,B,B9,BLK,C,E,F,I,N,S,W
ignore = E203,W503,E501
max-complexity = 17
max-line-length = 80
application-import-names = datagateway_api,test,util
import-order-style = google
per-file-ignores = test/*:S101,util/icat_db_generator.py:S311
enable-extensions=G
8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ This PR will close #{issue number}
## Description
Enter a description of the changes here

## Testing instructions
## Testing Instructions
Add a set up instructions describing how the reviewer should test the code

- [ ] Review code
- [ ] Check Travis build
- [ ] Check GitHub Actions build
- [ ] Review changes to test coverage
- [ ] {more steps here}

## Agile board tracking
connect to #{issue number}
## Agile Board Tracking
Connect to #{issue number}
157 changes: 157 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
jobs:
tests:
runs-on: ubuntu-16.04
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
name: Python ${{ matrix.python-version }} Build & Tests
steps:
- name: Add apt repo
run: sudo add-apt-repository universe

# Setup Java & Python
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 8
java-package: jdk
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64

# ICAT Ansible clone and install dependencies
- name: Checkout icat-ansible
uses: actions/checkout@v2
with:
repository: icatproject-contrib/icat-ansible
ref: change-payara-setup-script-url
path: icat-ansible
- name: Install Ansible
run: pip install -r icat-ansible/requirements.txt

# Prep for running the playbook
- name: Create hosts file
run: echo -e "[icatdb-minimal-hosts]\nlocalhost ansible_connection=local" > icat-ansible/hosts
- name: Prepare vault pass
run: echo -e "icattravispw" > icat-ansible/vault_pass.txt
- name: Move vault to directory it'll get detected by Ansible
run: mv icat-ansible/vault.yml icat-ansible/group_vars/all
- name: Replace default payara user with Actions user
run: |
sed -i -e "s/^payara_user: \"glassfish\"/payara_user: \"runner\"/" icat-ansible/group_vars/all/vars.yml

# Create local instance of ICAT
- name: Run ICAT Ansible Playbook
run: |
ansible-playbook icat-ansible/icatdb-minimal-hosts.yml -i icat-ansible/hosts --vault-password-file icat-ansible/vault_pass.txt -vv

- name: Checkout DataGateway API
uses: actions/checkout@v2
with:
path: datagateway-api

# Prep for using the API for tests
- name: Create log file
run: touch logs.log
- name: Configure log file location
run: echo "`jq -r --arg REPO_DIR "$GITHUB_WORKSPACE/logs.log" \
'.log_location=$REPO_DIR' datagateway-api/config.json.example`" > datagateway-api/config.json.example
- name: Create config.json
run: cp datagateway-api/config.json.example datagateway-api/config.json

# Install Nox, Poetry and API's dependencies
- name: Install Nox
run: pip install nox==2020.8.22
- name: Install Poetry
run: pip install poetry==1.1.4
- name: Install dependencies
run: cd datagateway-api/ && poetry install

- name: Add dummy data to icatdb
run: |
cd datagateway-api && poetry run python -m util.icat_db_generator -s 4 -y 3

# Run Nox tests session, saves and uploads a coverage report to codecov
- name: Run Nox tests session
run: nox -s tests -f datagateway-api/noxfile.py -- --cov=datagateway_api --cov-report=xml
- name: Upload code coverage report
if: matrix.python-version == '3.6'
uses: codecov/codecov-action@v1
with:
directory: ./datagateway-api

linting:
runs-on: ubuntu-16.04
name: Linting
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.6'
architecture: x64
- name: Checkout DataGateway API
uses: actions/checkout@v2
with:
path: datagateway-api

- name: Install Nox
run: pip install nox==2020.8.22
- name: Install Poetry
run: pip install poetry==1.1.4

- name: Run Nox lint session
run: nox -s lint -f datagateway-api/noxfile.py

formatting:
runs-on: ubuntu-16.04
name: Code Formatting
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.6'
architecture: x64
- name: Checkout DataGateway API
uses: actions/checkout@v2
with:
path: datagateway-api

- name: Install Nox
run: pip install nox==2020.8.22
- name: Install Poetry
run: pip install poetry==1.1.4

- name: Run Nox black session
run: nox -s black -f datagateway-api/noxfile.py

safety:
runs-on: ubuntu-16.04
name: Dependency Safety
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.6'
architecture: x64
- name: Checkout DataGateway API
uses: actions/checkout@v2
with:
path: datagateway-api

- name: Install Nox
run: pip install nox==2020.8.22
- name: Install Poetry
run: pip install poetry==1.1.4

- name: Run Nox safety session
run: nox -s safety -f datagateway-api/noxfile.py
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ venv/
logs.log
config.json
.vscode/
.nox/
.python-version
.coverage
coverage.xml
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
hooks:
- id: check-docstring-first
- id: check-json
- id: check-toml
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: local
hooks:
- id: black
name: black
entry: poetry run black
language: system
types: [python]
Loading