Skip to content
Open
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
21 changes: 2 additions & 19 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,9 @@ jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11.8
cache: pip

- name: Install Python dependencies
run: pip install black flake8

- name: Run linters
uses: wearerequired/lint-action@v1
with:
black: true
flake8: true
flake8_args: "--ignore E1,E2,E3,E5,W1,W2,W3,W5" # black already handles formatting, this prevents conflicts
- uses: actions/checkout@v6
- uses: psf/black@stable

deploy-to-staging:
needs: run-linters
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
lfs: "true"
submodules: "recursive"

- uses: actions/setup-node@v3
- uses: actions/setup-node@v6
with:
node-version: "14"

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: 3.11.8
cache: pip
Expand Down
30 changes: 4 additions & 26 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,10 @@
name: Lint

on:
- pull_request
on: push

jobs:
run-linters:
name: Run linters
lint:
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11.8
cache: pip

- name: Install Python dependencies
run: pip install black flake8

- name: Run linters
uses: wearerequired/lint-action@v2
with:
auto_fix: true
black: true
black_auto_fix: true
flake8: true
flake8_auto_fix: false # flake8 doesn't support auto_fix
flake8_args: "--ignore E1,E2,E3,E5,W1,W2,W3,W5" # black already handles formatting, this prevents conflicts
- uses: actions/checkout@v6
- uses: psf/black@stable
13 changes: 6 additions & 7 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ['3.11']
Expand All @@ -29,10 +29,10 @@ jobs:
CELERY_BROKER_URL: amqp://guest:guest@localhost:5672/

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
echo "USER_SITE_PATH=$USER_SITE_PATH" >> $GITHUB_ENV

# NOTE: The cache does not seem to detect changes in the requirements files reliably
- uses: actions/cache@v2
- uses: actions/cache@v5
id: cache-dependencies
with:
path: ${{ env.USER_SITE_PATH }}
Expand Down Expand Up @@ -93,15 +93,14 @@ jobs:
python -m coverage json -o coverage.json

- name: Save Test Videos
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: videos
path: app/videos/

- name: Save Code Coverage
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: code_coverage
path: app/coverage.json

24 changes: 14 additions & 10 deletions app/admin_ui/admin/data_models.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
from admin_ui.admin.actions.doi import fetch_dois
from data_models import models
from django.contrib import admin

from data_models import models
from admin_ui.admin.actions.doi import fetch_dois

from .permissions import EnforcedPermissionsMixin
from .inlines.change import InProgressInline, InReviewInline, InAdminReviewInline
from .inlines.change import InAdminReviewInline, InProgressInline, InReviewInline
from .inlines.doi import (
CampaignDoiInline,
CollectionPeriodDoiInline,
DoiCampaignInline,
InstrumentDoiInline,
DoiCollectionPeriodInline,
DoiInstrumentInline,
PlatformDoiInline,
DoiPlatformInline,
CollectionPeriodDoiInline,
DoiCollectionPeriodInline,
InstrumentDoiInline,
PlatformDoiInline,
)

from .permissions import EnforcedPermissionsMixin

LIMITED_INFO_LIST_FIELDS = ("short_name", "long_name")

Expand All @@ -40,7 +39,12 @@ class CollectionPeriodAdmin(BasicAdmin):

@admin.register(models.DOI)
class DoiAdmin(BasicAdmin):
inlines = [DoiCampaignInline, DoiInstrumentInline, DoiPlatformInline, DoiCollectionPeriodInline]
inlines = [
DoiCampaignInline,
DoiInstrumentInline,
DoiPlatformInline,
DoiCollectionPeriodInline,
]


@admin.register(models.PlatformType)
Expand Down
1 change: 0 additions & 1 deletion app/admin_ui/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from . import tables
from .filters import filters, published as published_filters


# any custom values for each model are added to this dictionary
# all models must be defined at a minimum with an empty dictionary

Expand Down
1 change: 0 additions & 1 deletion app/admin_ui/filters/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from data_models import models
from data_models.models import Campaign, Deployment


default_filter_configs = [{"field_name": "short_name", "label": "Short Name"}]


Expand Down
1 change: 0 additions & 1 deletion app/admin_ui/templatetags/navbar_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from django import template
from django.template.loader import get_template


register = template.Library()


Expand Down
6 changes: 2 additions & 4 deletions app/admin_ui/views/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,9 @@ def get(self, request, *args, **kwargs):
if is_deleted:
messages.error(
self.request,
(
f"""The published version of this {self.kwargs['model']} has been deleted
(f"""The published version of this {self.kwargs['model']} has been deleted
and is no longer viewable on the CASEI UI. You can only view the past versions
in the {self.kwargs['model']} history."""
),
in the {self.kwargs['model']} history."""),
)

return super().get(request, *args, **kwargs)
Expand Down
1 change: 0 additions & 1 deletion app/config/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration


# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
Expand Down
1 change: 0 additions & 1 deletion app/data_models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from django.contrib.postgres.search import SearchQuery, SearchVector
from django.db import models


# TODO: Mv to config
FRONTEND_URL = "https://airborne-inventory.surge.sh/"
NOTES_INTERNAL_HELP_TEXT = "Free text notes for ADMG staff, this is NOT visible to the public."
Expand Down
4 changes: 2 additions & 2 deletions app/requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ mypy==0.910 # https://github.com/python/mypy
pytest>=5.0.1 # https://github.com/pytest-dev/pytest
pytest-sugar==0.9.6 # https://github.com/Frozenball/pytest-sugar
freezegun==1.2.2 # https://github.com/spulec/freezegun
playwright==1.38.0
playwright==1.38.0

# Code quality
# ------------------------------------------------------------------------------
flake8==6.0.0 # https://github.com/PyCQA/flake8
coverage==7.0.5 # https://github.com/nedbat/coveragepy
black==22.12.0 # https://github.com/ambv/black
black==26.5.1 # https://github.com/ambv/black
pylint-django==2.5.3 # https://github.com/PyCQA/pylint-django

# Django
Expand Down
1 change: 0 additions & 1 deletion deploy/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from deploy_stacks.app_stack import ApplicationStack
from deploy_stacks.infra_stack import InfraStack


CDK_DEFAULT_REGION = os.environ.get("CDK_DEFAULT_REGION")
CDK_DEFAULT_ACCOUNT = os.environ.get("CDK_DEFAULT_ACCOUNT")
STAGE = os.environ.get("STAGE", default="dev")
Expand Down
Loading