Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 26 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## What?
Explain the changes you've made
## Why?
The “why” tells us what business or engineering goal this change achieves
## How?

## Testing?
[ ] Functional Testing

[ ] Security

[ ] Performance

[ ] Error Handling

[ ] Code Quality

[ ] Documentation

[ ] Database

[ ] Deployment

[ ] Final Review

## Anything Else?
28 changes: 28 additions & 0 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install flake8==4.0.1
pip install bandit==1.7.8
- name: Run Flake8
run: |
flake8
- name: Run Bandit
run: |
bandit -r .
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
language_version: python3.10
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/PyCQA/bandit
rev: 1.7.8
hooks:
- id: bandit
args: ["-r", ".", "-x", "**/venv/*"]
pass_filenames: false
10 changes: 3 additions & 7 deletions bootstrap_service/management/commands/init_organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ def handle(self, *args, **kwargs): # noqa: C901
org_name = kwargs.get("org_name") or os.getenv("ORG_NAME")
org_slug = kwargs.get("org_slug") or os.getenv("ORG_SLUG")
owner_email = kwargs.get("owner_email") or os.getenv("OWNER_EMAIL")
owner_password = kwargs.get("owner_password") or os.getenv(
"OWNER_PASSWORD"
)
owner_password = kwargs.get("owner_password") or os.getenv("OWNER_PASSWORD")
org_id = str(uuid.uuid4())

self.stdout.write(
Expand All @@ -57,9 +55,7 @@ def handle(self, *args, **kwargs): # noqa: C901
result = existing
else:
self.stdout.write(
self.style.SUCCESS(
f"Provisioning organization '{org_slug}'..."
)
self.style.SUCCESS(f"Provisioning organization '{org_slug}'...")
)
result = provisioner.provision_tenant(org_id, org_slug, 1112)

Expand Down Expand Up @@ -89,7 +85,7 @@ def handle(self, *args, **kwargs): # noqa: C901

celery_app = import_string(settings.CELERY_APP)
encrypted_password = make_password(owner_password)

celery_app.send_task(
name="spacedf.tasks.new_organization",
exchange=Exchange("new_organization", type="fanout"),
Expand Down