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

Release/version 0.6.0 #54

Open
wants to merge 231 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
231 commits
Select commit Hold shift + click to select a range
2089170
Create Hello world endpoint
Lakorthus Jun 20, 2023
1571f0a
tested and updated readme instructions for running app
piratejas Jun 20, 2023
ea1d499
test: test_hello_world controller function.
Lakorthus Jun 20, 2023
0af031b
test: routes on hello_world
Lakorthus Jun 20, 2023
b0d5802
Merge pull request #2 from methods/feat_hello_world
Lakorthus Jun 20, 2023
63c02ba
feat: added and manually tested post route for bid
piratejas Jun 21, 2023
ac87d4e
feat: saving data in memory and separating logic
Lakorthus Jun 22, 2023
d1f230c
wip: add phase info to success/failed
piratejas Jun 22, 2023
53d3913
feat: field validation, set status enum
piratejas Jun 22, 2023
3d0dc1c
test: add post bid route tests
piratejas Jun 22, 2023
7641b4b
Merge pull request #3 from methods/feat/create-new-bid
piratejas Jun 22, 2023
2d6d8cf
fix: renamed files and folders for readability
piratejas Jun 23, 2023
65901b1
Merge pull request #4 from methods/fix/filenames-improvement
piratejas Jun 23, 2023
027cc43
fix: changed set_status
piratejas Jun 23, 2023
817cd3d
wip: swagger spec config
piratejas Jun 23, 2023
cc3763c
docs: Update contribution guidelines to incl. release and tagging
nshumoogum Jun 23, 2023
34c1a45
fix: installed flask_swagger_ui; created swagger_config.yml
piratejas Jun 26, 2023
44145f6
chore: flask-ui added to the requirements
Lakorthus Jun 27, 2023
4a35b21
Merge branch 'feat/swagger-spec' into fix/set-status-enum
Lakorthus Jun 27, 2023
03520b5
Merge pull request #7 from methods/fix/set-status-enum
Lakorthus Jun 27, 2023
2d2d28f
fix: swagger config structure
piratejas Jun 27, 2023
5f10e67
refactor: swagger config components and refs
piratejas Jun 27, 2023
cd2bc74
feat: completed swagger spec for post bid endpoint
piratejas Jun 28, 2023
0e0677e
Merge pull request #8 from methods/feat/swagger-spec
piratejas Jun 28, 2023
9249e09
refactor: success and failed phase info
piratejas Jun 28, 2023
6d1fdbc
refactor: added helper function and logic for feedback
piratejas Jun 28, 2023
3ac5bd2
Merge pull request #9 from methods/refactor/post-bid-endpoint
piratejas Jun 29, 2023
8d7aaac
refactor: added marshmallow schemas; renamed classes and fixed import…
piratejas Jun 29, 2023
1b48bc2
refactor: handling ValidationError with marshmallow and outputting cu…
piratejas Jun 30, 2023
ed395ce
refactor: added test request bodies to check validation
piratejas Jun 30, 2023
a430451
refactor: removed unused imports
piratejas Jun 30, 2023
22e3002
refactor: moved class declarations to models folder; updated swagger …
piratejas Jul 3, 2023
29ac930
refactor: updated readme with swagger instructions
piratejas Jul 3, 2023
1e147e5
Merge pull request #10 from methods/refactor/implementing-marshmallow
piratejas Jul 3, 2023
042e4f2
feat: connect to mongodb instance; refactored post
piratejas Jul 3, 2023
b099087
Update README.md
piratejas Jul 3, 2023
3de2be9
Update README.md
piratejas Jul 3, 2023
efc5e00
refactor: added information to readme; changed db name to bidsAPI
piratejas Jul 3, 2023
15c2663
refactor: updated swagger _id fields
piratejas Jul 4, 2023
927bbb9
wip: tests for post route mocking db response
piratejas Jul 4, 2023
3a6bd89
Merge pull request #11 from methods/feat/mongodb-connection
piratejas Jul 4, 2023
4b3df65
feat: added swagger spec for get_all_bids endpoint
piratejas Jul 4, 2023
ebe66dd
feat: swagger spec created for get bid/id
Lakorthus Jul 4, 2023
81b1635
Merge pull request #12 from methods/feat/swagger_spec-get_bid/{id}
piratejas Jul 4, 2023
3c74327
feat: incorporated julio changes to swag
piratejas Jul 4, 2023
1a56618
Merge pull request #13 from methods/feat/get-all-bids-swagger
piratejas Jul 4, 2023
6d2e3f8
feat: phase schema validation and enum added
Lakorthus Jul 4, 2023
f43b88b
fix: validation for the phase schema
Lakorthus Jul 5, 2023
70f9c77
Merge pull request #14 from methods/feat/phase-enum
Lakorthus Jul 5, 2023
cca05b2
feat: get all bids from MongoDB
Lakorthus Jul 5, 2023
f0cca03
fix: format return bids
Lakorthus Jul 5, 2023
61a0331
feat: added get by id and handling error responses
piratejas Jul 5, 2023
f4a0bf4
refactor: removed unused imports and added comments
piratejas Jul 5, 2023
31a5ad7
test: get all bids and check connection failure
Lakorthus Jul 5, 2023
b5daebf
test: post bid test
Lakorthus Jul 6, 2023
12a47d5
test: error if you are not able to retrive bids
Lakorthus Jul 6, 2023
a43e8ca
test: test suite for get_bid_by_id
piratejas Jul 6, 2023
a532235
test: added validation error test
piratejas Jul 6, 2023
8d88c70
Merge pull request #15 from methods/feat/get-bid-by-id
piratejas Jul 6, 2023
4f1c3e7
Merge branch 'develop' into feat/get_all
Lakorthus Jul 6, 2023
918d4e9
Merge pull request #16 from methods/feat/get_all
Lakorthus Jul 6, 2023
3b2c8d4
fix: debugged valid_bid_id_schema
piratejas Jul 11, 2023
eab3874
test: bid model and schema validation
piratejas Jul 11, 2023
e15ee6d
refactor: removed unused import
piratejas Jul 11, 2023
078695d
feat: Route for delete added Swag spec and test
Lakorthus Jul 11, 2023
90269e5
Merge pull request #17 from methods/feat/delete-route
Lakorthus Jul 11, 2023
87c5c2c
Update all_fields.http
piratejas Jul 11, 2023
d5f9a18
Merge pull request #18 from methods/test/bid-request-schema-validation
piratejas Jul 11, 2023
cc8904f
test: delete by id validation error
Lakorthus Jul 12, 2023
1bac2b9
Merge pull request #19 from methods/feat/delete_bid
Lakorthus Jul 12, 2023
06adef2
feat: added query to get_all to filter by status not equals to deleted
piratejas Jul 12, 2023
49ad68a
refactor: testing without magicMock
Lakorthus Jul 13, 2023
b5add45
fix: updated soft delete method from PUT to DELETE
piratejas Jul 13, 2023
1a7ba79
feat: added swag spec and endpoint for update bid route; changed bid …
piratejas Jul 13, 2023
c841aeb
refactor: updated examples in swagger spec
piratejas Jul 13, 2023
6ceb406
Merge pull request #20 from methods/feat/filtering-out-deleted
piratejas Jul 17, 2023
222f5a2
Merge pull request #21 from methods/refactor/test-magicMock
Lakorthus Jul 17, 2023
700d658
Merge branch 'develop' into feat/update-bid-by-id
piratejas Jul 17, 2023
8b26e55
Merge pull request #22 from methods/feat/update-bid-by-id
piratejas Jul 17, 2023
b3b574b
test: update bid by id tests; refactored to add helper functions for …
piratejas Jul 17, 2023
6f2f6a2
refactor: removed unused imports
piratejas Jul 17, 2023
f9ae9e9
refactor: cleaned up controller
piratejas Jul 18, 2023
1238a99
refactor: changed find and replace to update one; wip: adding last_up…
piratejas Jul 18, 2023
1c986c2
test: updating tests after refactor
piratejas Jul 18, 2023
dcd3f6a
test: updated tests after refactoring
piratejas Jul 18, 2023
386a13b
Merge pull request #23 from methods/test/update-bid-by-id
piratejas Jul 18, 2023
a9f169c
feat: Makefile
Lakorthus Jul 18, 2023
f573dcb
refactor: README and req.txt updated with Makefile
Lakorthus Jul 18, 2023
99d5a63
feat: vulnerability check using safety
Lakorthus Jul 18, 2023
8859be2
refactor: added custom error message to path param validation
piratejas Jul 19, 2023
8329de6
feat: commit script Makefile
Lakorthus Jul 19, 2023
b6f3e0e
feat: commit message to gitignore
Lakorthus Jul 19, 2023
738434a
refactor: makefile check
Lakorthus Jul 19, 2023
d642f7a
test: testing commit msg
Lakorthus Jul 19, 2023
eea3c3b
test: test commit msg
Lakorthus Jul 19, 2023
9a4b05c
test:
Lakorthus Jul 19, 2023
b648ac0
Merge pull request #25 from methods/feat/gmakefile
Lakorthus Jul 19, 2023
cc28971
refactor: updated swagger to include additional error responses
piratejas Jul 19, 2023
b7a95d4
Merge pull request #26 from methods/refactor/error-handling
piratejas Jul 19, 2023
631ca74
refactor: updated makefile and refactored commit target
piratejas Jul 19, 2023
177f574
fix: set upstream for new branch
piratejas Jul 19, 2023
f86fdad
refactor: removed unnecessary mocking in post_bid tests
piratejas Jul 19, 2023
161e8b7
refactor: changed variable name in helpers for clarity
piratejas Jul 19, 2023
9182179
refactor: removed unused imports
piratejas Jul 20, 2023
6452173
feat: created prepend host function and test
piratejas Jul 20, 2023
714be0c
Merge pull request #28 from methods/feat/makefile-update
piratejas Jul 20, 2023
ef35c17
feat: lint and format features added to makefile
Lakorthus Jul 20, 2023
fd04b55
feat: added prepend host to controller methods
piratejas Jul 20, 2023
97b4b25
refactor: formatted with black
piratejas Jul 20, 2023
e1e3317
Merge pull request #29 from methods/feat/makefile-lint-format
Lakorthus Jul 20, 2023
48a52ce
Merge branch 'develop' into feat/append-host
piratejas Jul 20, 2023
031df6e
Merge pull request #30 from methods/feat/append-host
piratejas Jul 20, 2023
a77ac56
feat: added test coverage report; updated gmake help
piratejas Jul 20, 2023
65316f0
feat: added script to populate and delete bids
Lakorthus Jul 20, 2023
9e28822
feat: added update bid status endpoint; updated swagger; handled erro…
piratejas Jul 20, 2023
89101e5
test: changed file name to test_helpers
piratejas Jul 20, 2023
11ef07f
test: increased test coverage; added commands to makefile
piratejas Jul 20, 2023
51fc35c
test: added more tests
piratejas Jul 20, 2023
bca764a
refactor: makefile setup
Lakorthus Jul 21, 2023
d9e7b23
Merge pull request #31 from methods/feat/add-script-populate-delete
Lakorthus Jul 21, 2023
fbb4584
Merge branch 'develop' into feat/update-status
piratejas Jul 21, 2023
84ad494
Merge pull request #32 from methods/feat/update-status
piratejas Jul 21, 2023
64f7135
docs: separated test_requirements and added make target; updated readme
piratejas Jul 21, 2023
19e3bb3
test: moved phase validation tests into test_BidRequestSchema; refact…
piratejas Jul 21, 2023
e4a4e0e
Merge pull request #33 from methods/docs/update-readme
piratejas Jul 21, 2023
57a4349
refactor: separated logic for post_bid_schema and update_bid_schema; …
piratejas Jul 21, 2023
4f67fdc
refactor: changed date input format to ensure same output, updated sw…
piratejas Jul 21, 2023
2b3fe8c
test: updated tests for date format change
piratejas Jul 21, 2023
8b071e1
refactor: added todo plan to incorporate validation of unique phases …
piratejas Jul 21, 2023
ee1ea76
refactor: unique phase validation works on put; put and post use same…
piratejas Jul 24, 2023
264d079
Merge pull request #34 from methods/refactor/bid-schema
piratejas Jul 24, 2023
fea10be
refactor: test coverage in makefile
Lakorthus Jul 24, 2023
c412371
docs: readme.md containing details of scripts usage
Lakorthus Jul 24, 2023
ec48453
feat: flake8 config file created on root folder
Lakorthus Jul 24, 2023
4169d6d
feat: pylint config file created on root folder
Lakorthus Jul 24, 2023
10ae67f
fix: lint error handeling exception bid_controler and except block he…
Lakorthus Jul 24, 2023
59657eb
fix: lint C0411 wrong-import-order
Lakorthus Jul 24, 2023
b0673f6
fix: lint W0718-R1722-W1514 create_sample_data
Lakorthus Jul 24, 2023
58bcb69
fix: lint W0718,R1722 delete_db
Lakorthus Jul 24, 2023
d9a8d69
fix: lint W0621 Redefining name 'client' to 'test_client'
Lakorthus Jul 24, 2023
33bf1b9
fix: lint C0411-W0622 and update makefile
Lakorthus Jul 24, 2023
cc3c51f
fix: lint C0115 Missing class docstring
Lakorthus Jul 24, 2023
9f1a857
feat: html docs with sphinx and string-comments
Lakorthus Jul 24, 2023
cc46296
feat: start and stop mongo services with makefile
Lakorthus Jul 25, 2023
19b089a
chore: C0114 connection string
Lakorthus Jul 25, 2023
b85019b
Merge pull request #36 from methods/feat/lint-doc
Lakorthus Jul 25, 2023
b04ef2e
feat: implemented API key authorization for write endpoints
piratejas Jul 26, 2023
93b415c
test: updated tests
piratejas Jul 26, 2023
3e055fb
refactor: added session scope to pytest fixture to improve speed; add…
piratejas Jul 26, 2023
5ce1c33
chore: added makefile target to run auth api app
piratejas Jul 26, 2023
6bc19d4
chore: removed .ds_store and added to .gitignore
piratejas Jul 26, 2023
398d7c1
feat: implement jwt verification; added scripts for posting with auth
piratejas Jul 27, 2023
15dffa4
feat: implemented require_admin wrapper; scripts to demo api interact…
piratejas Jul 28, 2023
bf7a045
test: updated tests with new permissions required
piratejas Jul 28, 2023
53f60f1
test: added tests for forbidden; created script to test delete with a…
piratejas Jul 28, 2023
2fbd645
fix: removed host prefix from links in test data
piratejas Jul 28, 2023
2dd8245
test: wip - convert api interaction scripts to integration tests
piratejas Jul 28, 2023
464397e
test: added delete_forbidden test; updated testconfig; changed SECRET…
piratejas Jul 31, 2023
697c620
docs: updated swagger for security schemes and responses
piratejas Jul 31, 2023
b3195c0
feat: auth script to interact with different levels of access
Lakorthus Jul 31, 2023
b3e0ddb
docs: authorization documentation
Lakorthus Jul 31, 2023
486ad65
fix: name changed
Lakorthus Aug 1, 2023
1526eb5
Merge pull request #37 from methods/feat/implement-api-key
piratejas Aug 1, 2023
bd2f770
Merge pull request #38 from methods/test/api-integration
piratejas Aug 1, 2023
88b9cd9
Merge pull request #39 from methods/feat/auth-script
Lakorthus Aug 1, 2023
cb9ebb4
feat: added question model and related schemas; created helper valida…
piratejas Aug 1, 2023
df6b65c
fix: restored post_bid request example; created new post_question exa…
piratejas Aug 1, 2023
1a30c93
test: added tests for question model; added tests for post question r…
piratejas Aug 1, 2023
84e249e
feat: swagger documentation for questions
Lakorthus Aug 1, 2023
b8662ac
fix: mandatory field added
Lakorthus Aug 1, 2023
a58094e
Merge pull request #41 from methods/docs/swagger-questions
Lakorthus Aug 1, 2023
59e8bfc
Merge pull request #42 from methods/feat/post-question
piratejas Aug 1, 2023
0567316
feat: renamed script files; created questions dummy data
piratejas Aug 1, 2023
b41335e
feafeat: get all and get by id for the questions
Lakorthus Aug 2, 2023
800fb83
feat: completed questions script; added make targets
piratejas Aug 2, 2023
2b231ae
refactor: updated make target authserver for renamed auth-stub
piratejas Aug 2, 2023
a2b38e1
refactor: added make targets to help
piratejas Aug 2, 2023
955e3a3
test: get question 66% done
Lakorthus Aug 2, 2023
22163e1
docs: update scripts readme
piratejas Aug 2, 2023
9b58087
Merge pull request #43 from methods/feat/get-questions
Lakorthus Aug 2, 2023
d443409
Merge pull request #44 from methods/feat/questions-script
piratejas Aug 2, 2023
90684cb
refactor: added check if bid exists and error handler in post questio…
piratejas Aug 2, 2023
0ad60e3
test: get all messages from a bid and 1 message by id
Lakorthus Aug 2, 2023
2217954
refactor: added related bid status to be in_progress criteria; update…
piratejas Aug 2, 2023
2328479
style: updated swagger
piratejas Aug 2, 2023
569c561
fix: added /api prefix to links model and bids.json test data
piratejas Aug 2, 2023
ce5dcd5
feat: put route for a question by id
Lakorthus Aug 3, 2023
d5f17bd
test: update question
Lakorthus Aug 3, 2023
2f36984
Merge pull request #45 from methods/test/get-question
Lakorthus Aug 3, 2023
a5098a3
Merge branch 'develop' into feat/hard-delete-question
piratejas Aug 3, 2023
528ac09
Merge pull request #46 from methods/feat/hard-delete-question
piratejas Aug 3, 2023
805c080
fix: updated tests for recent refactor
piratejas Aug 3, 2023
0e6cdfe
Merge pull request #47 from methods/fix/update-tests
piratejas Aug 3, 2023
f1daed3
refactor: separated make targets into scripts and tools; updated targ…
piratejas Aug 3, 2023
597924d
test: added assertion to test_update_bid_by_id_success
piratejas Aug 3, 2023
2b74c68
fix: added flag to make test target to run coverage report after fail…
piratejas Aug 3, 2023
1b207cd
test: added assertion to test_update_bid_status_success
piratejas Aug 3, 2023
76915cd
test: update question
Lakorthus Aug 3, 2023
9ee9e8a
Merge pull request #48 from methods/test/update-question
Lakorthus Aug 3, 2023
61d0ab0
Merge pull request #49 from methods/refactor/makefile-cleanup
piratejas Aug 3, 2023
bde6d30
test: changed dbconfig to use env variables; added conditional test e…
piratejas Aug 4, 2023
13e7eb5
refactor: added terminal feedback for test-setup target
piratejas Aug 4, 2023
c4c8648
refactor: added dbclean target to root makefile
piratejas Aug 4, 2023
5d930ed
docs: updated readme
piratejas Aug 4, 2023
bda4a13
docs: removed repeated steps in readme
piratejas Aug 4, 2023
f4e6bd8
docs: removed unnecessary steps to install pre-requisites
piratejas Aug 4, 2023
23dced3
fix: flake8 compliance
Lakorthus Aug 4, 2023
9c701f5
docs: reordered steps as some make targets will be unavailable before…
piratejas Aug 4, 2023
4d109db
test: added skip marker to integration test in progress
piratejas Aug 4, 2023
75161f0
fix: C0103: doesn't conform to snake_case naming style (invalid-name)
Lakorthus Aug 4, 2023
926ba45
fix: C0114: Missing module docstring (missing-module-docstring)
Lakorthus Aug 4, 2023
23cabcc
fix: C0411: Wrong import order %s
Lakorthus Aug 4, 2023
a0ae485
Merge pull request #50 from methods/test/integration-setup
piratejas Aug 4, 2023
1994871
Merge branch 'develop' into feat/lint
Lakorthus Aug 4, 2023
7246de6
fix: merge conflicts
Lakorthus Aug 4, 2023
38c1a22
Merge pull request #51 from methods/feat/lint
Lakorthus Aug 4, 2023
141a213
feat: updated swagger; created pagination validation helper function;…
piratejas Aug 7, 2023
a4ad121
test: tested validate_pagination; wip - mocking chained db call with …
piratejas Aug 8, 2023
30c8be1
refactor: get bids with sort
Lakorthus Aug 8, 2023
ee7dfdf
test: debugged get tests
piratejas Aug 8, 2023
aa8eb39
refactor: modified script and test_data for larger dataset
piratejas Aug 8, 2023
ac2fcf4
refactor: refactor and renamed validate_questions_sort
piratejas Aug 8, 2023
e54bb37
test: added tests for invalid pagination
piratejas Aug 9, 2023
63e6871
test: added reused test variables to configtest file as fixtures
piratejas Aug 9, 2023
53c830b
docs: updated swagger for sort param
piratejas Aug 9, 2023
04f96c6
refactor: modified validate_sort helper to allow reuse
piratejas Aug 9, 2023
4729223
test: bid test with pagination and sort
Lakorthus Aug 9, 2023
9308192
Merge pull request #52 from methods/feat/bids-pag-sort
Lakorthus Aug 9, 2023
d73b11b
feat: added create and drop indexes commands to updated swagger with …
piratejas Aug 9, 2023
b26174a
test: added endpoint tests for get
piratejas Aug 9, 2023
b7fee87
Merge pull request #53 from methods/refactor/pagination
piratejas Aug 9, 2023
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
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
max-line-length = 120
exclude = .venv *.json

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

Expand Down Expand Up @@ -127,6 +126,9 @@ venv/
ENV/
env.bak/
venv.bak/
commit_message.txt
./commit_message.txt


# Spyder project settings
.spyderproject
Expand Down Expand Up @@ -158,3 +160,4 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.DS_Store
41 changes: 41 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[FORMAT]

# Set the maximum line length to 100 characters
max-line-length=120

[MESSAGES CONTROL]
disable=
C0103,
C0116,
; C0114,
C0115,
; C0411,
R0801,
R0902,
R0903,
R0913,
R0914,
R1710,
W0102,
W0613,
W0621,
W0622,
W0718,
W3101
# C0103: doesn't conform to snake_case naming style (invalid-name)<- missing just helper functions
# C0116: Missing function or method docstring
# C0114: Missing module docstring (missing-module-docstring)
# C0115: Missing class docstring
# C0411: Wrong import order %s
# R0801: Similar lines in %s files
# R0902: Too many instance attributes
# R0903: Too few public methods
# R0913: Too many arguments
# R0914: Too many local variables
# R1710: Either all return statements in a function should return an expression, or none of them should.
# W0102: Dangerous default value %s as argument
# W0613: Unused argument
# W0621: Redefining name %r from outer scope (line %s)
# W0622: Redefining built-in 'foo' (redefined-builtin)
# W0718: Catching too general exception Exception
# W3101: Missing timmeout can expose you to a DOS attack
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.formatting.provider": "none"
}
80 changes: 76 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,82 @@
Contributing guidelines
=======================
# Contributing guidelines

### Git workflow
## Git workflow

* Use git-flow - create a feature branch from `develop`, e.g. `feature/new-feature`
* Use git-flow - create a feature branch from `develop`, e.g. `feat/new-feature`
* Pull requests must contain a succinct, clear summary of what the user need is driving this feature change
* Ensure your branch contains logical atomic commits before sending a pull request
* You may rebase your branch after feedback if it's to include relevant updates from the develop branch. It is preferable to rebase here then a merge commit as a clean and straight history on develop with discrete merge commits for features is preferred
* To find out more about contributing click [here](https://contributing.md/)

## Branching
* Branches should be named in the following format:
```textbox
<type>/<description>
```
where `type` is one of the following:
```textbox
* fix: for a bug fix
* feat: for a new feature
* docs: for documentation changes
* style: for changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* refactor: for refactoring production code
* test: for adding tests
* chore: for updating build tasks, package manager configs, etc
* build: for changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
```
and `description` is a short description of the feature or fix being made
* e.g. `feat/new-feature` or `fix/bug-fix`
* Branches should be created from the `develop` branch
* Branches should be merged back into the `develop` branch

## Commit messages

Please use the following format for commit messages:

```textbox
* fix: for a bug fix
* feat: for a new feature
* docs: for documentation changes
* style: for changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* refactor: for refactoring production code
* test: for adding tests
* chore: for updating build tasks, package manager configs, etc
* build: for changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
```

## Pull requests

* Pull requests should be made to the `develop` branch
* Pull requests should be made from a feature branch, not `develop`
* Pull requests should be made with a succinct, clear summary of what the user need is driving this feature change
* An automated template will be provided to help with this process, please fill it out as best you can

## Release branches and Tagging

* Once a single or set of changes has been made that can be released, we create a release branch off develop
* Releases should be as small as possible so that it is easier to fix issues and rollback code in production environment without losing many features at once
* Release branches should be of the following structure:

```sh
release/0.1.0
```

* The release name should abide by [semantic versioning (semver)](https://semver.org/)
* Once release branch has been created, a pull request should be made against the `main` branch
* Once approved, the release branch can be merged locally :warning: **WARNING - Do not push to remote** :warning:
* Tag the release and push to remote - [see tagging](#tagging)

## Tagging

* Tag latest commit on branch, this should be the local merge commit
* Check latest local commit, run: `git show HEAD`
* Create tag, run: `tag -s <tag> -m <message>`
* where `tag` is the semver value (should be taken from the release branch name) and `<message>` is a general, short and concise message of the change
* Push release merge and tag to remote, run: `git push --follow-tags`
* Once pushed, go to the Github releases page for the repository in question, which can be found by clicking on the <> Code tab and clicking on Releases on the right hand side:
* Select Tags
* Click on the v0.1.0 tag that you just created
* Choose Create release from tag
* Copy the release name and make human-friendly (capitalise, remove /) to create a release title (e.g. release/0.1.0 -> Release 0.1.0)
* Add relevant release notes, this can be expanded from initial message created against the tag. Advised to use bullet points to list out changes
* Hit Publish release
105 changes: 105 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
.ONESHELL:

.DEFAULT_GOAL := run

PYTHON = ./.venv/bin/python3
PIP = ./.venv/bin/pip


.PHONY: help auth clean dbclean mongostart mongostop run setup swag test test-setup

help:
@echo "make help - display this help"
@echo "make auth - run auth api application"
@echo "make build - create and activate virtual environment"
@echo "make clean - remove all generated files"
@echo "make dbclean - clear the application database"
@echo "make mongostart - start local mongodb instance"
@echo "make mongostop - stop local mongodb instance"
@echo "make run - run the application"
@echo "make swag - open swagger documentation"
@echo "make setup - setup the application database"
@echo "make test - run tests and coverage report"
@echo "make test-setup - setup the test database"
@echo "make helptools - display help for tools"

auth:
$(PYTHON) ../tdse-accessForce-auth-stub/app.py

build: requirements.txt
python3 -m venv .venv
$(PIP) install -r requirements.txt
. ./.venv/bin/activate

clean:
@echo "Cleaning up..."
@find . -name "__pycache__" -type d -exec rm -rf {} +
@find . -name ".pytest_cache" -exec rm -rf {} +
@find . -name ".venv" -exec rm -rf {} +

dbclean:
@echo "Cleaning up database..."
cd ./scripts/; \
make dbclean
@echo "Database cleared."

mongostart:
@echo "Starting MongoDB..."
brew services start [email protected]

mongostop:
@echo "Stopping MongoDB..."
brew services stop [email protected]

run: build
$(PYTHON) app.py

setup:
@echo "Setting up application database..."
cd ./scripts/; \
make dbclean; \
make bids; \
make questions
@echo "Database setup complete."

swag:
open http://localhost:8080/api/docs/#/

test:
-coverage run -m pytest -vv
@echo "TEST COVERAGE REPORT"
coverage report -m --omit="app.py,tests/*,dbconfig/*"

test-setup:
@echo "Setting up test database..."
export TEST_ENVIRONMENT=true; \
cd ./scripts/; \
make dbclean; \
make bids; \
make questions; \
export TEST_ENVIRONMENT=
@echo "Test database setup complete."

.PHONY: helptools authplay branch check commit format lint

helptools:
make -f tools.mk help

authplay:
cd ./scripts/; \
make authplay

branch:
make -f tools.mk branch

check:
make -f tools.mk check

commit:
make -f tools.mk commit

format:
make -f tools.mk format

lint:
make -f tools.mk lint
Loading