FFS-4713 Add an environment variable to disable NSC in a given environment, forcing the Education flow to self-attestation only. - #2047
Conversation
| MISSION_CONTROL_PASSWORD=password | ||
|
|
||
| STRUCTURED_LOGGING_ENABLED=false | ||
| NSC_DISABLED=false |
There was a problem hiding this comment.
This is good for a local default and testing, but we're going to need to set this in AWS Parameter Store and load the setting in each environment that way. Take a look at infra/app/app-config/env-config/environment-variables.tf to see how we do that with other variables like SITE_ALERT_ENABLED. Take a gander at the PR that added that for a guide on what's needed.
(And, in addition, we will need to go through and create this variable in Parameter Store in each environment, and set it to false.)
There was a problem hiding this comment.
I think I got it done. How do I go about getting credentials to create the variable in parameter store?
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
test-classifier: AI triage of failing tests
AI Test Classifier — no action required
Observed — these verdicts are grounded in the actual test run output.
Used the precomputed AI_REVIEW_DIFF_RANGE (origin/main HEAD), which correctly captured PR #2047's NSC_DISABLED feature-flag change (23 files); no base re-resolution was needed. Reproduced CI's rspec job (Ruby 3.4.10, Postgres 16 container, npm ci + rake assets:precompile, RAILS_ENV=test) and ran bundle exec rspec spec/ --exclude-pattern '**/e2e/**': 2584 examples, 0 failures. An initial run showed ~70 red controller specs all failing on Sprockets AssetNotFound for the USWDS sprite; that was a missing assets:precompile step in my own bootstrap (which CI's setup-project action performs), and every one of those specs passed once assets were compiled, so nothing is classified. The new copy-drift assertions in employment_controller_spec.rb and add_your_work_controller_spec.rb were deleted alongside the intended en.yml/view changes, so no stale change-detector remains. spec/e2e/** was excluded, matching the rspec.yml CI job.
React 👍 if this is right (nothing needed triage) / 👎 if a real failure was missed, and on a 👎 please reply with a one-line reason. Advisory, non-blocking.
📝 Terraform Plan: Database→ Resource Changes: 0 to create, 4 to update, 0 to re-create, 0 to delete, 0 ephemeral, 0 to import. ♻️ Update
|
There was a problem hiding this comment.
test-classifier: AI triage of failing tests
AI Test Classifier — no action required
Observed — these verdicts are grounded in the actual test run output.
Bootstrapped per the repo's own CI (postgres:16 service container, rake db:schema:load, npm install + rake assets:precompile) and ran the CI test command bundle exec rspec spec/ --exclude-pattern '{e2e/**/*_spec.rb}' on Ruby 3.4.10 (repo pins 3.4.9; pin temporarily relaxed for the run and reverted). Result: 2584 examples, 0 failures — nothing to classify. The AI_REVIEW_DIFF_RANGE base (origin/main) was valid and was used as-is. A first pass without asset precompilation produced ~80 Sprockets AssetNotFound errors; those were a local bootstrap gap (ENVIRONMENT_ISSUE), disappeared after running CI's assets:precompile step, and are therefore not reported as classifications. spec/e2e/ is excluded by the CI rspec job and was not run.
React 👍 if this is right (nothing needed triage) / 👎 if a real failure was missed, and on a 👎 please reply with a one-line reason. Advisory, non-blocking.
There was a problem hiding this comment.
test-classifier: AI triage of failing tests
AI Test Classifier — no action required
Observed — these verdicts are grounded in the actual test run output.
Used the dispatcher-provided range origin/main..HEAD as-is; it correctly captured the PR #2047 change (NSC_DISABLED kill switch for education flows, 26 files), so no base re-resolution was needed. Reproduced CI's rspec.yml path: started Postgres, installed gems, npm install, rake assets:precompile, db:schema:load, then parallel_test spec/ -n 4 --exclude-pattern '^spec/e2e/' (same e2e exclusion CI uses; e2e runs in a separate workflow requiring browsers/external aggregators). Result: 2584 examples, 0 failures across all 4 processes; the 9 changed spec files alone give 339 examples, 0 failures. rubocop (664 files) and erb_lint (124 files) are also clean. Two bootstrap caveats: the Gemfile pins Ruby 3.4.9 but only 3.4.10 is available in the runner toolchain, so tests ran under 3.4.10 via a throwaway sidecar Gemfile.ci (deleted afterward, no tracked file modified); and an initial run performed before assets:precompile produced ~120 spurious Sprockets AssetNotFound errors in every view-rendering spec, which was an artifact of my own incomplete bootstrap rather than the change under test and which disappeared entirely once assets were compiled as CI does, so those are not classified. Nothing failed, so classifications is empty.
React 👍 if this is right (nothing needed triage) / 👎 if a real failure was missed, and on a 👎 please reply with a one-line reason. Advisory, non-blocking.
FFS-4713
Changes
•Added helper method
nsc_disabled?inApplicationControllerandApplicationHelperto safely parse and check theNSC_DISABLEDenvironment variable across controllers and views.•Updated
ActivitiesHelper#education_add_pathand app/views/activities/activities/index.html.erb to route the Activity Hub's education "Add" action directlyto new_activities_flow_education_pathwhenNSC_DISABLEDis true.•Updated
Activities::EducationControlleractions (verify, create, show, sync, and error) andActivities::Education::TermCreditHoursControllerto guard against data-backed NSC paths and redirect to the self-attestation flow whenNSC_DISABLEDis enabled.•Updated app/views/activities/education/error.html.erb to hide the data-backed retry button when
nsc_disabled?is true.•Documented NSC_DISABLED in app/.env, app/.env.local.example, and docs/local-replication.md.
•Added unit and controller tests across
ActivitiesHelper,Activities::ActivitiesController,Activities::EducationController, andActivities::Education::TermCreditHoursController.Acceptance testing
Tag product and design in Slack for acceptance: @emmy-acceptance-testers
:alert: Deploy block! @ffs-eng I just merged PR [#123] and will be doing acceptance testing in demo - please don't deploy until I'm finished!)AI Usage
Optional — for learning, not audited:
Infrastructure Changes
Risk / Downtime:
Preview environment