Skip to content

Commit 364e2bd

Browse files
authored
Merge branch 'main' into 4987-annual-report-export-range
2 parents e3f616d + 0ee1fc3 commit 364e2bd

File tree

322 files changed

+6203
-1552
lines changed

Some content is hidden

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

322 files changed

+6203
-1552
lines changed

.devcontainer/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
# Installs Ruby 3.2.2. When human-essentials moves to a newer version of ruby,
1+
# Installs Ruby 3.4. When human-essentials moves to a newer version of ruby,
22
# it will be more efficient to change the image.
33
# See https://github.com/devcontainers/images/blob/main/src/ruby/history/
4-
FROM mcr.microsoft.com/devcontainers/ruby:dev-3.2
4+
#
5+
# See devcontainers/features#1431 for why we include the `-bookworm`
6+
# suffix. Once that issue is resolved, we can remove the suffix, which
7+
# will let us follow the debian upgrade to trixie.
8+
FROM mcr.microsoft.com/devcontainers/ruby:dev-3.4-bookworm
59
RUN export DEBIAN_FRONTEND=noninteractive
610
RUN apt-get update && apt-get -y install vim curl gpg postgresql postgresql-contrib
711
RUN cd /tmp

.devcontainer/devcontainer.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@
55
"features": {
66
"ghcr.io/devcontainers/features/desktop-lite:1": {}
77
},
8-
"forwardPorts": [3000, 5432, 6080],
8+
"forwardPorts": [5432, 6080],
99
"portsAttributes": {
10-
"3000": {
11-
"label": "Application",
12-
"onAutoForward": "silent"
13-
},
1410
"5432": {
1511
"label": "Database",
1612
"onAutoForward": "silent"
@@ -26,6 +22,8 @@
2622
"vscode": {
2723
"extensions": ["Shopify.ruby-extensions-pack"],
2824
"settings": {
25+
// This doesn't seem to work. Not sure if we actually
26+
// install+configure rvm.
2927
"rubyLsp.rubyVersionManager": {
3028
"identifier": "rvm"
3129
}

.devcontainer/docker-compose.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ services:
1616
command: sleep infinity
1717

1818
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
19+
# (Although we're not sure if our port forwarding is actually doing any good)
1920
network_mode: service:postgres
2021

2122
postgres:
@@ -27,9 +28,7 @@ services:
2728
POSTGRES_USER: postgres
2829
POSTGRES_DB: postgres
2930
POSTGRES_PASSWORD: postgres
30-
# Note that these ports are ignored by the devcontainer.
31-
# Instead, the ports are specified in .devcontainer/devcontainer.json.
32-
# ports:
33-
# - "5432:5432"
31+
ports:
32+
- "5432:5432" # For non-devcontainer local usage
3433
volumes:
3534
postgres-data:

.devcontainer/post-create.sh

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
RUBY_VERSION="$(cat .ruby-version | tr -d '\n')"
2-
31
# copy the file only if it doesn't already exist
42
echo "*** Creating initial .env and vscode settings, if needed"
53
cp -n .devcontainer/.env.codespaces .env
64
mkdir -p .vscode && cp -n .devcontainer/launch.json.codespaces .vscode/launch.json
75

8-
# If the project's required ruby version changes from 3.2.2, this command
9-
# will download and compile the correct version, but it will take a long time.
10-
if [ "$RUBY_VERSION" != "3.2.2" ]; then
11-
echo "*** Installing Ruby $RUBY_VERSION (this may take a while)"
12-
rvm install $RUBY_VERSION
13-
rvm use $RUBY_VERSION
14-
echo "Ruby $RUBY_VERSION installed"
15-
fi
16-
176
echo "*** Setting up node"
18-
nvm install node
7+
nvm install node &
198

209
echo "*** Setting up ruby environment"
21-
rbenv init bash
22-
rbenv init zsh
10+
rbenv init bash &
11+
rbenv init fish &
12+
rbenv init zsh &
2313

2414
# echo "*** Forcing platform version of nokogiri"
2515
# gem install nokogiri -v 1.18.1 --platform=ruby -- --use-system-libraries
2616

17+
# If the project's required ruby version (specified in .ruby-version)
18+
# changes from 3.4.3, this command will download and compile the correct
19+
# version, but it will take a long time.
20+
echo "*** Installing rbenv-able Ruby ***"
21+
rbenv install --skip-existing &
22+
23+
wait
24+
2725
echo "*** Running project bin/setup"
2826
bin/setup

.github/workflows/rspec-system.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
if: ${{ failure() }}
8787
uses: actions/upload-artifact@v4
8888
with:
89-
name: failed-browser-tests
89+
name: failed-browser-tests-${{ matrix.ci_node_index }}
9090
path: |
9191
tmp/screenshots
9292
tmp/capybara

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**

CONTRIBUTING.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,22 @@ You might also want to try VSCode with [this WSL extension](https://marketplace.
134134
```
135135
</details>
136136

137-
## Codespaces and Dev Container - EXPERIMENTAL 🛠️
137+
## One-click in-the-cloud env via Codespaces and Dev Container - EXPERIMENTAL 🛠️
138138

139-
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/rubyforgood/human-essentials/tree/main?quickstart=1)
140-
141-
[![Clone and open in VSCode Dev Container](https://img.shields.io/static/v1?label=Dev%20Containers&message=Clone%20and%20Open%20in%20VSCode&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/rubyforgood/human-essentials)
139+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/rubyforgood/human-essentials/tree/fix-devcontainers?quickstart=1)
142140

143141
1. Create the container:
144142
- To run the container on a Github VM, follow the Codespace link above. You can connect to the Codespace using VSCode or the VSCode web editor.
145143
- Or follow instructions to [create a new Codespace.](https://docs.github.com/en/codespaces/developing-in-a-codespace/creating-a-codespace-for-a-repository)
146144
- To clone this repo and run the container locally, follow instructions to [install VSCode and Docker](https://code.visualstudio.com/docs/devcontainers/containers). Click the Dev Container link above. Don't forget to add a git remote pointing to your fork once the container is setup and you want to push changes.
147145
2. Wait for the container to start. This will take a few (10-15) minutes since Ruby needs to be installed, the database needs to be created, and the `bin/setup` script needs to run
148-
3. Run `bin/start`. On the Ports tab, visit the forwarded port 3000 URL marked as Application to see the human essentials page.
149-
4. Login as a sample user with the default [credentials](#credentials).
146+
3. Run `bin/start`.
147+
4. On the Ports tab, visit the forwarded port 3000 URL marked as Application to see the human essentials page.
148+
5. Login as a sample user with the default [credentials](#credentials).
149+
150+
### Further experimental option—local dev container
151+
152+
[![Clone and open in VSCode Dev Container](https://img.shields.io/static/v1?label=Dev%20Containers&message=Clone%20and%20Open%20in%20VSCode&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/rubyforgood/human-essentials)
150153

151154
## Troubleshooting 👷🏼‍♀️
152155

Gemfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ end
1010
# User management and login workflow.
1111
gem "devise", '>= 4.7.1'
1212
# Postgres database adapter.
13-
gem "pg", "~> 1.5.9"
13+
gem "pg", "~> 1.6.1"
1414
# Web server.
1515
gem "puma"
1616
# Rails web framework.
@@ -51,7 +51,7 @@ gem "turbo-rails"
5151
# Sprinkle a little JS to add interactivity
5252
gem "stimulus-rails"
5353
# Use JS import maps to manage JS without transpiling or bundling.
54-
gem "importmap-rails", "~> 2.1"
54+
gem "importmap-rails", "~> 2.2"
5555

5656
##### VIEWS/CONTROLLERS #####
5757

@@ -61,6 +61,8 @@ gem "filterrific"
6161
gem "jbuilder"
6262
# Pagination of models for use in views.
6363
gem "kaminari"
64+
# Prevents cookie overflow errors when storing large flash messages.
65+
gem 'memflash'
6466
# Web-based authorization framework.
6567
gem "omniauth"
6668
# Required to avoid authentication issues with Rails.
@@ -92,6 +94,8 @@ gem "flipper-ui"
9294
gem "geocoder"
9395
# Generate .ics calendars for use with Google Calendar
9496
gem 'icalendar', require: false
97+
# Offers functionality for date reocccurances
98+
gem "ice_cube"
9599
# JSON Web Token encoding / decoding (e.g. for links in e-mails)
96100
gem "jwt"
97101
# Use Newrelic for logs and APM
@@ -147,7 +151,7 @@ group :development, :test do
147151
# Debugger which supports rdbg and Shopify Ruby LSP VSCode extension
148152
gem "debug", ">= 1.0.0"
149153
# RSpec behavioral testing framework for Rails.
150-
gem "rspec-rails", "~> 8.0.0"
154+
gem "rspec-rails", "~> 8.0.2"
151155
# Static analysis / linter.
152156
gem "rubocop"
153157
# Rails add-on for static analysis.
@@ -156,7 +160,7 @@ group :development, :test do
156160
# More concise test ("should") matchers
157161
gem "shoulda-matchers", "~> 6.5"
158162
# Default rules for Rubocop.
159-
gem "standard", "~> 1.40"
163+
gem "standard", "~> 1.50"
160164
gem "standard-rails"
161165
gem "standard-performance"
162166
# Erb linter.
@@ -204,7 +208,7 @@ group :test do
204208
# Show code coverage.
205209
gem 'simplecov'
206210
# Mock HTTP requests and ensure they are not called during tests.
207-
gem "webmock", "~> 3.25"
211+
gem "webmock", "~> 3.26"
208212
# Interface capybara to chrome headless
209213
gem "cuprite"
210214
# Read PDF files for tests

0 commit comments

Comments
 (0)