Skip to content

Commit e7a9021

Browse files
authored
Merge branch 'main' into codex/add-system-tests-for-turbo-native
2 parents 4730e4b + 96443b2 commit e7a9021

File tree

1,195 files changed

+100493
-3703
lines changed

Some content is hidden

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

1,195 files changed

+100493
-3703
lines changed

.env.dev

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
ALLOWED_HOSTS='http://localhost:3000'
77
APP_HOST='http://localhost:3000'
88
APP_DEFAULT_LOCALE='en'
9-
APP_AVAILABLE_LOCALES='es,en,fr'
10-
APP_FALLBACK_LOCALES='es,en,fr'
9+
APP_AVAILABLE_LOCALES='en,fr,es,uk'
10+
APP_FALLBACK_LOCALES='en,fr,es,uk'
1111

12-
ES_PORT='9201'
12+
ES_PORT='9200'
1313
ES_HOST='http://elasticsearch'
1414
# ELASTICSEARCH_URL='http://elasticsearch:9201'
1515

.env.prod.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PORT=5000
2424

2525
RACK_ENV=production
2626
RAILS_ENV=production
27-
RAILS_LOG_LEVEL=debug
27+
RAILS_LOG_LEVEL=info
2828
RAILS_LOG_TO_STDOUT=true
2929
RAILS_SERVE_STATIC_FILES=true
3030

.github/copilot-instructions.md

Lines changed: 233 additions & 58 deletions
Large diffs are not rendered by default.

.github/instructions/view-helpers.instructions.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,20 @@ end
8080
- `truncate`, `pluralize`, `excerpt`, `word_wrap`, `simple_format`.
8181
- For rich text (Action Text), use `record.body` and `to_plain_text` for indexing/search.
8282

83+
### Privacy Display
84+
- Use `privacy_display_value(entity)` for consistent, translated privacy level display across the application.
85+
- This helper automatically looks up the proper translation from `attributes.privacy_list` and falls back to humanized values.
86+
- Supports all privacy levels: `public`, `private`, `community`, `unlisted`.
87+
88+
```ruby
89+
# Instead of: entity.privacy.humanize or entity.privacy.capitalize
90+
<%= privacy_display_value(@event) %> # "Public" / "Público" / "Public"
91+
<%= privacy_display_value(@community) %> # "Private" / "Privado" / "Privé"
92+
93+
# Works in badges too (automatically used)
94+
<%= privacy_badge(@entity) %> # Uses privacy_display_value internally
95+
```
96+
8397
---
8498
8599
## 4. Navigation & Link Helpers

.github/pull_request_template.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Summary
2+
3+
Describe the change and the motivation.
4+
5+
## Checklist
6+
7+
- [ ] Tests added/updated and passing (`bin/ci`).
8+
- [ ] Lint and security checks (`rubocop`, `brakeman`, `bundler-audit`).
9+
- [ ] Documentation updated under `docs/` describing new/changed functionality.
10+
- [ ] Mermaid diagrams (`docs/*.mmd`) updated to reflect changes.
11+
- [ ] Rendered PNGs regenerated with `bin/render_diagrams` and committed.
12+
- [ ] For DB changes, included any needed backfills/dedupes and noted risks.
13+
14+
## Screenshots / Diagrams
15+
16+
If applicable, include screenshots or link to updated diagrams.
17+
18+
## Notes
19+
20+
Anything reviewers should be aware of (migration order, flags, feature toggles).
21+

.github/workflows/diagrams.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Diagrams Check
2+
3+
on:
4+
pull_request:
5+
branches: [ "**" ]
6+
7+
jobs:
8+
render-and-verify:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Node
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '20'
18+
19+
- name: Render Mermaid diagrams
20+
run: |
21+
chmod +x bin/render_diagrams || true
22+
./bin/render_diagrams || true
23+
24+
- name: Verify rendered PNGs are up to date
25+
run: |
26+
CHANGED=$(git status --porcelain -- docs/diagrams/exports/png/*.png docs/diagrams/exports/svg/*.svg | wc -l)
27+
if [ "$CHANGED" -gt 0 ]; then
28+
echo "Diagram exports are out of date. Please run bin/render_diagrams and commit the updated files." >&2
29+
echo "Changed files:" >&2
30+
git status --porcelain -- docs/diagrams/exports/png/*.png docs/diagrams/exports/svg/*.svg >&2 || true
31+
exit 1
32+
fi
33+
shell: bash
34+

.github/workflows/i18n-health.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: i18n Translation Health Report
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
pull_request:
9+
branches:
10+
- main
11+
- dev
12+
13+
jobs:
14+
i18n-health:
15+
runs-on: ubuntu-latest
16+
env:
17+
# Ensure dev/test gems (incl. i18n-tasks) are installed
18+
BUNDLE_WITHOUT: ""
19+
BUNDLE_WITH: "development:test"
20+
if: github.event_name == 'push' || github.event_name == 'pull_request'
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
- name: Set up Ruby
25+
uses: ruby/setup-ruby@v1
26+
env:
27+
# Ensure bundler installs dev/test groups during caching step
28+
BUNDLE_WITHOUT: ""
29+
BUNDLE_WITH: "development:test"
30+
with:
31+
ruby-version: '3.4.4'
32+
bundler-cache: true
33+
- name: Verify i18n-tasks
34+
run: bundle exec i18n-tasks --version
35+
- name: Normalize locale files
36+
run: bin/i18n normalize
37+
- name: Run i18n checks
38+
run: bin/i18n check
39+
- name: Upload i18n health report
40+
if: always()
41+
run: bin/i18n health > i18n-health.txt
42+
continue-on-error: true
43+
- name: Archive i18n health report
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: i18n-health-report
47+
path: i18n-health.txt
48+
continue-on-error: true

.github/workflows/rubyonrails.yml

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,17 @@ jobs:
1111
matrix:
1212
include:
1313
- ruby: '3.4.4'
14-
rails: '7.1.5.1'
14+
rails: '7.2.2.2'
1515
allowed_failure: false # ✅ required
16-
# - ruby: '3.4.4'
17-
# rails: '7.2'
18-
# allowed_failure: true # ⚠️ allowed to fail
1916
- ruby: '3.4.4'
20-
rails: '8.0'
21-
allowed_failure: true # ⚠️ allowed to fail
17+
rails: '8.0.3'
18+
allowed_failure: false # ✅ required
2219

2320
env:
2421
RAILS_ENV: test
2522
DATABASE_URL: "postgis://rails:password@localhost:5432/rails_test"
2623
ES_HOST: "http://localhost"
24+
ELASTICSEARCH_URL: "http://localhost:9200"
2725
RAILS_VERSION: ${{ matrix.rails }}
2826

2927
services:
@@ -51,18 +49,18 @@ jobs:
5149
with:
5250
ruby-version: ${{ matrix.ruby }}
5351

54-
# Run the automatic bundle-install only on 7.1.
52+
# Run the automatic bundle-install only on 7.2.
5553
# For 7.2 / 8.0 it just sets up Ruby *and* restores a cache layer
5654
# that we’ll reuse in the later manual install.
57-
bundler-cache: ${{ matrix.rails == '7.1.5.1' }}
55+
bundler-cache: ${{ matrix.rails == '8.0.3' }}
5856

5957
# One cache bucket per Rails version so they don’t clobber each other.
6058
cache-version: rails-${{ matrix.rails }}
6159

6260
# Updating Rails can legitimately blow up on the experimental tracks,
6361
# so we allow that *step* to error out without failing the job.
6462
- name: Update Rails & install gems
65-
if: matrix.rails != '7.1.5.1'
63+
if: matrix.rails != '8.0.3'
6664
id: update
6765
run: |
6866
# turn off deployment mode
@@ -74,21 +72,52 @@ jobs:
7472
continue-on-error: ${{ matrix.allowed_failure }}
7573

7674
- name: Prepare DB schema
77-
if: (matrix.rails == '7.1.5.1') || steps.update.outcome == 'success'
75+
if: (matrix.rails == '8.0.3') || steps.update.outcome == 'success'
7876
run: |
7977
rm -f spec/dummy/tmp/pids/server.pid
8078
bundle exec rake -f spec/dummy/Rakefile db:schema:load
8179
continue-on-error: ${{ matrix.allowed_failure }}
8280

81+
- name: Wait for Elasticsearch
82+
if: (matrix.rails == '8.0.3') || steps.update.outcome == 'success'
83+
run: |
84+
echo "Waiting for Elasticsearch to be healthy..."
85+
curl -s "http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" || (echo "Elasticsearch not healthy" && exit 1)
86+
87+
8388
- name: Run RSpec
84-
if: (matrix.rails == '7.1.5.1') || steps.update.outcome == 'success'
89+
if: (matrix.rails == '8.0.3') || steps.update.outcome == 'success'
8590
env:
8691
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
8792
run: |
8893
rm -f spec/dummy/tmp/pids/server.pid
8994
bundle exec rspec
9095
continue-on-error: ${{ matrix.allowed_failure }}
9196

97+
- name: Upload coverage report
98+
if: always()
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: coverage-report-ruby-${{ matrix.ruby }}-rails-${{ matrix.rails }}
102+
path: |
103+
coverage/
104+
105+
- name: Generate coverage badge
106+
if: ${{ github.ref == 'refs/heads/main' && success() }}
107+
continue-on-error: true
108+
run: |
109+
COVERAGE=$(jq -r '.result.covered_percent' coverage/.last_run.json)
110+
COLOR=$(node -e "cov=parseFloat(process.argv[1]);console.log(cov>=90?'green':cov>=75?'orange':'red')" $COVERAGE)
111+
npx badgen-cli --subject coverage --status ${COVERAGE}% --color $COLOR > coverage.svg
112+
113+
- name: Commit badge
114+
if: ${{ github.ref == 'refs/heads/main' && success() }}
115+
continue-on-error: true
116+
uses: stefanzweifel/git-auto-commit-action@v5
117+
with:
118+
commit_message: "chore: update coverage badge"
119+
file_pattern: coverage.svg
120+
92121
# ── style & security jobs (unchanged) ───────────────────────────────────────
93122
rubocop:
94123
runs-on: ubuntu-latest

.rubocop.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,42 @@
1+
inherit_from: .rubocop_todo.yml
2+
13
AllCops:
24
Exclude:
35
- 'bin/*'
46
- 'node_modules/**/*'
57
- 'spec/dummy/db/schema.rb'
8+
- 'db/schema.rb'
69
- 'vendor/**/*'
710
NewCops: enable
11+
TargetRubyVersion: 3.4
12+
plugins:
13+
- rubocop-rails
14+
- rubocop-rspec
15+
- rubocop-rspec_rails
16+
- rubocop-capybara
17+
- rubocop-factory_bot
18+
19+
# Disable all RSpec cops that affect test quality but not production code
20+
RSpec/ExampleLength:
21+
Enabled: false
22+
RSpec/MultipleExpectations:
23+
Enabled: false
24+
RSpec/MultipleMemoizedHelpers:
25+
Enabled: false
26+
RSpec/ContextWording:
27+
Enabled: false
28+
RSpec/MessageSpies:
29+
Enabled: false
30+
RSpec/LetSetup:
31+
Enabled: false
32+
833
Style/StringLiterals:
934
Exclude:
1035
- 'db/migrate/*'
36+
37+
Rails:
38+
Enabled: false
39+
Capybara:
40+
Enabled: false
41+
FactoryBot:
42+
Enabled: false

.rubocop_todo.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config`
3+
# on 2025-11-04 02:06:37 UTC using RuboCop version 1.81.6.
4+
# The point is for the user to remove these configuration records
5+
# one by one as the offenses are removed from the code base.
6+
# Note that changes in the inspected code, or installation of new
7+
# versions of RuboCop, may require this file to be generated again.
8+
9+
# Offense count: 52
10+
# This cop supports safe autocorrection (--autocorrect).
11+
Lint/RedundantCopDisableDirective:
12+
Enabled: false
13+
14+
# Offense count: 2
15+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
16+
Metrics/MethodLength:
17+
Max: 14
18+
19+
# Offense count: 1
20+
# This cop supports safe autocorrection (--autocorrect).
21+
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
22+
# SupportedStyles: assign_to_condition, assign_inside_condition
23+
Style/ConditionalAssignment:
24+
Exclude:
25+
- 'app/controllers/better_together/joatu/hub_controller.rb'
26+
27+
# Offense count: 29
28+
# This cop supports safe autocorrection (--autocorrect).
29+
Style/IfUnlessModifier:
30+
Enabled: false
31+
32+
# Offense count: 1
33+
# Configuration parameters: Max.
34+
Style/SafeNavigationChainLength:
35+
Exclude:
36+
- 'spec/features/devise/registration_spec.rb'
37+
38+
# Offense count: 1
39+
# This cop supports safe autocorrection (--autocorrect).
40+
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
41+
# URISchemes: http, https
42+
Layout/LineLength:
43+
Max: 145

0 commit comments

Comments
 (0)