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: Add SBTMD Mobility Pass configuration #1771

Merged
merged 11 commits into from
Nov 8, 2023
Merged

Conversation

machikoyasuda
Copy link
Member

@machikoyasuda machikoyasuda commented Nov 1, 2023

closes #1664

Note: Will require a PR into Eligibility Server first (for sample data and server.pub keys) before the form will return success for a eligible user correctly.

Tasks

  • Define EligibilityType for "SBMTD Mobility Pass"
  • Define EligiblityVerifier using MST CC as an example
    • Need a per-verifier SERVER_PUBLIC_KEY_URL variable
  • Define necessary includes/templates
  • Define form SBMTDMobilityPass with configuration (labels, helper, validation, etc.)
    • Need new sample data
  • Update SBMTD TransitAgency
  • Update all relevant copy for English and Spanish

Acceptance criteria

  • SBMTD user sees an option for "Mobility Pass" on the Eligibility Index page
  • Selecting "Mobility Pass" shows more info on the Eligibility Start page
  • Continuing shows the Eligibility Confirm page with rendered form / details
  • English and Spanish match SBMTD tab of spreadsheet
  • Help page update
  • Submitting the form with sample data (e.g. against a local server) correctly verifies eligible and ineligible users

@machikoyasuda machikoyasuda self-assigned this Nov 1, 2023
@machikoyasuda machikoyasuda added this to the SBMTD Mobility Pass milestone Nov 1, 2023
@github-actions github-actions bot added deployment-dev [auto] Changes that will trigger a deploy if merged to dev back-end Django views, sessions, middleware, models, migrations etc. front-end HTML/CSS/JavaScript and Django templates migrations [auto] Review for potential model changes/needed data migrations updates i18n Copy: Language files or Django i18n framework and removed back-end Django views, sessions, middleware, models, migrations etc. labels Nov 1, 2023
Copy link

github-actions bot commented Nov 1, 2023

Coverage report

The coverage rate went from 90.91% to 90.87% ⬇️
The branch rate is 85%.

75% of new lines are covered.

Diff Coverage details (click to unfold)

benefits/eligibility/forms.py

75% of new lines are covered (80% of the complete file).
Missing lines: 165

benefits/settings.py

100% of new lines are covered (83.45% of the complete file).

@machikoyasuda
Copy link
Member Author

@angela-tran @thekaveman I have this running locally with the latest eligibility_server:dev. I've confirmed the server has the new data. But I cannot get the app to successfully verify any of these new users: https://github.com/cal-itp/eligibility-server/pull/365/files#diff-ea8001f0f8d01218129545e693327a9226c0a2e8bbabf242441b44c2d6f0b204R18-R23

I'm not sure why.

@thekaveman
Copy link
Member

thekaveman commented Nov 3, 2023

@machikoyasuda I'm also failing to verify with the new users, but I noticed this in the logs of my local eligibility-server when I submitted the form:

[2023-11-02 23:59:31,330] DEBUG eligibility_server.verify:104 List of types to check was empty.

So it looks like maybe the eligibility type isn't getting there from Benefits?

@machikoyasuda
Copy link
Member Author

Confirmed locally
image
with credentials from https://github.com/cal-itp/eligibility-server/pull/365/files

@machikoyasuda machikoyasuda marked this pull request as ready for review November 6, 2023 21:22
@machikoyasuda machikoyasuda requested a review from a team as a code owner November 6, 2023 21:22
@machikoyasuda
Copy link
Member Author

Ready for re-review @thekaveman

@thekaveman
Copy link
Member

@machikoyasuda will review today!

@thekaveman thekaveman self-requested a review November 8, 2023 20:53
Copy link
Member

@thekaveman thekaveman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! I was able to run locally and verify a sample user.

Couple of things post-merge:

  • I note that some of the language (particularly on the form) is slightly different from the spreadsheet; I agree with the version in this PR, since it matches more closely to Courtesy Cards. Please work with @indexing to make sure the spreadsheet is accurate.
  • If you haven't already, please update the Key Vault secrets for the public keys: rename server-public-key to mst-server-public-key and add sbmtd-server-public-key for all 3 environments. Use a placeholder like # for SBMTD for now.

@machikoyasuda machikoyasuda merged commit c5f1972 into dev Nov 8, 2023
12 checks passed
@machikoyasuda machikoyasuda deleted the feat/1664-mobility-pass branch November 8, 2023 22:11
@@ -220,6 +232,23 @@ def load_data(app, *args, **kwargs):
start_template="eligibility/start--senior.html",
)

sbmtd_mobility_pass_verifier = EligibilityVerifier.objects.create(
name=os.environ.get("MOBILITY_PASS_VERIFIER_NAME", "Eligibility Server Verifier"),
active=os.environ.get("MOBILITY_PASS_VERIFIER_ACTIVE", "True").lower() == "true",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry just noticed something else.

We need an app config and key vault secrets for this active setting as well.

And let's go ahead and make the default False here so it doesn't turn on by accident.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@machikoyasuda we'll need a follow-up PR for this.

Copy link
Member

@thekaveman thekaveman Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, all the MOBILITY_PASS_* environment variables need key vault secrets defined in Terraform. I'll create a new issue.

See #1777

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment-dev [auto] Changes that will trigger a deploy if merged to dev front-end HTML/CSS/JavaScript and Django templates i18n Copy: Language files or Django i18n framework migrations [auto] Review for potential model changes/needed data migrations updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create app configuration for SBMTD+Agency card (Mobility Pass)
2 participants