Skip to content

Commit 59f4e32

Browse files
authored
Merge branch 'main' into dependabot/bundler/rubocop-1.78.0
2 parents 30f3cd4 + 8708bf1 commit 59f4e32

File tree

97 files changed

+590
-222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+590
-222
lines changed

.github/workflows/rubyonrails.yml

Lines changed: 83 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,109 @@
1-
# This workflow uses actions that are not certified by GitHub. They are
2-
# provided by a third-party and are governed by separate terms of service,
3-
# privacy policy, and support documentation.
4-
#
5-
# This workflow will install a prebuilt Ruby version, install dependencies, and
6-
# run tests and linters.
71
name: "Ruby on Rails CI"
8-
on:
9-
push:
10-
branches: [ "main", "dev" ]
11-
pull_request:
12-
branches: [ "main", "dev" ]
2+
3+
on: { push: { branches: [main, dev] }, pull_request: { branches: [main, dev] } }
4+
135
jobs:
146
rspec:
157
runs-on: ubuntu-latest
168
environment: test
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
include:
13+
- ruby: '3.4.4'
14+
rails: '7.1.5.1'
15+
allowed_failure: false # ✅ required
16+
- ruby: '3.4.4'
17+
rails: '7.2'
18+
allowed_failure: true # ⚠️ allowed to fail
19+
- ruby: '3.4.4'
20+
rails: '8.0'
21+
allowed_failure: true # ⚠️ allowed to fail
22+
23+
env:
24+
RAILS_ENV: test
25+
DATABASE_URL: "postgis://rails:password@localhost:5432/rails_test"
26+
ES_HOST: "http://localhost"
27+
RAILS_VERSION: ${{ matrix.rails }}
28+
1729
services:
1830
postgres:
1931
image: postgis/postgis:latest
20-
ports:
21-
- "5432:5432"
22-
env:
23-
POSTGRES_DB: rails_test
24-
POSTGRES_USER: rails
25-
POSTGRES_PASSWORD: password
32+
ports: ["5432:5432"]
33+
env: { POSTGRES_DB: rails_test, POSTGRES_USER: rails, POSTGRES_PASSWORD: password }
2634
elasticsearch:
2735
image: elasticsearch:7.17.23
28-
ports:
29-
- "9200:9200"
36+
ports: ["9200:9200"]
3037
env:
31-
"node.name": elasticsearch
32-
"cluster.name": better-together-es
33-
"discovery.seed_hosts": elasticsearch
34-
"discovery.type": single-node
35-
"bootstrap.memory_lock": true
36-
"ES_JAVA_OPTS": "-Xms512m -Xmx512m"
37-
env:
38-
RAILS_ENV: test
39-
DATABASE_URL: "postgis://rails:password@localhost:5432/rails_test"
40-
ES_HOST: "http://localhost"
38+
node.name: elasticsearch
39+
cluster.name: better-together-es
40+
discovery.seed_hosts: elasticsearch
41+
discovery.type: single-node
42+
bootstrap.memory_lock: "true"
43+
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
44+
4145
steps:
4246
- name: Checkout code
4347
uses: actions/checkout@v3
44-
# Add or replace dependency steps here
45-
- name: Install Ruby and gems
48+
49+
- name: Install Ruby & gems
4650
uses: ruby/setup-ruby@v1
4751
with:
48-
bundler-cache: true
49-
# Add or replace database setup steps here
50-
- name: Set up database schema
51-
run: rm -f spec/dummy/tmp/pids/server.pid && cd ./spec/dummy && bundle exec rails db:schema:load
52-
# Add or replace test runners here
53-
- name: Run tests
52+
ruby-version: ${{ matrix.ruby }}
53+
54+
# Run the automatic bundle-install only on 7.1.
55+
# For 7.2 / 8.0 it just sets up Ruby *and* restores a cache layer
56+
# that we’ll reuse in the later manual install.
57+
bundler-cache: ${{ matrix.rails == '7.1.5.1' }}
58+
59+
# One cache bucket per Rails version so they don’t clobber each other.
60+
cache-version: rails-${{ matrix.rails }}
61+
62+
# Updating Rails can legitimately blow up on the experimental tracks,
63+
# so we allow that *step* to error out without failing the job.
64+
- name: Update Rails & install gems
65+
if: matrix.rails != '7.1.5.1'
66+
id: update
67+
run: |
68+
# turn off deployment mode
69+
bundle config set deployment false
70+
# conservative upgrade to the target rails version
71+
bundle update rails --conservative
72+
# install missing gems (writes bin/rspec, etc)
73+
bundle install --jobs 4 --retry 3
74+
continue-on-error: ${{ matrix.allowed_failure }}
75+
76+
- name: Prepare DB schema
77+
if: (matrix.rails == '7.1.5.1') || steps.update.outcome == 'success'
78+
run: |
79+
rm -f spec/dummy/tmp/pids/server.pid
80+
bundle exec rake -f spec/dummy/Rakefile db:schema:load
81+
continue-on-error: ${{ matrix.allowed_failure }}
82+
83+
- name: Run RSpec
84+
if: (matrix.rails == '7.1.5.1') || steps.update.outcome == 'success'
5485
env:
5586
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
56-
run: rm -f spec/dummy/tmp/pids/server.pid && bundle exec rspec
87+
run: |
88+
rm -f spec/dummy/tmp/pids/server.pid
89+
bundle exec rspec
90+
continue-on-error: ${{ matrix.allowed_failure }}
5791

92+
# ── style & security jobs (unchanged) ───────────────────────────────────────
5893
rubocop:
5994
runs-on: ubuntu-latest
6095
steps:
61-
- name: Checkout code
62-
uses: actions/checkout@v3
63-
- name: Install Ruby and gems
64-
uses: ruby/setup-ruby@v1
65-
with:
66-
bundler-cache: true
67-
- name: Lint Ruby files with Rubocop
68-
run: bundle exec rubocop --parallel
96+
- uses: actions/checkout@v3
97+
- uses: ruby/setup-ruby@v1
98+
with: { bundler-cache: true }
99+
- run: bundle exec rubocop --parallel
69100

70101
security:
71102
runs-on: ubuntu-latest
72103
steps:
73-
- name: Checkout code
74-
uses: actions/checkout@v3
75-
- name: Install Ruby and gems
76-
uses: ruby/setup-ruby@v1
77-
with:
78-
bundler-cache: true
79-
- name: Generate binstubs
80-
run: bundle binstubs bundler-audit --force
81-
- name: Security audit dependencies
82-
run: bundle exec bundler-audit --update
83-
- name: Security audit application code
84-
run: bundle exec brakeman -q -w2
104+
- uses: actions/checkout@v3
105+
- uses: ruby/setup-ruby@v1
106+
with: { bundler-cache: true }
107+
- run: bundle binstubs bundler-audit --force
108+
- run: bundle exec bundler-audit --update
109+
- run: bundle exec brakeman -q -w2

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ gem 'pundit-resources', '~> 1.1.4', github: 'better-together-org/pundit-resource
2727

2828
# Core Rails gem
2929
gem 'rack-protection'
30-
gem 'rails', '~> 7.1.3'
30+
gem 'rails', ENV.fetch('RAILS_VERSION', '7.1.5.1')
3131

3232
# Redis for ActionCable and background jobs
3333
gem 'redis', '~> 5.4'

Gemfile.lock

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
GIT
22
remote: https://github.com/better-together-org/pundit-resources.git
3-
revision: b6218c695c2b6c7413ab416a318cd540835c5394
3+
revision: 4e50d1f97a1e7c864bc45e2613b763ecf8f079ce
44
specs:
5-
pundit-resources (1.1.5)
5+
pundit-resources (1.1.6)
66
activesupport
77
jsonapi-resources
88
pundit
9-
rails (>= 4.2.1, < 7.2)
9+
rails (>= 4.2.1, < 8.1)
1010

1111
GIT
1212
remote: https://github.com/better-together-org/storext.git
13-
revision: 1d7c3707b3e412fece0022c16cc6f51564969d2c
13+
revision: ebc92461e95d07c34f5d8eac4eb7ad13cfd92afa
1414
specs:
15-
storext (3.3.0)
16-
activerecord (>= 4.0, < 8)
15+
storext (3.3.1)
16+
activerecord (>= 4.0, < 8.1)
1717
virtus
1818

1919
PATH
@@ -53,7 +53,7 @@ PATH
5353
rack-attack
5454
rack-cors (>= 1.1.1, < 3.1.0)
5555
rack-mini-profiler
56-
rails (>= 5.2.2, < 7.2.0)
56+
rails (>= 7.1, < 8.1)
5757
reform-rails (~> 0.2.0)
5858
rswag (>= 2.3.1, < 2.17.0)
5959
ruby-openai
@@ -167,19 +167,20 @@ GEM
167167
unf
168168
ast (2.4.3)
169169
aws-eventstream (1.4.0)
170-
aws-partitions (1.1133.0)
171-
aws-sdk-core (3.227.0)
170+
aws-partitions (1.1139.0)
171+
aws-sdk-core (3.228.0)
172172
aws-eventstream (~> 1, >= 1.3.0)
173173
aws-partitions (~> 1, >= 1.992.0)
174174
aws-sigv4 (~> 1.9)
175175
base64
176+
bigdecimal
176177
jmespath (~> 1, >= 1.6.1)
177178
logger
178-
aws-sdk-kms (1.107.0)
179-
aws-sdk-core (~> 3, >= 3.227.0)
179+
aws-sdk-kms (1.109.0)
180+
aws-sdk-core (~> 3, >= 3.228.0)
180181
aws-sigv4 (~> 1.5)
181-
aws-sdk-s3 (1.194.0)
182-
aws-sdk-core (~> 3, >= 3.227.0)
182+
aws-sdk-s3 (1.195.0)
183+
aws-sdk-core (~> 3, >= 3.228.0)
183184
aws-sdk-kms (~> 1)
184185
aws-sigv4 (~> 1.5)
185186
aws-sigv4 (1.12.1)
@@ -396,7 +397,7 @@ GEM
396397
image_processing (1.14.0)
397398
mini_magick (>= 4.9.5, < 6)
398399
ruby-vips (>= 2.0.17, < 3)
399-
importmap-rails (2.2.1)
400+
importmap-rails (2.2.2)
400401
actionpack (>= 6.0.0)
401402
activesupport (>= 6.0.0)
402403
railties (>= 6.0.0)
@@ -495,7 +496,9 @@ GEM
495496
parser (3.3.8.0)
496497
ast (~> 2.4.1)
497498
racc
498-
pg (1.6.0-x86_64-linux)
499+
pg (1.6.1-aarch64-linux)
500+
pg (1.6.1-arm64-darwin)
501+
pg (1.6.1-x86_64-linux)
499502
popper_js (2.11.8)
500503
pp (0.6.2)
501504
prettyprint
@@ -521,7 +524,7 @@ GEM
521524
i18n (>= 0.5.0)
522525
railties (>= 6.1.0)
523526
public_suffix (6.0.1)
524-
puma (6.6.0)
527+
puma (6.6.1)
525528
nio4r (~> 2.0)
526529
pundit (2.5.0)
527530
activesupport (>= 3.0.0)
@@ -842,7 +845,7 @@ DEPENDENCIES
842845
pundit-resources (~> 1.1.4)!
843846
rack-mini-profiler
844847
rack-protection
845-
rails (~> 7.1.3)
848+
rails (= 7.1.5.1)
846849
rb-readline
847850
rbtrace
848851
redis (~> 5.4)

app/assets/config/better_together_manifest.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//= link_tree ../stylesheets .css
55
//= link_tree ../../../vendor/stylesheets .css
66
//= link_tree ../stylesheets .scss
7+
//= link better_together/mailer.css
78
//= link_tree ../images
89

910
//= link actioncable.js

app/assets/stylesheets/better_together/application.scss

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@
1414
*= require_self
1515
*/
1616

17-
@import 'theme';
17+
@use 'theme' as *;
1818

1919
// Import Bootstrap and Font Awesome
2020

21-
@import 'bootstrap';
22-
@import 'cards';
23-
@import 'devise';
24-
@import 'font-awesome';
25-
@import 'actiontext';
26-
@import 'contact_details';
27-
@import 'content_blocks';
28-
@import 'conversations';
29-
@import 'forms';
30-
@import 'image-galleries';
31-
@import 'maps';
32-
@import 'metrics';
33-
@import 'navigation';
34-
@import 'notifications';
35-
@import 'profiles';
36-
@import 'simple_calendar';
37-
@import 'share';
38-
@import 'sidebar_nav';
39-
@import 'trix-extensions/richtext';
21+
@use 'bootstrap' as *;
22+
@use 'cards';
23+
@use 'devise';
24+
@use 'font-awesome';
25+
@use 'actiontext';
26+
@use 'contact_details';
27+
@use 'content_blocks';
28+
@use 'conversations';
29+
@use 'forms';
30+
@use 'image-galleries';
31+
@use 'maps';
32+
@use 'metrics';
33+
@use 'navigation';
34+
@use 'notifications';
35+
@use 'profiles';
36+
@use 'simple_calendar';
37+
@use 'share';
38+
@use 'sidebar_nav';
39+
@use 'trix-extensions/richtext';
4040

4141
// Styles that use the variables
4242
.text-opposite-theme {
@@ -74,7 +74,7 @@
7474
#flash_messages {
7575
position: absolute;
7676
width: 100vw;
77-
top: 7.5vh;
77+
top: 6vh;
7878
z-index: 1001;
7979
}
8080

app/assets/stylesheets/better_together/contact_details.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import 'theme';
1+
@use 'theme' as *;
22

33
.contact-detail-item {
44
margin-bottom: 15px;

app/assets/stylesheets/better_together/forms.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "theme";
1+
@use "theme" as *;
22

33
.required-indicator {
44
color: $danger;

app/assets/stylesheets/better_together/share.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
@import 'theme';
1+
@use 'theme' as *;
32

43
.social-share-buttons {
54
margin-top: 40px;

app/assets/stylesheets/better_together/sidebar_nav.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import 'theme';
1+
@use 'theme' as *;
22

33
#sidebar_nav {
44
// Sidebar heading styles

app/controllers/better_together/messages_controller.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ def notify_participants(message)
3434
# Get all participants except the sender
3535
recipients = message.conversation.participants.where.not(id: message.sender_id)
3636

37-
# Log recipients for debugging
38-
puts "Recipients for message notification: #{recipients.map(&:id)}"
39-
40-
# broadcast_to_recipients(message, recipients)
41-
4237
# Pass the array of recipients to the notification
4338
BetterTogether::NewMessageNotifier.with(record: message).deliver_later(recipients)
4439
end

0 commit comments

Comments
 (0)