ifmeorg / ifme

Free, open source mental health communication web app to share experiences with loved ones
http://www.if-me.org/
GNU Affero General Public License v3.0
1.46k stars 734 forks source link

Upgrade to Ruby v3 and Rails v7 #2183

Closed uzorjchibuzor closed 1 year ago

uzorjchibuzor commented 1 year ago

Closes #2116

julianguyen commented 1 year ago

The CI failure that's happening:

#!/bin/bash --login
bundle install --path=vendor/bundle --jobs=4 --retry=3
[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local path 'vendor/bundle'`, and stop using this flag
Your Ruby version is 3.0.3, but your Gemfile specified ~> 3.1.2

Exited with code exit status 18
CircleCI received exit code 18

Looks like it's the result of needed to update the Ruby version in our Circle CI config.

uzorjchibuzor commented 1 year ago

yes, it the ruby version on the CI build file, I changed it when I went to 3.0.3, then forgot to do the same when I moved to 3.1.2

uzorjchibuzor commented 1 year ago

The application is coming along nicely, I think I messed up the title part of the erb but I will fix that along the CI thing. oh, and the docker container has to go up too but that goes without saying.

uzorjchibuzor commented 1 year ago

How can I have 4 failing tests locally and the CI blows up into the hundreds? :-)

julianguyen commented 1 year ago

I'm getting as many test failures in CI when I check out your branch.

Looks like it's predominantly:

ActionView::Template::Error:
  Custom asset_path helper is not implemented

  Extend your environment context with a custom method.

      environment.context_class.class_eval do
        def asset_path(path, options = {})
        end
      end

This Stack Overflow post suggests you might want to pass a full filename (including the file extension).

julianguyen commented 1 year ago

for some reason that I have been unable to figure out, this line <%= render 'layouts/title' %> at application.html.erb is not working as expected. The title bar looks wonky.

Can you show me a screenshot of what this looks like for you?

uzorjchibuzor commented 1 year ago
Screen Shot 2022-10-26 at 5 58 50 PM

@julianguyen Here is the screenshot of the title bar.. I will check the SO post for information.

julianguyen commented 1 year ago

Unrelated to the Circle CI build challenges that are happening, you should update the target Ruby version in .rubocop.yml.

uzorjchibuzor commented 1 year ago

Unrelated to the Circle CI build challenges that are happening, you should update the target Ruby version in .rubocop.yml.

I will change that, I am going to reach out CircleCI again and see if they can help as I am stumped.

julianguyen commented 1 year ago
Screen Shot 2022-10-26 at 5 58 50 PM

@julianguyen Here is the screenshot of the title bar.. I will check the SO post for information.

Ahh, so it looks like in this new version of Rails, <!-- BEGIN --> and <!-- END --> comments for layout partials are automagically injected. I looked up the render API and I can't seem to find a way to disable comments, so I think you might have to move the logic for generating text for <title> into an application-level method instead of doing it through layout partials.

uzorjchibuzor commented 1 year ago

I have been busy with some projects these past couple of days. I will definitely get back to working on this PR

julianguyen commented 1 year ago

I have been busy with some projects these past couple of days. I will definitely get back to working on this PR

Aww thanks for the update!

julianguyen commented 1 year ago

Just checking in, any updates here or anything I can help with?

uzorjchibuzor commented 1 year ago

My charger got burnt and I just got a new one. I am trying to reset...

julianguyen commented 1 year ago

I'm going to revisit this in a few weeks 💜

seanmarcia commented 1 year ago

I added a couple of commits to fix the title issue and the rest of the broken specs. The tests are all passing locally (needed to set the Cloudinary env variables!) and I'm trying to figure out the why circle-ci is failing them.

I suspect and am testing out a few things:

Will comment again if/when I figure it out

seanmarcia commented 1 year ago

Looks like CircleCi is working? Not sure why it says rspec is failing when there are no failing tests. I'm definitely not a circleci expert.

uzorjchibuzor commented 1 year ago

Thanks for picking this up, I have been unable to make for it.

On Apr 9, 2023, at 5:22 PM, Sean Marcia @.***> wrote:

Looks like CircleCi is working? Not sure why it says rspec is failing when there are no failing tests. I'm definitely not a circleci expert.

— Reply to this email directly, view it on GitHub https://github.com/ifmeorg/ifme/pull/2183#issuecomment-1501164286, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHZNEUSUNBSYBZCGPHIGHUTXALO4PANCNFSM6AAAAAARNJD7FI. You are receiving this because you authored the thread.

seanmarcia commented 1 year ago

Still not sure why it is reporting rspec tests as failing. I noticed the branch needed the version of ruby to be updated, which involved some circle-ci changes. Which was a lot of trial and error but I think it is mostly ready.

seanmarcia commented 1 year ago

Finally green. Looks like Circle-CI has issues with the latest version of simplecov so I had to downgrade it. There were also a couple of vulnerabilities that needed to be addressed but it looks like it is in a good place now.

Any interest in setting up the CI in GitHub actions?

julianguyen commented 1 year ago

Thanks so much for picking this up @seanmarcia! Sorry I couldn't review this a few weeks ago!

Setting up with GitHub actions would be a great long-term route to explore, are you familiar with that Circle CI to GitHub actions conversion process @seanmarcia ?