Skip to content

Commit f9a38d7

Browse files
authored
Merge branch 'main' into codex/add-sitemap-generator-and-configuration
Signed-off-by: Robert Smith <[email protected]>
2 parents 37b20a3 + 96443b2 commit f9a38d7

File tree

497 files changed

+55856
-2152
lines changed

Some content is hidden

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

497 files changed

+55856
-2152
lines changed

.env.dev

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
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

1212
ES_PORT='9200'
1313
ES_HOST='http://elasticsearch'

.github/copilot-instructions.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,19 @@ This repository contains the **Better Together Community Engine** (an isolated R
9292
9393
## Coding Guidelines
9494
95+
### Debugging and Development Practices
96+
- **Never use Rails console or runner for debugging** - These commands don't support our test-driven development approach
97+
- **Debug through comprehensive tests**: Write detailed test scenarios to reproduce, understand, and verify fixes for issues
98+
- **Use test-driven debugging workflow**:
99+
- Create specific tests that reproduce the problematic behavior
100+
- Add debugging assertions in tests to verify intermediate state
101+
- Trace through code by reading files and using grep search
102+
- Validate fixes by ensuring tests pass
103+
- **Leverage RSpec debugging tools**: Use `--format documentation` for detailed output, `fit` for focused testing, `puts` for temporary debug output in tests
104+
- **Analyze logs and error messages**: Examine Rails logs, test output, and stack traces for debugging information
105+
- **Read code systematically**: Use file reading tools to understand code paths and data flow
106+
- **Temporary debug output**: Add debug statements in application code if needed, but remove before committing
107+
95108
### Docker Environment Usage
96109
- **All database-dependent commands must use `bin/dc-run`**: This includes tests, generators, and any command that connects to PostgreSQL, Redis, or Elasticsearch
97110
- **Dummy app commands use `bin/dc-run-dummy`**: For Rails commands that need the dummy app context (console, migrations specific to dummy app)
@@ -102,10 +115,11 @@ This repository contains the **Better Together Community Engine** (an isolated R
102115
- RuboCop: `bin/dc-run bundle exec rubocop`
103116
- **IMPORTANT**: Never use `rspec -v` - this displays version info, not verbose output. Use `--format documentation` for detailed output.
104117
- **Examples of commands requiring `bin/dc-run-dummy`**:
105-
- Rails console: `bin/dc-run-dummy rails console`
118+
- Rails console: `bin/dc-run-dummy rails console` (for administrative tasks only, NOT for debugging)
106119
- Dummy app migrations: `bin/dc-run-dummy rails db:migrate`
107120
- Dummy app database operations: `bin/dc-run-dummy rails db:seed`
108121
- **Commands that don't require bin/dc-run**: File operations, documentation generation (unless database access needed), static analysis tools that don't connect to services
122+
- **CRITICAL**: Rails console and runner are NOT debugging tools in this project - use comprehensive test suites instead
109123
110124
### Security Requirements
111125
- **Run Brakeman before generating code**: `bin/dc-run bundle exec brakeman --quiet --no-pager`

.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/workflows/rubyonrails.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
rails: '7.2.2.2'
1515
allowed_failure: false # ✅ required
1616
- ruby: '3.4.4'
17-
rails: '8.0.2'
18-
allowed_failure: true # ⚠️ allowed to fail
17+
rails: '8.0.3'
18+
allowed_failure: false # ✅ required
1919

2020
env:
2121
RAILS_ENV: test
@@ -52,15 +52,15 @@ jobs:
5252
# Run the automatic bundle-install only on 7.2.
5353
# For 7.2 / 8.0 it just sets up Ruby *and* restores a cache layer
5454
# that we’ll reuse in the later manual install.
55-
bundler-cache: ${{ matrix.rails == '7.2.2.2' }}
55+
bundler-cache: ${{ matrix.rails == '8.0.3' }}
5656

5757
# One cache bucket per Rails version so they don’t clobber each other.
5858
cache-version: rails-${{ matrix.rails }}
5959

6060
# Updating Rails can legitimately blow up on the experimental tracks,
6161
# so we allow that *step* to error out without failing the job.
6262
- name: Update Rails & install gems
63-
if: matrix.rails != '7.2.2.2'
63+
if: matrix.rails != '8.0.3'
6464
id: update
6565
run: |
6666
# turn off deployment mode
@@ -72,21 +72,21 @@ jobs:
7272
continue-on-error: ${{ matrix.allowed_failure }}
7373

7474
- name: Prepare DB schema
75-
if: (matrix.rails == '7.2.2.2') || steps.update.outcome == 'success'
75+
if: (matrix.rails == '8.0.3') || steps.update.outcome == 'success'
7676
run: |
7777
rm -f spec/dummy/tmp/pids/server.pid
7878
bundle exec rake -f spec/dummy/Rakefile db:schema:load
7979
continue-on-error: ${{ matrix.allowed_failure }}
8080

8181
- name: Wait for Elasticsearch
82-
if: (matrix.rails == '7.2.2.2') || steps.update.outcome == 'success'
82+
if: (matrix.rails == '8.0.3') || steps.update.outcome == 'success'
8383
run: |
8484
echo "Waiting for Elasticsearch to be healthy..."
8585
curl -s "http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" || (echo "Elasticsearch not healthy" && exit 1)
8686
8787
8888
- name: Run RSpec
89-
if: (matrix.rails == '7.2.2.2') || steps.update.outcome == 'success'
89+
if: (matrix.rails == '8.0.3') || steps.update.outcome == 'success'
9090
env:
9191
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
9292
run: |

.rubocop.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
inherit_from: .rubocop_todo.yml
2+
13
AllCops:
24
Exclude:
35
- 'bin/*'
@@ -13,6 +15,21 @@ plugins:
1315
- rubocop-rspec_rails
1416
- rubocop-capybara
1517
- 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+
1633
Style/StringLiterals:
1734
Exclude:
1835
- 'db/migrate/*'

.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

AGENTS.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ Instructions for GitHub Copilot and other automated contributors working in this
1919
- test: `community_engine_test`
2020
- Use `DATABASE_URL` to connect (overrides fallback host in `config/database.yml`).
2121

22+
## Debugging Guidelines
23+
- **Never use Rails console or runner for debugging** - These commands don't align with our test-driven development approach
24+
- **Use comprehensive test suites instead**: Write detailed tests to understand and verify system behavior
25+
- **Debug through tests**: Create specific test scenarios to reproduce and validate fixes for issues
26+
- **Use log analysis**: Examine Rails logs, test output, and error messages for debugging information
27+
- **Add temporary debugging assertions in tests**: Use `expect()` statements to verify intermediate state in tests
28+
- **Use RSpec debugging tools**: Use `--format documentation` for detailed test output, `fit` for focused testing
29+
- **Trace through code by reading files**: Use file reading and grep search to understand code paths
30+
- **Add debug output in application code temporarily** if needed, but remove before committing
31+
- **Validate fixes through test success**: Confirm that issues are resolved by having tests pass
32+
2233
## Commands
2334
- **Tests:** `bin/dc-run bin/ci`
2435
(Equivalent: `bin/dc-run bash -c "cd spec/dummy && bundle exec rspec"`)
@@ -29,7 +40,7 @@ Instructions for GitHub Copilot and other automated contributors working in this
2940
- Multiple specific lines: `bin/dc-run bundle exec rspec spec/file1_spec.rb:123 spec/file2_spec.rb:456`
3041
- **Important**: RSpec does NOT support hyphenated line numbers (e.g., `spec/file_spec.rb:123-456` is INVALID)
3142
- **Do NOT use `-v` flag**: The `-v` flag displays RSpec version information, NOT verbose output. Use `--format documentation` for detailed test descriptions.
32-
- **Rails Console:** `bin/dc-run-dummy rails console` (runs console in the dummy app context)
43+
- **Rails Console:** `bin/dc-run-dummy rails console` (for administrative tasks only - NOT for debugging. Use comprehensive tests for debugging instead)
3344
- **Rails Commands in Dummy App:** `bin/dc-run-dummy rails [command]` for any Rails commands that need the dummy app environment
3445
- **Lint:** `bin/dc-run bundle exec rubocop`
3546
- **Security:** `bin/dc-run bundle exec brakeman --quiet --no-pager` and `bin/dc-run bundle exec bundler-audit --update`

Dockerfile.docs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# syntax=docker/dockerfile:1.7
2+
3+
# Minimal toolchain for generating the documentation PDF (pandoc + LaTeX).
4+
FROM debian:12-slim
5+
6+
ARG DEBIAN_FRONTEND=noninteractive
7+
8+
RUN set -eux; \
9+
apt-get update -qq; \
10+
apt-get install -y --no-install-recommends \
11+
ca-certificates \
12+
curl \
13+
lmodern \
14+
fonts-noto-core \
15+
fonts-noto-mono \
16+
fonts-noto-cjk \
17+
fonts-noto-color-emoji \
18+
pandoc \
19+
texlive-latex-base \
20+
texlive-latex-recommended \
21+
texlive-fonts-recommended \
22+
texlive-xetex \
23+
fontconfig \
24+
fonts-dejavu-core; \
25+
rm -rf /var/lib/apt/lists/*
26+
27+
# Drop root for runtime safety
28+
RUN groupadd --system docs \
29+
&& useradd --system --create-home --gid docs --shell /bin/bash docs
30+
31+
WORKDIR /workspace
32+
USER docs
33+
34+
ENV LANG=C.UTF-8 \
35+
LC_ALL=C.UTF-8

Gemfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ gem 'fog-aws'
2020
# Database adapter for PostgreSQL
2121
gem 'pg', '>= 0.18', '< 2.0'
2222
# Puma as the app server
23-
gem 'puma', '~> 6.6'
23+
gem 'puma', '~> 7.1'
2424

2525
# Pundit for authorization, custom fork for Better Together
2626
gem 'pundit-resources', '~> 1.1.4', github: 'better-together-org/pundit-resources'
2727

2828
# Core Rails gem
2929
gem 'rack-protection'
30-
gem 'rails', ENV.fetch('RAILS_VERSION', '7.2.2.2')
30+
gem 'rails', ENV.fetch('RAILS_VERSION', '8.0.3')
3131

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

3535
gem 'rswag'
3636

3737
# Sidekiq for background processing
38-
gem 'sidekiq', '~> 8.0.7'
38+
gem 'sidekiq', '~> 8.0.9'
3939

4040
# Error and performance monitoring with Sentry
4141
gem 'sentry-rails'
@@ -65,7 +65,7 @@ group :development, :test do
6565
# Fuubar for fancy test progress bar
6666
gem 'fuubar'
6767
# Help with managing translation databasde
68-
gem 'i18n-tasks', '~> 1.0.15'
68+
gem 'i18n-tasks', '~> 1.1.2'
6969
# Pry for a powerful shell alternative to IRB
7070
gem 'pry'
7171
# RuboCop for static code analysis
@@ -101,6 +101,8 @@ group :test do
101101
# Capybara for integration testing
102102
gem 'capybara', '>= 2.15'
103103
gem 'capybara-screenshot'
104+
# WebMock for stubbing external HTTP requests in specs
105+
gem 'webmock'
104106
# Coveralls for test coverage reporting
105107
gem 'coveralls_reborn', require: false
106108
# Database cleaner for test database cleaning

0 commit comments

Comments
 (0)