From 0e3937c520fd2326e19427b1539470fc4ab590c2 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Sun, 5 Jan 2025 00:04:00 +0100 Subject: [PATCH 1/3] CI: Run actions on ubuntu-22.04 ubuntu-latest will soon be ubuntu-24.04, which dropped support for imagemagick. Let's stick with ubuntu 22 until this sorted out. (cherry picked from commit b4d59ade61b0cf2aa12066264b5b87e280ac165f) # Conflicts: # .github/workflows/backport.yml # .github/workflows/build_test.yml # .github/workflows/lint.yml --- .github/workflows/brakeman-analysis.yml | 2 +- .github/workflows/lint.yml | 4 ++-- .github/workflows/stale.yml | 2 +- .github/workflows/test.yml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/brakeman-analysis.yml b/.github/workflows/brakeman-analysis.yml index e824801f2f..fb4cc3f295 100644 --- a/.github/workflows/brakeman-analysis.yml +++ b/.github/workflows/brakeman-analysis.yml @@ -15,7 +15,7 @@ on: jobs: brakeman-scan: name: Brakeman Scan - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: # Checkout the repository to the GitHub Actions runner - name: Checkout diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 568a24abbb..732385c55b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,7 +4,7 @@ on: [pull_request] jobs: Standard: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout code uses: actions/checkout@v3 @@ -16,7 +16,7 @@ jobs: - name: Lint Ruby files run: bundle exec standardrb Prettier: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index acdc5bff94..1821afb177 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -6,7 +6,7 @@ on: jobs: stale: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/stale@v5 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 22c5dc7df2..7686075e77 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: RSpec: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: @@ -106,7 +106,7 @@ jobs: name: Screenshots path: spec/dummy/tmp/screenshots Jest: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 env: NODE_ENV: test steps: From 5404f941cba620388d2d1a1afaf5363fac3955d1 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Sun, 5 Jan 2025 00:19:55 +0100 Subject: [PATCH 2/3] CI: Fix screenshot artifacts path Sometimes the screenshots are saved under capybara folder. (cherry picked from commit 34df78ac189159c40242cb93aadb3b86931e81d3) # Conflicts: # .github/workflows/build_test.yml --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7686075e77..f7a676c008 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -104,7 +104,9 @@ jobs: if: failure() with: name: Screenshots - path: spec/dummy/tmp/screenshots + path: | + spec/dummy/tmp/capybara + spec/dummy/tmp/screenshots Jest: runs-on: ubuntu-22.04 env: From 65ecce8ec085b8ccadda651da16870272cdc5676 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Sun, 5 Jan 2025 01:11:47 +0100 Subject: [PATCH 3/3] chore: Fix rubocop styling issues --- app/models/concerns/alchemy/picture_thumbnails.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/models/concerns/alchemy/picture_thumbnails.rb b/app/models/concerns/alchemy/picture_thumbnails.rb index ef3a234e81..aa4e907233 100644 --- a/app/models/concerns/alchemy/picture_thumbnails.rb +++ b/app/models/concerns/alchemy/picture_thumbnails.rb @@ -102,11 +102,10 @@ def image_cropper_settings # Show image cropping link for ingredient def allow_image_cropping? - settings[:crop] && picture && - picture.can_be_cropped_to?( - settings[:size], - settings[:upsample] - ) && !!picture.image_file + settings[:crop] && picture&.can_be_cropped_to?( + settings[:size], + settings[:upsample] + ) && !!picture.image_file end private