Skip to content

Commit

Permalink
Remove Flask and example database models (#4)
Browse files Browse the repository at this point in the history
* Add Chainlit

* Sort imports and remove tests

* Formatting and linting

* Remove Flask and example data models

* Restore pull request template

* Update Trivyignore

* Add ignore to markdown linting

* Update ignore pattern

* Update ignore pattern

* Remove outdated API documentation
  • Loading branch information
KevinJBoyer authored Jun 24, 2024
1 parent b374792 commit 8e604d1
Show file tree
Hide file tree
Showing 52 changed files with 833 additions and 3,289 deletions.
17 changes: 15 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
- [ ] Update PR Title to follow this pattern: `[INTENT]: [MESSAGE]`

> The title will become a one-line commit message in the git log, so be as concise and specific as possible -- refer to [How to Write a Git Commit Message](https://cbea.ms/git-commit/). Prepend [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/#summary) intent (`fix:`, `feat:`, `chore:`, `ci:`, `docs:`, `style:`, `refactor:`, `perf:`, `test:`).
## Ticket

Resolves #{TICKET NUMBER OR URL}
https://navalabs.atlassian.net/browse/DST-<TICKET_NUMBER_HERE>


## Changes

> What was added, updated, or removed in this PR.
> Prefer small PRs; try to limit to 300 lines of code changes
> * https://blog.logrocket.com/using-stacked-pull-requests-in-github/
> * https://opensource.com/article/18/6/anatomy-perfect-pull-request
> * https://developers.google.com/blockly/guides/modify/contribute/write_a_good_pr

## Context for reviewers

> Testing instructions, background context, more in-depth details of the implementation, and anything else you'd like to call out or ask reviewers.
> Background context, more in-depth details of the implementation, and anything else you'd like to call out or ask reviewers.
> Add comments to your code under the "Files Changed" tab to explain complex logic or code
> * https://betterprogramming.pub/how-to-make-a-perfect-pull-request-3578fb4c112

## Testing

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/markdownlint-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
},
{
"pattern": "127.0.0.1"
},
{
"pattern": "https://navalabs.atlassian.net/browse/DST-"
}
],
"replacementPatterns": [
Expand Down
3 changes: 2 additions & 1 deletion .trivyignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
# Link to the dependencies for ease of checking for updates
# Issue: Why there is a finding and why this is here or not been removed
# Last checked: Date last checked in scans
#The-CVE-or-vuln-id # Remove comment at start of line
#The-CVE-or-vuln-id # Remove comment at start of line
jwt-token
19 changes: 0 additions & 19 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ else
PY_RUN_CMD := docker compose run $(DOCKER_EXEC_ARGS) --rm $(APP_NAME) poetry run
endif

FLASK_CMD := $(PY_RUN_CMD) flask --env-file local.env

# Docker user configuration
# This logic is to avoid issues with permissions and mounting local volumes,
# which should be owned by the same UID for Linux distros. Mac OS can use root,
Expand Down Expand Up @@ -211,23 +209,6 @@ lint-security: # https://bandit.readthedocs.io/en/latest/index.html
$(PY_RUN_CMD) bandit -c pyproject.toml -r . --number 3 --skip B101 -ll -x ./.venv


##################################################
# CLI Commands
##################################################

cmd: ## Run Flask app CLI command (Run `make cli args="--help"` to see list of CLI commands)
$(FLASK_CMD) $(args)

cmd-user-create-csv: ## Create a CSV of the useres in the database (Run `make cli-user-create-csv args="--help"` to see the command's options)
$(FLASK_CMD) user create-csv $(args)

# Set init-db as pre-requisite since there seems to be a race condition
# where the DB can't yet receive connections if it's starting from a
# clean state (e.g. after make stop, make clean-volumes, make openapi-spec)
openapi-spec: init-db ## Generate OpenAPI spec
$(FLASK_CMD) spec --format yaml --output ./openapi.generated.yml


##################################################
# Miscellaneous Utilities
##################################################
Expand Down
25 changes: 0 additions & 25 deletions app/gunicorn.conf.py

This file was deleted.

2 changes: 0 additions & 2 deletions app/local.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ PYTHONPATH=/app/
# commands that can run in or out
# of the Docker container - defaults to outside

FLASK_APP=src.app:create_app

############################
# Logging
############################
Expand Down
Loading

0 comments on commit 8e604d1

Please sign in to comment.