Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initial implementation [BB-7595] #3

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
b65a645
style: add ruff
Agrendalath Aug 27, 2023
bb52142
style: add yamllint
Agrendalath Aug 27, 2023
515e647
docs: create ADRs
Agrendalath Oct 24, 2023
f17423b
docs: add repo visualization to README
Agrendalath Oct 24, 2023
8045f3b
docs: update CHANGELOG
Agrendalath Oct 24, 2023
2189a53
chore: update requirements
Agrendalath Oct 24, 2023
d6d9105
test: exclude tests from coverage
Agrendalath Oct 24, 2023
6542508
build: make `manage.py` executable
Agrendalath Oct 24, 2023
be229da
feat: initial implementation
Agrendalath Oct 24, 2023
68631e1
test: add tests
Agrendalath Oct 24, 2023
6181e4e
fixup! chore: update requirements
Agrendalath Nov 15, 2023
127df64
chore: upgrade tox from `v3` to `v4` and remove `tox-battery`
Agrendalath Nov 15, 2023
16f9878
fixup! feat: initial implementation
Agrendalath Nov 15, 2023
be1e58e
fixup! feat: initial implementation
Agrendalath Nov 15, 2023
25d985b
fixup! feat: initial implementation
Agrendalath Nov 15, 2023
a3edc9b
fixup! test: add tests
Agrendalath Nov 15, 2023
a083d4f
fixup! feat: initial implementation
Agrendalath Nov 15, 2023
8ca21bb
chore: update requirements
Agrendalath Jan 10, 2024
ee44ba0
docs: add quickstart docs
Agrendalath Jan 10, 2024
bc2b028
fix: use correct format for generation function options docstring
Agrendalath Jan 10, 2024
2be923b
feat: send emails for generated certificates
Agrendalath Jan 11, 2024
5115f40
fixup! feat: send emails for generated certificates
Agrendalath Jan 11, 2024
263aa51
fix: fix celery tasks
Agrendalath Jan 11, 2024
aeeaa72
feat: do not regenerate certificates all the time
Agrendalath Jan 11, 2024
b28e022
feat: do not send emails to inactive users
Agrendalath Jan 11, 2024
d5d99f6
fix: do not regenerate certificates from the celery task
Agrendalath Jan 11, 2024
033a49a
fixup! fix: do not regenerate certificates from the celery task
Agrendalath Jan 11, 2024
7daf6f3
feat: run Django admin generation tasks with Celery
Agrendalath Jan 11, 2024
4a225d8
fixup! fix: fix celery tasks
Agrendalath Jan 15, 2024
07335fb
fix: validate course ID in Django admin instead of raising an error
Agrendalath Jan 15, 2024
711dbf6
temp: add certificate created and modified date to Django admin
Agrendalath Jan 15, 2024
bfcc991
feat: allow changing text color on generated PDF
Agrendalath Jan 15, 2024
2de93b2
feat: add issue date to PDF certificates
Agrendalath Jan 16, 2024
de3b56e
fixup! docs: add quickstart docs
Agrendalath Jan 16, 2024
12626cf
fixup! feat: send emails for generated certificates
Agrendalath Jan 16, 2024
de9b5a8
feat: custom domains for certificates
Agrendalath Jan 16, 2024
2a88fd8
fixup! feat: add issue date to PDF certificates
Agrendalath Jan 16, 2024
cc3230a
feat: display custom options for course configuration in Django admin
Agrendalath Jan 16, 2024
85854ca
fixup! feat: display custom options for course configuration in Djang…
Agrendalath Jan 16, 2024
17ed355
fixup! feat: display custom options for course configuration in Djang…
Agrendalath Jan 17, 2024
29ffdf3
fixup! feat: display custom options for course configuration in Djang…
Agrendalath Jan 17, 2024
57b68b2
feat: encrypt generated PDF to prevent modifications
Agrendalath Jan 18, 2024
5b31e4d
test: add migration checks to tox
Agrendalath Jan 23, 2024
ff92838
feat: allow overriding course name
Agrendalath Jan 23, 2024
c52a657
fix: support multiline course names
Agrendalath Mar 22, 2024
d799a24
fix: clean up periodic tasks when deleting course configurations
Agrendalath Mar 25, 2024
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
52 changes: 36 additions & 16 deletions .annotation_safe_list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,54 @@
# ".. choice_annotation:": foo, bar, baz

admin.LogEntry:
".. no_pii:": "This model has no PII"
".. no_pii:": This model has no PII
auth.Group:
".. no_pii:": "This model has no PII"
".. no_pii:": This model has no PII
auth.Permission:
".. no_pii:": "This model has no PII"
".. no_pii:": This model has no PII
auth.User:
".. pii": "This model minimally contains a username, password, and email"
".. pii_types": "username, email_address, password"
".. pii_retirement": "consumer_api"
".. pii": This model minimally contains a username, password, and email
".. pii_types": username, email_address, password
".. pii_retirement": consumer_api
contenttypes.ContentType:
".. no_pii:": "This model has no PII"
".. no_pii:": This model has no PII
completion.BlockCompletion:
".. no_pii:": This model has no PII
completion_aggregator.Aggregator:
".. no_pii:": This model has no PII
completion_aggregator.CacheGroupInvalidation:
".. no_pii:": This model has no PII
completion_aggregator.StaleCompletion:
".. pii": This model contains a username; the entries are regularly cleaned up (usually every hour)
django_celery_beat.ClockedSchedule:
".. no_pii:": This model has no PII
django_celery_beat.CrontabSchedule:
".. no_pii:": This model has no PII
django_celery_beat.IntervalSchedule:
".. no_pii:": This model has no PII
django_celery_beat.PeriodicTask:
".. no_pii:": This model has no PII
django_celery_beat.PeriodicTasks:
".. no_pii:": This model has no PII
django_celery_beat.SolarSchedule:
".. no_pii:": This model has no PII
sessions.Session:
".. no_pii:": "This model has no PII"
".. no_pii:": This model has no PII
social_django.Association:
".. no_pii:": "This model has no PII"
".. no_pii:": This model has no PII
social_django.Code:
".. pii:": "Email address"
".. pii:": Email address
".. pii_types:": other
".. pii_retirement:": local_api
social_django.Nonce:
".. no_pii:": "This model has no PII"
".. no_pii:": This model has no PII
social_django.Partial:
".. no_pii:": "This model has no PII"
".. no_pii:": This model has no PII
social_django.UserSocialAuth:
".. no_pii:": "This model has no PII"
".. no_pii:": This model has no PII
waffle.Flag:
".. no_pii:": "This model has no PII"
".. no_pii:": This model has no PII
waffle.Sample:
".. no_pii:": "This model has no PII"
".. no_pii:": This model has no PII
waffle.Switch:
".. no_pii:": "This model has no PII"
".. no_pii:": This model has no PII
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ omit =
*admin.py
*/static/*
*/templates/*
*/tests/*
*/settings/*
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,4 @@ trim_trailing_whitespace = false
[COMMIT_EDITMSG]
max_line_length = 72

[*.rst]
max_line_length = 79

# f2f02689fced7a2e0c62c2f9803184114dc2ae4b
54 changes: 29 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [main]
pull_request:
branches:
- '**'
- '**'


jobs:
Expand All @@ -19,27 +19,31 @@ jobs:
toxenv: [quality, docs, pii_check, django32, django40, package]

steps:
- uses: actions/checkout@v3
- name: setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install pip
run: pip install -r requirements/pip.txt

- name: Install Dependencies
run: pip install -r requirements/ci.txt

- name: Run Tests
env:
TOXENV: ${{ matrix.toxenv }}
run: tox

- name: Run coverage
if: matrix.python-version == '3.8' && matrix.toxenv == 'django32'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
fail_ci_if_error: true
- uses: actions/checkout@v3
- name: setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: setup graphviz
if: matrix.toxenv == 'docs'
uses: ts-graphviz/setup-graphviz@v1

- name: Install pip
run: pip install -r requirements/pip.txt

- name: Install Dependencies
run: pip install -r requirements/ci.txt

- name: Run Tests
env:
TOXENV: ${{ matrix.toxenv }}
run: tox

- name: Run coverage
if: matrix.python-version == '3.8' && matrix.toxenv == 'django32'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
fail_ci_if_error: true
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [main]
pull_request:
branches:
- '**'
- '**'

jobs:
lint:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upgrade-python-requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Upgrade Python Requirements

on:
schedule:
- cron: "0 2 * * 1"
- cron: 0 2 * * 1
workflow_dispatch:
inputs:
branch:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pip-log.txt
coverage.xml
htmlcov/
pii_report/
default.db



Expand Down
44 changes: 22 additions & 22 deletions .pii_annotations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ annotations:
"pii_group":
- ".. pii:":
- ".. pii_types:":
choices:
- id # Unique identifier for the user which is shared across systems
- name # Used for any part of the user's name
- username
- password
- location # Used for any part of any type address or country stored
- phone_number # Used for phone or fax numbers
- email_address
- birth_date # Used for any part of a stored birth date
- ip # IP address
- external_service # Used for external service ids or links such as social media links or usernames, website links, etc.
- biography # Any type of free-form biography field
- gender
- sex
- image
- video
- other
choices:
- id # Unique identifier for the user which is shared across systems
- name # Used for any part of the user's name
- username
- password
- location # Used for any part of any type address or country stored
- phone_number # Used for phone or fax numbers
- email_address
- birth_date # Used for any part of a stored birth date
- ip # IP address
- external_service # Used for external service ids or links such as social media links or usernames, website links, etc.
- biography # Any type of free-form biography field
- gender
- sex
- image
- video
- other
- ".. pii_retirement:":
choices:
- retained # Intentionally kept for legal reasons
- local_api # An API exists in this repository for retiring this information
- consumer_api # The data's consumer must implement an API for retiring this information
- third_party # A third party API exists to retire this data
choices:
- retained # Intentionally kept for legal reasons
- local_api # An API exists in this repository for retiring this information
- consumer_api # The data's consumer must implement an API for retiring this information
- third_party # A third party API exists to retire this data
extensions:
python:
- py
12 changes: 11 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@ version: 2
sphinx:
configuration: docs/conf.py

build:
os: ubuntu-22.04
tools:
python: "3.8"
apt_packages:
- graphviz

python:
version: 3.8
install:
- requirements: requirements/doc.txt

formats:
- epub
- pdf
22 changes: 22 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
extends: default

ignore: |
.pytest_cache/
.ruff_cache/
.tox/
pii_report/
venv/
rules:
indentation:
spaces: consistent
check-multi-line-strings: true
line-length: disable
document-start: disable
quoted-strings:
quote-type: any
required: only-when-needed
braces:
forbid: non-empty
level: warning
truthy:
check-keys: false
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ Unreleased

*

0.1.0 – 2023-08-17
0.1.0 – 2023-09-17
**********************************************

Added
=====

* First release on PyPI.
* Initial implementation of the certificates app.
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,18 @@ piptools: ## install pinned version of pip-compile and pip-sync
requirements: piptools ## install development environment requirements
pip-sync -q requirements/dev.txt requirements/private.*

lint: ## lint all Python files
lint: ## lint all files
black .
yamllint .

test: clean ## run tests in the current virtualenv
pytest

diff_cover: test ## find diff lines that need test coverage
diff-cover coverage.xml

test-all: quality pii_check ## run tests on every supported Python/Django combination
tox
tox -e docs
tox -e package
test-all: ## run all tests
tox --parallel

validate: quality pii_check test ## run tests and quality checks

Expand Down
Loading