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

release changes to test environment #748

Merged
merged 140 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
bb3879f
feat(mobile): remove image from specific screens on mobile
machikoyasuda Jun 14, 2022
7999e8f
fix(css): desktop image is taller than mobile image
machikoyasuda Jun 14, 2022
6475874
feat: add no-image-mobile to enrollment/retry, remove from eligibility
machikoyasuda Jun 14, 2022
39e9ca4
chore: reflect the sticky settings in Terraform
afeld Jun 15, 2022
a3df42e
fix: disable the FTP service
afeld Jun 15, 2022
c639af9
chore: tweak list of DJANGO_* environment variables that are sticky
afeld Jun 15, 2022
61f6cbc
Merge pull request #694 from cal-itp/fix/disable-ftp
afeld Jun 15, 2022
e44163a
fix(footer): new footer link color is 73B3E7
machikoyasuda Jun 15, 2022
bf94413
fix: add info_link to elig start page
machikoyasuda Jun 15, 2022
af94df0
fix(mobile): on mobile, hide the first info link
machikoyasuda Jun 15, 2022
8cd54df
fix(link): make link width only up to content
machikoyasuda Jun 15, 2022
cdc1278
Fix: New footer link color is #73B3E7 (#696)
machikoyasuda Jun 15, 2022
f1730fe
Fix: Eligibility Start - Links (#697)
machikoyasuda Jun 15, 2022
8987d1e
refactor(oauth): client.instance() returns a new instance
thekaveman Jun 16, 2022
12dffc0
feat(oauth): instance accepts scope parameter
thekaveman Jun 16, 2022
4a08963
refactor(test): make the mocked instance method a fixture
thekaveman Jun 16, 2022
fdefea8
feat(oauth): config client with verifier's auth_scope
thekaveman Jun 16, 2022
5623bcc
feat(ci): label front-end PRs
thekaveman Jun 16, 2022
36edb1e
feat(ci): label back-end PRs
thekaveman Jun 16, 2022
439cd20
feat(ci): label docker PRs
thekaveman Jun 16, 2022
18261e2
feat(ci): label i18n PRs
thekaveman Jun 16, 2022
4586c12
Merge pull request #693 from cal-itp/chore/sticky-settings
afeld Jun 16, 2022
cb89b1f
CI: add a few more PR labelers (#699)
thekaveman Jun 16, 2022
927fb2f
docs: improve readme description
thekaveman Jun 16, 2022
a55d181
Docs: improve readme description (#700)
thekaveman Jun 16, 2022
ffe1cb6
chore: resolve conflict
machikoyasuda Jun 16, 2022
fbcadc8
fix: signout button on enrollment page
machikoyasuda Jun 16, 2022
c85cd6e
Feat: dynamic OAuth scope from verifier (#698)
thekaveman Jun 16, 2022
070c910
feat: add session support for storing and accessing oauth claims
angela-tran Jun 14, 2022
c268841
feat: add logic to 'authorize' view function to store claim in session
angela-tran Jun 14, 2022
2d3c86c
feat: add logic directly to eligibility view to check for auth claims
angela-tran Jun 14, 2022
069eab5
refactor(tests): update test_authorize_success to mock verifier
angela-tran Jun 14, 2022
11202f4
refactor: move api-based verification logic to EligibilityVerifier
angela-tran Jun 14, 2022
c22c17b
refactor: move claims-based verification from eligibility view to model
angela-tran Jun 15, 2022
137e5ba
refactor: move and rename test since it's testing model logic
angela-tran Jun 15, 2022
314abac
refactor(tests): use real fixture objects instead of mocked session
angela-tran Jun 15, 2022
808f673
refactor: move verify logic back to eligibility app
angela-tran Jun 15, 2022
bb4a981
test: add coverage of eligibility_from_oauth
angela-tran Jun 15, 2022
8c48337
test: add coverage for new eligibility view logic
angela-tran Jun 15, 2022
d7d7cef
test: add coverage of oauth view logic for handling claim in response
angela-tran Jun 16, 2022
7b6d5f7
fix(tests): fix false test passage for test_confirm_get_oauth_verified
angela-tran Jun 16, 2022
4ce25d6
refactor(model): EligibilityVerifier now holds one eligibility_type
angela-tran Jun 16, 2022
5f88649
refactor: require that agency's types contain its verifiers types
angela-tran Jun 16, 2022
d7f5348
refactor(tests): use new mocked_oauth_client_instance fixture
angela-tran Jun 16, 2022
764d812
fix(button): fix style on enrollment success log out button
machikoyasuda Jun 16, 2022
1ff8e31
Feat: use oauth claims (#684)
angela-tran Jun 16, 2022
52c0df8
fix: login.gov button on enrollment success, desktop
machikoyasuda Jun 16, 2022
e1ca532
fix(copy): add sentence to start page to inform about age verification
angela-tran Jun 16, 2022
1d92649
feat: helper script regenerates the migration file
thekaveman Jun 16, 2022
311dcdb
docs: describe models and migrations
thekaveman Jun 16, 2022
9ae5255
chore(models): remove help_text, simplify migrations
thekaveman Jun 16, 2022
6930050
Mobile: One column layout for certain mobile pages (#685)
machikoyasuda Jun 17, 2022
c131e71
fix: add third bullet point copy
machikoyasuda Jun 16, 2022
1055e16
fix: add no-image-mobile for all 3 branches of enrollment/success
machikoyasuda Jun 17, 2022
082e147
fix: addd padding under Continue button
machikoyasuda Jun 17, 2022
5ea0ea2
fix: use horizontal photo for eligibility-start page:rt
machikoyasuda Jun 17, 2022
8ec4902
chore: remove debug bar hide
machikoyasuda Jun 17, 2022
cd2de7f
fix(copy): update help copy about partnering to confirm age
angela-tran Jun 16, 2022
d4703a0
fix(copy): update Help page with section on Login.gov verification
angela-tran Jun 16, 2022
d44bf39
test(cypress/ui): add assertion for new Login.gov verify section
angela-tran Jun 16, 2022
16e6007
chore: add TODO and new English copy to the corresponding Spanish entry
angela-tran Jun 17, 2022
1a1549d
Feat: IAL2 help copy (#708)
angela-tran Jun 17, 2022
21a25bb
Fix: add age-verify note to start page (#709)
angela-tran Jun 17, 2022
4aec496
Refactor: models and migrations (#710)
thekaveman Jun 17, 2022
9d12c82
refactor(models): move claim/scope to AuthProvider
thekaveman Jun 16, 2022
b48aec1
feat(models): add OAuth config fields to AuthProvider
thekaveman Jun 17, 2022
ce9494d
refactor(oauth): register each AuthProvider
thekaveman Jun 17, 2022
4dcdef0
refactor(oauth): pass client to deauthorize_redirect
thekaveman Jun 17, 2022
d8ec212
refactor(oauth): create client in views
thekaveman Jun 17, 2022
4af5f5b
docs: update OAuth configuration section
thekaveman Jun 17, 2022
ab798df
chore(settings): remove OAuth configuration
thekaveman Jun 17, 2022
9537c59
fix(view): parse claim result to bool
thekaveman Jun 17, 2022
027d3ae
fix(apps): define in apps.py for proper registration
thekaveman Jun 17, 2022
e3cd32a
fix(oauth): wrap registration in try/catch
thekaveman Jun 17, 2022
f9f635a
chore(oauth): raise exception for unregistered clients
thekaveman Jun 17, 2022
a7e6493
Refactor: oauth client config (#712)
thekaveman Jun 17, 2022
4626931
fix: combine 2 link buttons into 1
machikoyasuda Jun 17, 2022
a04782b
chore: merge dev
machikoyasuda Jun 17, 2022
6471bd8
fix(copy): add smart quote
machikoyasuda Jun 17, 2022
ba35ba8
fix: fix merge conflict issue
machikoyasuda Jun 17, 2022
dd45b3f
chore: remove unused language file entries
angela-tran Jun 21, 2022
a1aadee
Chore: remove unused language file entries (#715)
angela-tran Jun 21, 2022
0b174c5
Fixes for Eligibility Start page (#711)
machikoyasuda Jun 21, 2022
2b2f196
fix(mobile): Enrollment, Eligibility Pages - Fix Sign Out button heig…
machikoyasuda Jun 22, 2022
a55c5ba
fix(mobile): Eligibility Start - link should be regular link style
machikoyasuda Jun 22, 2022
e92e17f
chore(ci): don't run Cypress tests
thekaveman Jun 22, 2022
2bb4d3e
fix(debug bar): add text-break Bootstrap utility class to debug bar s…
machikoyasuda Jun 22, 2022
a0ab453
Fix: Fixes for Eligibility Start Link Style, Debug Bar-related improv…
machikoyasuda Jun 22, 2022
95f9bef
Chore: don't run Cypress tests in CI (#721)
thekaveman Jun 22, 2022
c414b1c
feat(models): many Verifier fields are optional
thekaveman Jun 17, 2022
0a12b85
refactor(models): clearer helper attribute names
thekaveman Jun 17, 2022
3e915e0
refactor(views): handle different verify methods
thekaveman Jun 18, 2022
267c325
fix(tests): query by name rather than number
thekaveman Jun 18, 2022
811c625
feat(fixtures): new verifier configured with oauth provider
thekaveman Jun 21, 2022
64cc162
feat(oauth): support cancelling out of identity proofing
angela-tran Jun 22, 2022
842fd9e
fix: prevent AttributeError when auth_provider is None
angela-tran Jun 22, 2022
9fc7583
test(model): add coverage of EligibilityVerifier.uses_auth_verification
angela-tran Jun 22, 2022
8b840b3
feat(copy): Spanish copy for Enrollment Start and Enrollment Success
machikoyasuda Jun 22, 2022
9554488
chore(deps-dev): bump cypress from 10.1.0 to 10.2.0 in /tests/cypress
dependabot[bot] Jun 22, 2022
03ef311
Merge pull request #717 from cal-itp/dependabot/npm_and_yarn/tests/cy…
angela-tran Jun 22, 2022
4685422
feat(copy): Spanish copy for new Help page questions
machikoyasuda Jun 22, 2022
006de31
Feat: oauth unverified (#718)
angela-tran Jun 22, 2022
897f3c1
feat(copy): Update Spanish copy for Back button, 404
machikoyasuda Jun 22, 2022
1f74d1f
feat(404): Update 404 Copy for Eng and Sp
machikoyasuda Jun 22, 2022
ebc68c8
feat(copy): Update copy on 500 page for Eng and Sp
machikoyasuda Jun 22, 2022
055493e
feat(copy): Update copy for Eligibility Error page on Eng and Sp
machikoyasuda Jun 22, 2022
8455a68
Merge branch 'dev' into feat/copy
machikoyasuda Jun 22, 2022
891ac2a
refactor: create dedicated file for generating logging config
afeld Jun 16, 2022
52bc34b
feat: enable sending of logs to Azure Monitor
afeld Jun 22, 2022
4737e56
fix: remove extra space
machikoyasuda Jun 23, 2022
244c6c2
fix(Spanish): separate out text into 2 paragraphs, use oauth copy
machikoyasuda Jun 23, 2022
2ad4e8a
fix(Connect Card): verify Connect Card copy for Eng and Sp
machikoyasuda Jun 23, 2022
7e3012e
feat: send incoming requests to Azure Monitor logs
afeld Jun 22, 2022
4b47164
Update benefits/locale/es/LC_MESSAGES/django.po
machikoyasuda Jun 23, 2022
6961c73
New Copy for Enrollment Start, Enrollment Success, Help, 404, 500 (#725)
machikoyasuda Jun 23, 2022
d8a83bd
fix(Help): use English and Spanish-specific Login.gov help links on H…
machikoyasuda Jun 23, 2022
4c78d8c
chore: remove comment
machikoyasuda Jun 23, 2022
3ecaf94
fix(Help): use English and Spanish-specific Login.gov Help Center Ver…
machikoyasuda Jun 23, 2022
a52a6c7
chore: set up test instance of Azure Insights
afeld Jun 23, 2022
2e1be40
Spanish language links (#731)
machikoyasuda Jun 23, 2022
086e087
Merge pull request #719 from cal-itp/feat/azure-logging
afeld Jun 23, 2022
7f27b29
Merge pull request #734 from cal-itp/chore/test-insights
afeld Jun 23, 2022
0d95d97
feat: send exceptions to Azure Monitor
afeld Jun 23, 2022
7e12408
Merge pull request #732 from cal-itp/feat/azure-exceptions
afeld Jun 23, 2022
6aa0119
chore: clarify what `sticky_settings` mean
afeld Jun 23, 2022
8ef781b
chore: update list of sticky settings
afeld Jun 23, 2022
4d4dabb
Merge pull request #736 from cal-itp/chore/sticky-fixes
afeld Jun 24, 2022
56165f6
chore: update list of deployment slot settings
afeld Jun 24, 2022
d84ae02
Merge pull request #737 from cal-itp/chore/update-slot-settings
afeld Jun 24, 2022
d3b917e
chore: re-add auto-instrumented variables to deployment slot settings
afeld Jun 24, 2022
e6dd2dc
feat: deploy dev on all pushes
afeld Jun 24, 2022
8341588
Merge pull request #741 from cal-itp/feat/deploy-dev-more
afeld Jun 24, 2022
425ab34
Merge pull request #740 from cal-itp/chore/auto-instrument-settings
afeld Jun 24, 2022
f3f3b68
chore: add debugging messages around Azure configuration
afeld Jun 24, 2022
b42b036
Merge pull request #742 from cal-itp/chore/debug-azure-settings
afeld Jun 24, 2022
c7fc73e
chore: make single workflow for deployment
afeld Jun 24, 2022
3fe051a
chore: allow the SHA of the deployed image to be viewed
afeld Jun 24, 2022
f6034d8
Merge pull request #744 from cal-itp/chore/image-git-sha
afeld Jun 24, 2022
fd77843
chore: enable versioning on the storage account
afeld Jun 27, 2022
55f35d2
Merge pull request #747 from cal-itp/chore/enable-storage-versioning
afeld Jun 27, 2022
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: 0 additions & 52 deletions .github/workflows/deploy-dev.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/deploy-test.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Deploy (prod)
name: Deploy

on:
workflow_dispatch:
push:
branches:
- dev
- test
- prod

defaults:
Expand All @@ -13,13 +15,16 @@ defaults:
jobs:
deploy:
runs-on: ubuntu-latest
environment: prod
concurrency: prod
environment: ${{ github.ref_name }}
concurrency: ${{ github.ref_name }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Write commit SHA to file
run: echo "${{ github.sha }}" >> benefits/static/sha.txt

- name: Docker Login to GitHub Container Registry
uses: docker/login-action@v2
with:
Expand All @@ -35,10 +40,11 @@ jobs:
uses: docker/build-push-action@v3
with:
builder: ${{ steps.buildx.outputs.name }}
build-args: GIT-SHA=${{ github.sha }}
cache-from: type=gha,scope=cal-itp
cache-to: type=gha,scope=cal-itp,mode=max
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:prod
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
ghcr.io/${{ github.repository }}:${{ github.sha }}
16 changes: 16 additions & 0 deletions .github/workflows/labeler-back-end.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Label back-end

on:
pull_request:
types: [opened]
paths:
- 'benefits/**/*.py'

jobs:
label-actions:
runs-on: ubuntu-latest
steps:
- name: add-label
uses: andymckay/labeler@master
with:
add-labels: "back-end"
18 changes: 18 additions & 0 deletions .github/workflows/labeler-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Label docker

on:
pull_request:
types: [opened]
paths:
- '.devcontainer/**'
- '.dockerignore'
- 'Dockerfile'

jobs:
label-actions:
runs-on: ubuntu-latest
steps:
- name: add-label
uses: andymckay/labeler@master
with:
add-labels: "docker"
17 changes: 17 additions & 0 deletions .github/workflows/labeler-front-end.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Label front-end

on:
pull_request:
types: [opened]
paths:
- 'benefits/**/templates/**'
- 'benefits/static/**'

jobs:
label-actions:
runs-on: ubuntu-latest
steps:
- name: add-label
uses: andymckay/labeler@master
with:
add-labels: "front-end"
16 changes: 16 additions & 0 deletions .github/workflows/labeler-i18n.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Label i18n

on:
pull_request:
types: [opened]
paths:
- 'benefits/locale/**'

jobs:
label-actions:
runs-on: ubuntu-latest
steps:
- name: add-label
uses: andymckay/labeler@master
with:
add-labels: "i18n"
28 changes: 0 additions & 28 deletions .github/workflows/tests-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,34 +40,6 @@ jobs:
-v ${{ github.workspace }}/fixtures:/home/calitp/app/fixtures \
benefits_client:${{ github.sha }}

- name: Start server
run: |
docker run \
--detach \
-p 5000:5000 \
ghcr.io/cal-itp/eligibility-server:main

- name: Run UI automation tests
uses: cypress-io/github-action@v2
env:
CYPRESS_baseUrl: http://localhost:8000
with:
command: npm run cypress:ui
working-directory: tests/cypress
wait-on: http://localhost:8000/healthcheck

- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: tests/cypress/screenshots

- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-videos
path: tests/cypress/videos

- name: Run Lighthouse tests for a11y
uses: treosh/[email protected]
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ fixtures/*.json
!fixtures/??_*.json
static/
!benefits/static
benefits/static/sha.txt
__pycache__/
.coverage
.DS_Store
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Benefits

Transit benefits enrollment, minus the paperwork.
Cal-ITP Benefits is an application that enables automated eligibility verification and enrollment for transit benefits onto customers’ existing contactless bank (credit/debit) cards.

View the technical documentation online: <https://docs.calitp.org/benefits>

Expand Down
10 changes: 0 additions & 10 deletions benefits/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
"""
The core application: Houses base templates and reusable models and components.
"""
from django.apps import AppConfig


class CoreAppConfig(AppConfig):
name = "benefits.core"
label = "core"
verbose_name = "Core"
10 changes: 10 additions & 0 deletions benefits/core/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""
The core application: Houses base templates and reusable models and components.
"""
from django.apps import AppConfig


class CoreAppConfig(AppConfig):
name = "benefits.core"
label = "core"
verbose_name = "Core"
4 changes: 2 additions & 2 deletions benefits/core/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ def authentication(request):

if verifier:
data = {
"required": verifier.requires_authentication,
"required": verifier.is_auth_required,
"logged_in": session.logged_in(request),
"sign_out_route": reverse("oauth:logout"),
}

if verifier.requires_authentication:
if verifier.is_auth_required:
auth_provider = verifier.auth_provider
data["sign_in_button_label"] = auth_provider.sign_in_button_label
data["sign_out_button_label"] = auth_provider.sign_out_button_label
Expand Down
17 changes: 16 additions & 1 deletion benefits/core/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,23 @@ class LoginRequired(MiddlewareMixin):
def process_view(self, request, view_func, view_args, view_kwargs):
# only require login if verifier requires it
verifier = session.verifier(request)
if not verifier or not verifier.requires_authentication or session.logged_in(request):
if not verifier or not verifier.is_auth_required or session.logged_in(request):
# pass through
return None

return redirect("oauth:login")


# https://github.com/census-instrumentation/opencensus-python/issues/766
class LogErrorToAzure(MiddlewareMixin):
def __init__(self, get_response):
self.get_response = get_response
# wait to do this here to be sure the handler is initialized
self.azure_logger = logging.getLogger("azure")

def process_exception(self, request, exception):
# https://stackoverflow.com/a/45532289
msg = getattr(exception, "message", repr(exception))
self.azure_logger.exception(msg, exc_info=exception)

return None
Loading