Skip to content

Commit

Permalink
Merge pull request #3056 from SEED-platform/develop
Browse files Browse the repository at this point in the history
Merge to release 2.13.0-pr1
  • Loading branch information
nllong committed Dec 28, 2021
2 parents dfdd541 + 1802767 commit 4991f2f
Show file tree
Hide file tree
Showing 99 changed files with 2,171 additions and 1,427 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
tox_env: [flake8, docs]
tox_env: [flake8, docs, mypy]
steps:
-
uses: actions/checkout@v2
-
uses: actions/setup-python@v2
with:
python-version: '3.7'
python-version: '3.9'
-
name: Install deps
run: |
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# SEED Version 2.13.0 Prerelease 1

Date Range: 11/20/21 - 12/27/21

Closed Issues and Features (Total: 17):
- Fixed [#2702]( https://github.com/SEED-platform/seed/issues/2702 ), Add sample data record for BETTER
- Fixed [#2813]( https://github.com/SEED-platform/seed/issues/2813 ), Update Portfolio Manager Defaults column mapping profile
- Fixed [#2890]( https://github.com/SEED-platform/seed/issues/2890 ), Update deprecated JSONFields
- Fixed [#2902]( https://github.com/SEED-platform/seed/issues/2902 ), XMLSchema fails to fetch gbXML Schema
- Fixed [#2930]( https://github.com/SEED-platform/seed/issues/2930 ), BuildingSync: improve UI/UX for post-mapping messages
- Fixed [#2958]( https://github.com/SEED-platform/seed/issues/2958 ), Improve progress data text when validating BuildingSync files
- Fixed [#2960]( https://github.com/SEED-platform/seed/issues/2960 ), BuildingSync: allow users to export warnings/errors when importing data
- Fixed [#2999]( https://github.com/SEED-platform/seed/issues/2999 ), Bug: property details "notes" tab breaks links
- Fixed [#3018]( https://github.com/SEED-platform/seed/issues/3018 ), Delete column timeout
- Fixed [#3027]( https://github.com/SEED-platform/seed/issues/3027 ), Configure OEP k8s
- Fixed [#3028]( https://github.com/SEED-platform/seed/issues/3028 ), Fix: electricity meter import from ESPM custom report
- Fixed [#3034]( https://github.com/SEED-platform/seed/issues/3034 ), RFC: begin using python 3 type hints in codebase
- Fixed [#3039]( https://github.com/SEED-platform/seed/issues/3039 ), Create new inventory list
- Fixed [#3040]( https://github.com/SEED-platform/seed/issues/3040 ), Refactor list API to make adding related data

# SEED Version 2.12.4

Date Range: 11/11/21 - 11/19/21
Expand Down
18 changes: 0 additions & 18 deletions commitlint.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions config/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

ROOT_URLCONF = 'config.urls'

INSTALLED_APPS = (
DJANGO_CORE_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.flatpages',
Expand Down Expand Up @@ -131,7 +131,7 @@
# Internal apps can resolve this via South's depends_on.
HIGH_DEPENDENCY_APPS = ('seed.landing',) # 'landing' contains SEEDUser

INSTALLED_APPS = HIGH_DEPENDENCY_APPS + INSTALLED_APPS + SEED_CORE_APPS
INSTALLED_APPS = HIGH_DEPENDENCY_APPS + DJANGO_CORE_APPS + SEED_CORE_APPS

# apps to auto load name spaced URLs for JS use (see seed.urls)
SEED_URL_APPS = (
Expand Down
4 changes: 3 additions & 1 deletion docker/backup_k8s/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
# script that is copied into this container for use by helm/k8s batch/CronJob.

# docker build -t seedplatform/seed-backup-k8s .
# docker push seedplatform/seed-backup-k8s:latest
# tag this as needed, latest is automaticallly pulled by helm at the moment.
# docker tag seedplatform/seed-backup-k8s:latest seedplatform/seed-backup-k8s:{tag}
# docker push seedplatform/seed-backup-k8s:{tag}

FROM ubuntu:20.04

Expand Down
10 changes: 6 additions & 4 deletions docker/backup_k8s/backup_database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ do
echo "Backing up $file to $S3_BUCKET/$RUN_DATE/"
if [ ! -s $file ]; then
# the file is empty, send an error
send_slack_notification "[ERROR-$ENVIRONMENT]-PostgreSQL-backup-file-was-empty"
send_slack_notification "[ERROR-$ENVIRONMENT]-PostgreSQL-backup-file-was-empty-or-missing"
else
# can't pass spaces to slack notifications, for now
aws s3 cp $file $S3_BUCKET/$RUN_DATE/
send_slack_notification "[$ENVIRONMENT]-PostgreSQL-uploaded-to-s3://$S3_BUCKET/$RUN_DATE/$file"
send_slack_notification "[$ENVIRONMENT]-PostgreSQL-uploaded-to-$S3_BUCKET/$RUN_DATE/$(basename $file)"
fi
done

Expand All @@ -103,10 +104,11 @@ do

if [ ! -s $file ]; then
# the file is empty, send an error
send_slack_notification "[ERROR-$ENVIRONMENT]-Mediadata-backup-file-was-empty"
send_slack_notification "[ERROR-$ENVIRONMENT]-Mediadata-backup-file-was-empty-or-missing"
else
# can't pass spaces to slack notifications, for now
aws s3 cp $file $S3_BUCKET/$RUN_DATE/
send_slack_notification "[$ENVIRONMENT]-Mediadata-uploaded-to-s3://$S3_BUCKET/$RUN_DATE/$file"
send_slack_notification "[$ENVIRONMENT]-Mediadata-uploaded-to-$S3_BUCKET/$RUN_DATE/$(basename $file)"
fi
done

Expand Down
82 changes: 38 additions & 44 deletions docs/source/developer_resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,44 @@ To run flake locally call:
tox -e flake8
Python Type Hints
^^^^^^^^^^^^^^^^^

Python type hints are beginning to be added to the SEED codebase. The benefits are
eliminating some accidental typing mistakes to prevent bugs as well as a better IDE
experience.

Usage
*****

SEED does not require exhaustive type annotations, but it is recommended you add them if you
create any new functions or refactor any existing code where it might be beneficial
and not require a ton of additional effort.

When applicable, we recommend you use `built-in collection types <https://docs.python.org/3/whatsnew/3.9.html#type-hinting-generics-in-standard-collections>`_
such as :code:`list`, :code:`dict` or :code:`tuple` instead of the capitalized types
from the :code:`typing` module.

Common gotchas:
- If trying to annotate a class method with the class itself, import :code:`from __future__ import annotations`
- If you're getting warnings about runtime errors due to a type name, make sure your IDE is set up to point to an environment with python 3.9
- If you're wasting time trying to please the type checker, feel free to throw :code:`# type: ignore` on the problematic line (or at the top of the file to ignore all issues for that file)

Type Checking
*************

CI currently runs static type checking on the codebase using `mypy <http://mypy-lang.org/>`_. For
your own IDE, we recommend the following extensions:

- VSCode: `Pylance <https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance>`_ (uses Microsoft's Pyright type checking)

To run the same typechecking applied in CI (i.e. using mypy) you can run the following

.. code-block:: console
tox -e mypy
Django Notes
------------

Expand Down Expand Up @@ -362,50 +400,6 @@ Best Practices
8. Use the “DO NOT MERGE” label for Pull Requests that should not be merged
9. When PR has been reviewed and approved, move the ticket/issue to the 'Ready to Deploy to Dev' box in the GitHub project tracker.

Git Naming Conventions
----------------------

Commit messages should follow the format of

.. code-block:: console
<type>[( optional scope )]: <subject>
[optional body]
:code:`type` must be one of the following:

- **docs**: Changes to the documentation (e.g. improving docstring, updating this file, etc)
- **feat**: Adds a new feature
- **fix**: A bug fix
- **refactor**: Changes that don't fix a bug or add a new feature
- **style**: Changes that don't affect the meaning of code (e.g. whitespace)
- **test**: Adding or correcting tests

:code:`scope` is optional for commit messages, and should indicate the general area of the application affected.

:code:`subject` is a short description of the changes in imperative present tense (such as “add function to _”, not “added function”)

Branches should be named as :code:`[<optional issue number> -]<type>/<scope>`, where :code:`scope` is the general scope affected, or if creating a feature branch, a shortened name of the feature being added. If :code:`scope` is more than one word, it should be separated by dashes.

Pull Request titles should follow the format :code:`[# optional issue number] <type>[(optional scope)]: <subject>`, following the same conventions as commit messages.

Commit examples:

- :code:`feat(models): add date_modified field to MyModel`
- :code:`refactor: change var to let/const in frontend`
- :code:`docs: update release instructions`

Branch examples:

- :code:`1234-feat/buildingsync-v2.3-import`
- :code:`5678-refactor/org-views-auth`
- :code:`fix/error-mapping-pm-taxlots`

Pull request examples:

- :code:`#1234 feat(models): add date_modified to MyModel`
- :code:`#4567 refactor: change var to let/const in frontend`

Release Instructions
--------------------
Expand Down
4 changes: 4 additions & 0 deletions docs/source/migrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ local_untracked.py file
),
)
Version 2.13.0
-----------------------
- There are no special migrations needed for this version. Simply run `./manage.py migrate`.

Version 2.12.0 - 2.12.4
-----------------------
- There are no special migrations needed for this version. Simply run `./manage.py migrate`.
Expand Down
5 changes: 5 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[mypy]
ignore_missing_imports = True

[mypy-seed.*.migrations.*]
ignore_errors = True

0 comments on commit 4991f2f

Please sign in to comment.