diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 260b76727..1e1e3b259 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,11 +1,17 @@ ## :memo: Summary -This PR closes/completes/contributes to issue #ANPL-... - +This PR resolves ... + This PR ... - @@ -27,4 +33,4 @@ Merging this PR will have the following side-effects: - [ ] No changes to the documentation are required - [ ] This PR includes all relevant documentation -- [ ] Documentation will be added in the future because ... (see #ANPL-...) +- [ ] Documentation will be added in the future because ... (see issue #...) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a59fb520b..eedbd2c4f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,12 +29,3 @@ repos: - id: flake8 name: flake8 format check entry: bash -c 'flake8 --config=.flake8 $(git diff --name-only --cached --diff-filter=ACMR | grep .py)' - - - repo: local - hooks: - - id: jira-ticket - name: Check for Jira ticket - language: pygrep - entry: '\A(?!ANPL+-[0-9]+)' - args: [--multiline] - stages: [commit-msg] diff --git a/doc/running.md b/doc/running.md index ebcab3a4c..3837fc3bb 100644 --- a/doc/running.md +++ b/doc/running.md @@ -271,19 +271,19 @@ and then ask a colleague for help. ## Run the app -**Assumption**: +**Assumption**: - You have completed your local env setup by following the above sections. - we use aws with sso login, the name of profile for our aws dev account is `admin-dev-sso` ### Local AWS profile setup (on first run only) This app needs to interact with AWS account. The AWS resources like IAM, s3 buckets are under our dev account and will be managed by -app through [boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html). +app through [boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html). In order to make sure the boto3 can obtain the right profile for local env. #### using aws-cli directly -Check your `.aws/config`, the profile `admin-dev-sso` should look like below +Check your `.aws/config`, the profile `admin-dev-sso` should look like below ```ini [profile admin-dev-sso] @@ -296,7 +296,7 @@ __NOTES__ boto3 doesn't recognise `sso_session` and it will fail to retrieve the `.aws/sso/cache` folder if you mix above setting with `sso_session` together. #### using aws-vault -If you use aws-vault to manage your aws credential, then the profile should look like +If you use aws-vault to manage your aws credential, then the profile should look like ```ini [profile sso-default] @@ -385,15 +385,15 @@ Or with Gunicorn WSGI server: ```sh gunicorn -b 0.0.0.0:8000 -k uvicorn.workers.UvicornWorker -w 4 controlpanel.asgi:application ``` -if you use `aws-vault` to manage the aws-cli, then you need put `aws-vault exec -- ` -before the above command e.g. +if you use `aws-vault` to manage the aws-cli, then you need put `aws-vault exec -- ` +before the above command e.g. ```sh aws-vault exec admin-dev-sso -- python3 manage.py runserver ``` If the AWS session token is expired, you will be redirected to auth-flow to refresh the session token automatically -if you choose not using `aws-vault`, then in order to reduce the chance of getting sesion_token expiration during -debugging, make sure you run the following command in advance +if you choose not using `aws-vault`, then in order to reduce the chance of getting sesion_token expiration during +debugging, make sure you run the following command in advance ```sh aws sso login --profile ``` @@ -444,19 +444,7 @@ Current checks are:- - `black` library (formats Python code) - `isort` library (standardises the order of Python imports) - `flake8` library (formats Python code and also improves code style) -- Jira ticket reference (commits must reference the ticket number) To override the above for whatever reason (maybe you don't have a ticket number and because you are working on hotfix) you can use the following command. `PRE_COMMIT_ALLOW_NO_CONFIG=1 git push ...` - -### Git commit message - -Commit messages should follow the appropriate format. -All commits must begin with the Jira ticket they are associated with. - -format: `ANPL-[int]` - -e.g. - -`git commit -m "ANPL-1234 insert message here"`