Skip to content

Update Ruby to be compatible with Heroku stack (TC) #1594

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

Merged
merged 49 commits into from
Oct 20, 2022

Conversation

dumbledad
Copy link
Contributor

@dumbledad dumbledad commented Oct 10, 2022

Description

Update Ruby to be compatible with Heroku stack. This is a tech debt issue but on DWG plan as a planned change.
We can then move to using new Heroku stack after we do this.

This work should have been covered in https://github.com/NCCE/teachcomputing.org-issues/issues/2178 but @dumbledad missed that it covered both curriculum and teachcomputing.

Related to

Acceptance Criteria

  • @danhalson & @dumbledad to walk through some 'user pathways' through the app for extra reassurance that the switch
    • Test in review app
    • Test in staging (manual deploy)
    • Use AR to enroll and then complete, e.g.
      u = User.find_by_email('[email protected]')
      p = Programme.primary_certificate
      upe = UserProgrammeEnrolment.find_by(user_id: u.id, programme_id: p.id)
      upe.transition_to(:unenrolled)
      a = Activity.find_by_slug('some-activity-slug')
      ach = Achievement.create(user_id: u.id, activity_id: a.id, programme_id: p.id)
      ach.transition_to(:complete)
      

Splatted

We should keep a list of splatted args for proper refactoring later.

  • rspec spec/components/non_bordered_cards_component_spec.rb:35 : NonBorderedCardsComponent
    • /app/app/views/landing_pages/_contributing-partners-slice.html.erb
    • /app/spec/components/non_bordered_cards_component_spec.rb
  • rspec ./spec/views/pages/impact-and-evaluation.html_spec.rb:12 : LogoCardsComponent & RelatedLinksComponent
    • /app/previews/components/logo_cards_component_preview.rb
    • /app/previews/components/related_links_component_preview.rb
    • /app/spec/components/logo_cards_component_spec.rb
  • rspec ./spec/components/document_cards_component_spec.rb:86 : DocumentCardsComponent
    • /app/previews/components/document_cards_component_preview.rb
    • /app/spec/components/document_cards_component_spec.rb
  • rspec ./spec/views/pages/supporting-partners.hmtl_spec.rb:26 : HeroMediaComponent
    • /app/previews/components/hero_media_component_preview.rb
    • /app/spec/components/hero_media_component_spec.rb
    • /app/app/views/pages/supporting-partners.html.erb
  • rspec ./spec/components/non_bordered_cards_component_spec.rb:89 : NonBorderedCardsComponent
    • /app/previews/components/non_bordered_cards_component_preview.rb
    • /app/spec/components/non_bordered_cards_component_spec.rb
  • rspec ./spec/components/report_card_component_spec.rb:70 : ReportCardComponent & ImageReportCardComponent
    • /app/previews/components/image_report_card_component_preview.rb
    • /app/previews/components/report_card_component_preview.rb
    • /app/spec/components/image_report_card_component_spec.rb
    • /app/spec/components/report_card_component_spec.rb
  • rspec ./spec/views/pages/contributing-partners.html_spec.rb:12 : HeroComponent
    • /app/app/views/pages/contributing-partners.html.erb
    • /app/previews/components/hero_component_preview.rb
  • rspec ./spec/components/notice_component_spec.rb:42 : NoticeComponent
    • /app/spec/components/notice_component_spec.rb
  • rspec ./spec/system/pages/static_pages_spec.rb:51 : BorderedCardsComponent
    • /app/app/views/pages/get-involved.html.erb
    • /app/spec/components/bordered_list_cards_component_spec.rb
  • rspec ./spec/components/provider_logos_component_spec.rb:17 : ProviderLogosComponent
    • /app/spec/components/provider_logos_component_spec.rb
  • rspec ./spec/components/bordered_cards_component_spec.rb:93 : BorderedListCardsComponent
  • /app/spec/components/bordered_cards_component_spec.rb

TODO

  • Run through the file changes in https://github.com/NCCE/curriculum.teachcomputing.org/pull/201/files and replicate in TC
  • Run through the additional file changes in https://github.com/NCCE/curriculum.teachcomputing.org/pull/217/files and replicate in TC
    • We ended up fixing the build issues in staging in that PR so it's scope is larger than the title suggests.
  • Update yarn
    • yarn set version berry
  • Update the various lock files
    • docker compose down --remove-orphans --volumes --rmi local
    • sh ./scripts/setup.sh
    • rm Gemfile.lock
    • docker compose run --rm --no-deps web bundle install
    • rm yarn.lock
    • docker compose run --rm --no-deps web yarn install
  • Check all is good
  • Fix broken tests
    • e.g. spec spec/requests/reject_unproxied_requests_spec.rb:42
    • Use rspec --seed 42 --fail-fast to fix the order
      • rspec ./spec/views/pages/impact-and-evaluation.html_spec.rb:12
      • rspec ./spec/requests/certificates/cs_accelerator/complete_spec.rb:82
        • tried to create Proc object without a block error in Statesman gem
        • Update Stateman gem to 10.0.0
          • Our version of Rails (6.1.4.7) came out on 8/3/22, so the most recent Statesmen (10.0.0) should work versions
          • Fix NotImplementedError error Stateman throws when loading models/achievement.rb
            • Try intermediate Stateman versions (same error)
            • Swap to new include style
            • Do for other Stateman failing models
      • rspec ./spec/components/document_cards_component_spec.rb:86
      • rspec ./spec/views/pages/supporting-partners.hmtl_spec.rb:26
      • rspec ./spec/components/non_bordered_cards_component_spec.rb:89
      • rspec ./spec/components/report_card_component_spec.rb:70
      • rspec ./spec/components/report_card_component_spec.rb:59
      • rspec ./spec/components/community_activity_component_spec.rb:70
      • rspec ./spec/views/pages/contributing-partners.html_spec.rb:12
      • rspec ./spec/requests/certificates/cs_accelerator/update_user_programme_pathway_spec.rb:39
      • rspec ./spec/views/pages/enrolment/primary-certificate.html_spec.rb:65
      • rspec ./spec/components/notice_component_spec.rb:42
      • rspec ./spec/requests/api/achievements_spec.rb:16
      • rspec ./spec/requests/api/user_programme_enrolments_spec.rb:56
      • rspec ./spec/components/course_activity_component_spec.rb:84
      • rspec ./spec/system/pages/static_pages_spec.rb:51
      • rspec ./spec/requests/api/cache_spec.rb:12
      • rspec ./spec/components/hero_media_component_spec.rb:49
      • rspec ./spec/components/provider_logos_component_spec.rb:17
      • rspec ./spec/requests/api/activities_spec.rb:15
      • rspec ./spec/components/course_activity_component_spec.rb:64
      • rspec ./spec/requests/api/users_spec.rb:22
      • rspec ./spec/components/bordered_cards_component_spec.rb:93
  • rspec ./spec/system/pages/static_pages_spec.rb fails in CircleCI but not locally
    • Fix /app/.circleci/config.yml to
      • Include the browser orb browser-tools: circleci/[email protected]
      • browser-tools/install-browser-tools before running rspec
  • gem 'ims-lti', '2.3.2' to fix review apps
  • Fix ArgumentError (unknown keyword: :size) showing up in Sentry and PaperTrail
    • Add if @file_size.present? to /app/app/components/file_card_component/file_card_component.html.erb
  • Remove redis-rails client which throws :size argument error and is now handled by Rails itself anyway

@dumbledad dumbledad self-assigned this Oct 10, 2022
@dumbledad dumbledad changed the title Updating the CircleCI config Update Ruby to be compatible with Heroku stack (TC) Oct 10, 2022
@raspberrypigithubbot
Copy link

@dumbledad dumbledad marked this pull request as ready for review October 13, 2022 12:29
@dumbledad dumbledad requested a review from danhalson October 13, 2022 12:29
@raspberrypigithubbot
Copy link

@raspberrypiherokubot raspberrypiherokubot temporarily deployed to teachcomputing-pr-1594 October 13, 2022 12:35 Inactive
@raspberrypiherokubot raspberrypiherokubot temporarily deployed to teachcomputing-pr-1594 October 13, 2022 15:47 Inactive
@raspberrypiherokubot raspberrypiherokubot temporarily deployed to teachcomputing-pr-1594 October 14, 2022 09:12 Inactive
@raspberrypigithubbot
Copy link

@raspberrypiherokubot raspberrypiherokubot temporarily deployed to teachcomputing-staging October 14, 2022 10:15 Inactive
@raspberrypiherokubot raspberrypiherokubot temporarily deployed to teachcomputing-pr-1594 October 14, 2022 14:08 Inactive
@raspberrypigithubbot
Copy link

@raspberrypiherokubot raspberrypiherokubot temporarily deployed to teachcomputing-pr-1594 October 20, 2022 09:19 Inactive
@raspberrypiherokubot raspberrypiherokubot temporarily deployed to teachcomputing-staging October 20, 2022 09:29 Inactive
@raspberrypiherokubot raspberrypiherokubot temporarily deployed to teachcomputing-pr-1594 October 20, 2022 10:43 Inactive
@raspberrypiherokubot raspberrypiherokubot temporarily deployed to teachcomputing-pr-1594 October 20, 2022 10:47 Inactive
@raspberrypiherokubot raspberrypiherokubot temporarily deployed to teachcomputing-staging October 20, 2022 10:48 Inactive
@raspberrypigithubbot
Copy link

@raspberrypigithubbot
Copy link

Copy link
Contributor

@danhalson danhalson left a comment

Choose a reason for hiding this comment

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

LGTM

@raspberrypiherokubot raspberrypiherokubot temporarily deployed to teachcomputing-pr-1594 October 20, 2022 11:21 Inactive
@raspberrypigithubbot
Copy link

@dumbledad dumbledad merged commit 223dd59 into main Oct 20, 2022
@dumbledad dumbledad deleted the dumbledad/issue/2022-update-ruby branch October 20, 2022 11:43
@dumbledad dumbledad mentioned this pull request Oct 20, 2022
17 tasks
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.

4 participants