Skip to content

Sf fields #1632

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Sf fields #1632

wants to merge 15 commits into from

Conversation

mwvolo
Copy link
Member

@mwvolo mwvolo commented May 7, 2025

No description provided.

@mwvolo mwvolo requested a review from Copilot May 7, 2025 16:08
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR aims to update Salesforce-related fields and adjust related functionality for user contact information.

  • Removed assignments for user.is_kip and user.grant_tutor_access in update_user_contact_info.rb
  • Commented out the ConfirmationMailer call in send_contact_info_confirmation.rb
  • Updated the openstax_salesforce gem dependency in Gemfile

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
app/routines/update_user_contact_info.rb Removed Salesforce field assignments that are no longer required
app/routines/send_contact_info_confirmation.rb Temporarily disabled sending confirmation emails by commenting out the mailer invocation
Gemfile Pinned the openstax_salesforce gem to a specific GitHub ref for a temporary solution
Comments suppressed due to low confidence (2)

app/routines/update_user_contact_info.rb:119

  • Confirm that the removal of the user.is_kip and user.grant_tutor_access assignments is fully intentional and that downstream logic does not rely on these fields. If these changes have broader implications, ensure that related documentation and tests are updated accordingly.
user.is_kip = sf_school&.is_kip || sf_school&.is_child_of_kip

app/routines/send_contact_info_confirmation.rb:19

  • If disabling the ConfirmationMailer call is intentional, consider removing the commented code or adding a clear inline comment explaining the temporary nature of this change.
ConfirmationMailer.instructions(email_address: contact_info, send_pin: send_pin).deliver_later

@mwvolo mwvolo requested a review from Copilot May 14, 2025 04:33
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the student signup flow and related Salesforce integration code. Key changes include:

  • Removal of VCR cassette usage and associated setup in the student signup flow test.
  • Modification of user contact info updates by removing assignments for is_kip and grant_tutor_access.
  • Change in dependency loading in the Puma configuration and addition of the concurrent-ruby gem.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
spec/features/newflow/student_signup_flow_spec.rb Removed VCR cassette usage and before(:all) block for SalesforceProxy setup
spec/cassettes/Newflow/Students/student_signup_flow/sf_setup.yml Removed unused cassette file
config/puma.rb Updated dotenv gem to use "dotenv/load"
app/routines/update_user_contact_info.rb Removed assignment of is_kip and grant_tutor_access fields
Gemfile Added concurrent-ruby gem
Comments suppressed due to low confidence (2)

spec/features/newflow/student_signup_flow_spec.rb:5

  • Removal of the VCR cassette setup may lead to tests executing real HTTP requests; ensure that external calls are appropriately stubbed or handled elsewhere to maintain reliable test behavior.
feature 'Student signup flow', js: true do

app/routines/update_user_contact_info.rb:119

  • The removal of assignments for user.is_kip and user.grant_tutor_access might impact downstream logic that relies on these fields; please confirm that this change aligns with the updated Salesforce field mappings.
user.is_kip = sf_school&.is_kip || sf_school&.is_child_of_kip

Copy link

❌ Tests failed for Ruby 3.1.

Test Results Report

Summary

  • Ruby Version: 3.1
  • PostgreSQL Version: 16
  • Status: failure

Failures (16)

  • 2025-06-10T14:18:43+0000: [Worker(host:pkrvmf6wy0o8zjz pid:3838)] Job ActiveJob::Base (id=1) FAILED (0 prior attempts) with ActiveRecord::RecordInvalid: Validation failed:
  • 2025-06-10T14:18:43+0000: [Worker(host:pkrvmf6wy0o8zjz pid:3838)] Job ActiveJob::Base (id=2) FAILED (0 prior attempts) with OAuth2::Error: #
  • 2025-06-10T14:18:43+0000: [Worker(host:pkrvmf6wy0o8zjz pid:3838)] Job ActiveJob::Base (id=3) FAILED (0 prior attempts) with OAuth2::Error: #
  • 2025-06-10T14:18:43+0000: [Worker(host:pkrvmf6wy0o8zjz pid:3838)] Job ActiveJob::Base (id=4) FAILED (0 prior attempts) with OAuth2::Error: #
  • 2025-06-10T14:18:43+0000: [Worker(host:pkrvmf6wy0o8zjz pid:3838)] Job ActiveJob::Base (id=5) FAILED (0 prior attempts) with RuntimeError: Some Error
  • 2025-06-10T14:18:43+0000: [Worker(host:pkrvmf6wy0o8zjz pid:3838)] Job ActiveJob::Base (id=6) FAILED (0 prior attempts) with OpenURI::HTTPError: 504 Gateway Timeout
  • 2025-06-10T14:18:43+0000: [Worker(host:pkrvmf6wy0o8zjz pid:3838)] Job ActiveJob::Base (id=7) FAILED (0 prior attempts) with OpenURI::HTTPError: 404 Not Found
  • 2025-06-10T14:18:43+0000: [Worker(host:pkrvmf6wy0o8zjz pid:3838)] Job ActiveJob::Base (id=8) FAILED (0 prior attempts) with OpenURI::HTTPError:
  • 2025-06-10T14:18:43+0000: [Worker(host:pkrvmf6wy0o8zjz pid:3838)] Job ActiveJob::Base (id=9) FAILED (0 prior attempts) with NoMethodError: undefined method `message' for nil:NilClass
  • 2025-06-10T14:18:43+0000: [Worker(host:pkrvmf6wy0o8zjz pid:3838)] Job ActiveJob::Base (id=10) FAILED (0 prior attempts) with NotYetImplemented: NotYetImplemented
  • 2025-06-10T14:18:43+0000: [Worker(host:pkrvmf6wy0o8zjz pid:3838)] Job ActiveJob::Base (id=11) FAILED (0 prior attempts) with Addressable::URI::InvalidURIError: Addressable::URI::InvalidURIError
  • 2025-06-10T14:18:43+0000: [Worker(host:pkrvmf6wy0o8zjz pid:3838)] Job ActiveJob::Base (id=12) FAILED (0 prior attempts) with NoMethodError: NoMethodError
  • 2025-06-10T14:18:43+0000: [Worker(host:pkrvmf6wy0o8zjz pid:3838)] Job ActiveJob::Base (id=13) FAILED (0 prior attempts) with JSON::ParserError: JSON::ParserError
  • 2025-06-10T14:18:43+0000: [Worker(host:pkrvmf6wy0o8zjz pid:3838)] Job ActiveJob::Base (id=14) FAILED (0 prior attempts) with NameError: NameError
  • 2025-06-10T14:18:43+0000: [Worker(host:pkrvmf6wy0o8zjz pid:3838)] Job ActiveJob::Base (id=15) FAILED (0 prior attempts) with ActiveRecord::RecordNotFound: ActiveRecord::RecordNotFound
  • 2025-06-10T14:18:43+0000: [Worker(host:pkrvmf6wy0o8zjz pid:3838)] Job ActiveJob::Base (id=16) FAILED (0 prior attempts) with ArgumentError: ArgumentError

Test Log Excerpt

  Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
  Rendered admin/security_logs/show.html.erb within layouts/admin (Duration: 0.1ms | Allocations: 83)
  Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
  Rendered layout layouts/admin.html.erb (Duration: 0.3ms | Allocations: 198)
Completed 200 OK in 18ms (Views: 2.0ms | ActiveRecord: 2.8ms | Allocations: 4897)
  �[1m�[36mTRANSACTION (0.2ms)�[0m  �[1m�[31mROLLBACK TO SAVEPOINT active_record_1�[0m
  �[1m�[36mTRANSACTION (0.2ms)�[0m  �[1m�[35mSAVEPOINT active_record_1�[0m
  �[1m�[36mTRANSACTION (0.2ms)�[0m  �[1m�[35mSAVEPOINT active_record_2�[0m
  �[1m�[36mUser Exists? (0.4ms)�[0m  �[1m�[34mSELECT 1 AS one FROM "users" WHERE LOWER("users"."username") = LOWER($1) LIMIT $2�[0m  [["username", "5748d4"], ["LIMIT", 1]]
  �[1m�[36mUser Exists? (0.3ms)�[0m  �[1m�[34mSELECT 1 AS one FROM "users" WHERE "users"."uuid" = $1 LIMIT $2�[0m  [["uuid", "1a4d279c-c230-43d0-9bca-bb7fa5b4b141"], ["LIMIT", 1]]
  �[1m�[36mApplicationUser Update All (0.2ms)�[0m  �[1m�[33mUPDATE "application_users" SET unread_updates = unread_updates + 1 WHERE "application_users"."user_id" IS NULL AND (1=0)�[0m
  �[1m�[36mUser Exists? (0.3ms)�[0m  �[1m�[34mSELECT 1 AS one FROM "users" WHERE LOWER("users"."username") = LOWER($1) LIMIT $2�[0m  [["username", "5748d4"], ["LIMIT", 1]]
  �[1m�[36mUser Exists? (0.3ms)�[0m  �[1m�[34mSELECT 1 AS one FROM "users" WHERE "users"."uuid" = $1 LIMIT $2�[0m  [["uuid", "1a4d279c-c230-43d0-9bca-bb7fa5b4b141"], ["LIMIT", 1]]
  �[1m�[36mSchool Create (0.3ms)�[0m  �[1m�[32mINSERT INTO "schools" ("salesforce_id", "name", "city", "state", "type", "location", "sheerid_school_name", "is_kip", "is_child_of_kip", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id"�[0m  [["salesforce_id", "0010v0DgSsfzoBv"], ["name", "Blanda-Kirlin"], ["city", "Marvinfurt"], ["state", "Rhode Island"], ["type", "Home School"], ["location", "Domestic"], ["sheerid_school_name", "Blanda-Kirlin (Marvinfurt, Rhode Island)"], ["is_kip", true], ["is_child_of_kip", false], ["created_at", "2025-06-10 14:19:41.437617"], ["updated_at", "2025-06-10 14:19:41.437617"]]
  �[1m�[36mUser Exists? (0.3ms)�[0m  �[1m�[34mSELECT 1 AS one FROM "users" WHERE LOWER("users"."username") = LOWER($1) LIMIT $2�[0m  [["username", "5748d4"], ["LIMIT", 1]]
  �[1m�[36mUser Exists? (0.2ms)�[0m  �[1m�[34mSELECT 1 AS one FROM "users" WHERE "users"."uuid" = $1 LIMIT $2�[0m  [["uuid", "1a4d279c-c230-43d0-9bca-bb7fa5b4b141"], ["LIMIT", 1]]
  �[1m�[36mApplicationUser Update All (0.2ms)�[0m  �[1m�[33mUPDATE "application_users" SET unread_updates = unread_updates + 1 WHERE "application_users"."user_id" IS NULL AND (1=0)�[0m
  �[1m�[36mUser Create (0.4ms)�[0m  �[1m�[32mINSERT INTO "users" ("username", "created_at", "updated_at", "is_administrator", "first_name", "last_name", "uuid", "state", "role", "is_profile_complete", "school_id", "consent_preferences") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) RETURNING "id"�[0m  [["username", "5748d4"], ["created_at", "2025-06-10 14:19:41.442612"], ["updated_at", "2025-06-10 14:19:41.442612"], ["is_administrator", true], ["first_name", "Brock"], ["last_name", "Monahan"], ["uuid", "1a4d279c-c230-43d0-9bca-bb7fa5b4b141"], ["state", "activated"], ["role", 1], ["is_profile_complete", true], ["school_id", 796], ["consent_preferences", "\"{\\\"accepted\\\":[\\\"necessary\\\",\\\"analytics\\\",\\\"functional\\\"],\\\"rejected\\\":[\\\"advertisement\\\",\\\"performance\\\"]}\""]]
  �[1m�[36mTRANSACTION (0.2ms)�[0m  �[1m�[35mRELEASE SAVEPOINT active_record_2�[0m
  �[1m�[36mFinePrint::Contract Load (0.2ms)�[0m  �[1m�[34mSELECT "fine_print_contracts".* FROM "fine_print_contracts" ORDER BY "fine_print_contracts"."name" ASC, "fine_print_contracts"."version" DESC�[0m
  �[1m�[36mTRANSACTION (0.2ms)�[0m  �[1m�[35mSAVEPOINT active_record_2�[0m
  �[1m�[36mFinePrint::Signature Exists? (0.3ms)�[0m  �[1m�[34mSELECT 1 AS one FROM "fine_print_signatures" WHERE "fine_print_signatures"."contract_id" = $1 AND "fine_print_signatures"."user_type" = $2 AND "fine_print_signatures"."user_id" = $3 LIMIT $4�[0m  [["contract_id", 1], ["user_type", "User"], ["user_id", 805], ["LIMIT", 1]]
  �[1m�[36mFinePrint::Signature Create (0.3ms)�[0m  �[1m�[32mINSERT INTO "fine_print_signatures" ("contract_id", "user_type", "user_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"�[0m  [["contract_id", 1], ["user_type", "User"], ["user_id", 805], ["created_at", "2025-06-10 14:19:41.447900"], ["updated_at", "2025-06-10 14:19:41.447900"]]
  �[1m�[36mTRANSACTION (0.2ms)�[0m  �[1m�[35mRELEASE SAVEPOINT active_record_2�[0m
  �[1m�[36mTRANSACTION (0.2ms)�[0m  �[1m�[35mSAVEPOINT active_record_2�[0m
  �[1m�[36mFinePrint::Signature Exists? (0.2ms)�[0m  �[1m�[34mSELECT 1 AS one FROM "fine_print_signatures" WHERE "fine_print_signatures"."contract_id" = $1 AND "fine_print_signatures"."user_type" = $2 AND "fine_print_signatures"."user_id" = $3 LIMIT $4�[0m  [["contract_id", 2], ["user_type", "User"], ["user_id", 805], ["LIMIT", 1]]
  �[1m�[36mFinePrint::Signature Create (0.3ms)�[0m  �[1m�[32mINSERT INTO "fine_print_signatures" ("contract_id", "user_type", "user_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"�[0m  [["contract_id", 2], ["user_type", "User"], ["user_id", 805], ["created_at", "2025-06-10 14:19:41.450909"], ["updated_at", "2025-06-10 14:19:41.450909"]]
  �[1m�[36mTRANSACTION (0.2ms)�[0m  �[1m�[35mRELEASE SAVEPOINT active_record_2�[0m
  �[1m�[36mApplicationUser Load (0.2ms)�[0m  �[1m�[34mSELECT "application_users".* FROM "application_users" WHERE "application_users"."user_id" = $1�[0m  [["user_id", 805]]
  �[1m�[36mTRANSACTION (0.2ms)�[0m  �[1m�[35mSAVEPOINT active_record_2�[0m
  �[1m�[36mSecurityLog Create (0.3ms)�[0m  �[1m�[32mINSERT INTO "security_logs" ("user_id", "remote_ip", "event_type", "created_at") VALUES ($1, $2, $3, $4) RETURNING "id"�[0m  [["user_id", 805], ["remote_ip", "0.0.0.0"], ["event_type", 4], ["created_at", "2025-06-10 14:19:41.458216"]]
  �[1m�[36mTRANSACTION (0.2ms)�[0m  �[1m�[35mRELEASE SAVEPOINT active_record_2�[0m
Processing by Admin::SecurityLogsController#show as HTML
  �[1m�[36mDoorkeeper::Application Exists? (0.4ms)�[0m  �[1m�[34mSELECT 1 AS one FROM "oauth_applications" INNER JOIN "application_users" ON "oauth_applications"."id" = "application_users"."application_id" WHERE "application_users"."user_id" = $1 LIMIT $2�[0m  [["user_id", 805], ["LIMIT", 1]]
  �[1m�[36mFinePrint::Contract Load (0.4ms)�[0m  �[1m�[34mSELECT "fine_print_contracts".* FROM "fine_print_contracts" INNER JOIN "fine_print_contracts" "same_names_fine_print_contracts" ON "same_names_fine_print_contracts"."name" = "fine_print_contracts"."name" WHERE "fine_print_contracts"."version" IS NOT NULL AND "fine_print_contracts"."name" IN ($1, $2) GROUP BY "fine_print_contracts"."id" HAVING "fine_print_contracts"."version" = MAX("same_names_fine_print_contracts"."version") ORDER BY "fine_print_contracts"."name" ASC, "fine_print_contracts"."version" DESC�[0m  [["name", "general_terms_of_use"], ["name", "privacy_policy"]]
  �[1m�[36mFinePrint::Contract Load (0.5ms)�[0m  �[1m�[34mSELECT "fine_print_contracts".* FROM "fine_print_contracts" INNER JOIN "fine_print_contracts" "same_names_fine_print_contracts" ON "same_names_fine_print_contracts"."name" = "fine_print_contracts"."name" INNER JOIN "fine_print_signatures" ON "fine_print_signatures"."contract_id" = "fine_print_contracts"."id" WHERE "fine_print_contracts"."version" IS NOT NULL AND "fine_print_contracts"."name" IN ($1, $2) AND "fine_print_signatures"."user_id" = $3 AND "fine_print_signatures"."user_type" = $4 GROUP BY "fine_print_contracts"."id" HAVING "fine_print_contracts"."version" = MAX("same_names_fine_print_contracts"."version") ORDER BY "fine_print_contracts"."name" ASC, "fine_print_contracts"."version" DESC�[0m  [["name", "general_terms_of_use"], ["name", "privacy_policy"], ["user_id", 805], ["user_type", "User"]]
  �[1m�[36mIdentity Load (0.2ms)�[0m  �[1m�[34mSELECT "identities".* FROM "identities" WHERE "identities"."user_id" = $1 LIMIT $2�[0m  [["user_id", 805], ["LIMIT", 1]]
  �[1m�[36mDoorkeeper::Application Exists? (0.3ms)�[0m  �[1m�[34mSELECT 1 AS one FROM "oauth_applications" INNER JOIN "application_users" ON "oauth_applications"."id" = "application_users"."application_id" WHERE "application_users"."user_id" = $1 LIMIT $2�[0m  [["user_id", 805], ["LIMIT", 1]]
  �[1m�[36mFinePrint::Contract Load (0.4ms)�[0m  �[1m�[34mSELECT "fine_print_contracts".* FROM "fine_print_contracts" INNER JOIN "fine_print_contracts" "same_names_fine_print_contracts" ON "same_names_fine_print_contracts"."name" = "fine_print_contracts"."name" WHERE "fine_print_contracts"."version" IS NOT NULL AND "fine_print_contracts"."name" IN ($1, $2) GROUP BY "fine_print_contracts"."id" HAVING "fine_print_contracts"."version" = MAX("same_names_fine_print_contracts"."version") ORDER BY "fine_print_contracts"."name" ASC, "fine_print_contracts"."version" DESC�[0m  [["name", "general_terms_of_use"], ["name", "privacy_policy"]]
  �[1m�[36mFinePrint::Contract Load (0.5ms)�[0m  �[1m�[34mSELECT "fine_print_contracts".* FROM "fine_print_contracts" INNER JOIN "fine_print_contracts" "same_names_fine_print_contracts" ON "same_names_fine_print_contracts"."name" = "fine_print_contracts"."name" INNER JOIN "fine_print_signatures" ON "fine_print_signatures"."contract_id" = "fine_print_contracts"."id" WHERE "fine_print_contracts"."version" IS NOT NULL AND "fine_print_contracts"."name" IN ($1, $2) AND "fine_print_signatures"."user_id" = $3 AND "fine_print_signatures"."user_type" = $4 GROUP BY "fine_print_contracts"."id" HAVING "fine_print_contracts"."version" = MAX("same_names_fine_print_contracts"."version") ORDER BY "fine_print_contracts"."name" ASC, "fine_print_contracts"."version" DESC�[0m  [["name", "general_terms_of_use"], ["name", "privacy_policy"], ["user_id", 805], ["user_type", "User"]]
  Rendering layout layouts/admin.html.erb
  Rendering admin/security_logs/show.html.erb within layouts/admin
  Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
  Rendered admin/security_logs/show.html.erb within layouts/admin (Duration: 0.2ms | Allocations: 78)
  Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
  Rendered layout layouts/admin.html.erb (Duration: 0.3ms | Allocations: 191)
Completed 200 OK in 15ms (Views: 1.0ms | ActiveRecord: 2.7ms | Allocations: 4322)
  �[1m�[36mTRANSACTION (0.2ms)�[0m  �[1m�[31mROLLBACK TO SAVEPOINT active_record_1�[0m
  �[1m�[36mTRANSACTION (0.2ms)�[0m  �[1m�[31mROLLBACK�[0m

Check the workflow run for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant