Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
71b72a4
Upgrade Ruby to 3.1.7
warp May 5, 2026
752d75b
Fix CircleCI PostgreSQL client install
warp May 5, 2026
e3d46e0
Fix index_exists? calls under Ruby 3
warp May 5, 2026
062880b
Fix Psych and I18n keyword-arg errors
warp May 5, 2026
ed8626e
Migrate from state_machine to state_machines-activerecord
warp May 5, 2026
cf3610e
Fix keyword-arg usage in TwilioService and package specs
warp May 5, 2026
1573998
Fix Ruby 3 keyword arg compat for token and builders
warp May 5, 2026
dc41904
Fix shareable offers spec ordering
warp May 5, 2026
7461bbc
Fix remaining spec flakes and param handling
warp May 5, 2026
7c9f20b
Fix test helpers and Procfile portability
warp May 5, 2026
08b0804
Fix potential error on chained scope when search text is blank
warp May 5, 2026
f7f2b63
Stabilize shareables pagination and fix message subscriptions spec
warp May 5, 2026
d767df5
Harden browseable package search specs with unique tokens
warp May 5, 2026
c9bf539
Upgrade Ruby to 3.4.9
warp May 5, 2026
3bba855
Upgrade Rails to 8.1
warp May 5, 2026
5332c81
Fix boot and cache key compatibility for Rails 8.1
warp May 5, 2026
021843b
Add csv gem for Ruby 3.4 stdlib split
warp May 5, 2026
64d2bf9
Fix order code generation and AutoFavourite reflections for Rails 8
warp May 5, 2026
bae7376
Define Application#secrets for Rails 8 compatibility
warp May 5, 2026
7b9c5d6
Fix stocktake revisions association and processing reliability
warp May 5, 2026
14636b4
Send internal mail via ApplicationMailer instead of ActionMailer::Bas…
warp May 5, 2026
4d0bc10
Skip fuzzy SIMILARITY scope when search text is blank
warp May 5, 2026
7710929
Upgrade active_record_union to 1.4 for Rails 8
warp May 5, 2026
2ce4454
Adjust model specs for PostgreSQL timestamptz column types
warp May 5, 2026
5f1f3ba
Scope inventory count expectations to records under test
warp May 5, 2026
14bf497
Stabilize orders and packages controller specs
warp May 5, 2026
afcec57
Isolate inventory number examples with truncate and explicit uniqueness
warp May 5, 2026
20062e9
Remove after(:suite) cleanup that destroyed system user
warp May 5, 2026
1c1389a
Relax Package not-found message expectation for Rails 8
warp May 5, 2026
7af680b
Bump cucumber to 10.2 for Ruby 3.4 compatibility
warp May 5, 2026
80905f8
Pin gem minimums and refresh bundle
warp May 5, 2026
644865e
Fix TwilioJob enqueue to pass one Hash to perform
warp May 5, 2026
dd7d9b9
Fix migration tooling for Rails 8 and Ruby 3.4
warp May 6, 2026
1a3ce62
Normalize Gogovan booking params and scheduled_date parsing
warp May 6, 2026
7e6b213
Stabilize specs against seeded data and factory behavior
warp May 6, 2026
e7d0386
Bind times in SubscriptionsReminder SQL instead of ISO8601 strings
warp May 6, 2026
0f1e5c3
Use ActiveJob test adapter in test env and reset queues each example
warp May 6, 2026
3867dfc
Remove per-example ActiveJob adapter switching from job specs
warp May 6, 2026
61fa61c
Replace deprecated Time#to_s(:db) for Ruby 3.4 compatibility
warp May 6, 2026
65ce8be
Default package saleable from offer only when attribute is unset
warp May 6, 2026
5596a3b
Align specs with Ruby 3.4 and multi-request responses
warp May 6, 2026
2c17baf
Derive confirm_delivery schedule date from get_hash without inner permit
warp May 6, 2026
e4d0269
Stabilize appointment_slots calendar specs for 2018 fixtures
warp May 6, 2026
e86ff0e
Fix deliveries holiday validation and stabilize flaky specs
warp May 6, 2026
e8d1b7c
Fix flaky specs and confirm_delivery schedule validation
warp May 6, 2026
723040d
Stabilize appointment slot and orders due-date specs
warp May 6, 2026
bc3e668
Improve spec isolation for slots, deliveries, and transactions
warp May 6, 2026
15537fd
Only use numeric codes in InventoryNumber gap queries
warp May 6, 2026
1d6ae28
Stabilize public holiday setup in deliveries confirm_delivery spec
warp May 6, 2026
83ef336
Stabilize appointment slots calendar specs against suite data
warp May 6, 2026
119b22d
Make order/org/package_type specs resilient to suite data
warp May 6, 2026
0932061
CI: use separate test DB per parallel RSpec container
warp May 6, 2026
1ddbf9d
Simplify appointment slots calendar spec setup
warp May 6, 2026
93c4756
Stabilize deliveries holiday confirm_delivery example on full CI suite
warp May 6, 2026
f8f129d
Fix Order priority rules specs: Timecop.return and awaiting_dispatch …
warp May 6, 2026
8db3255
Stabilize appointment slots calendar specs for CI
warp May 6, 2026
6e38439
CI: db:reset after Cucumber; harden seeds for Psych and re-seeding
warp May 6, 2026
65bb152
CI: recreate test DB between Cucumber and RSpec
warp May 6, 2026
5501944
CI: reload test DB from schema between Cucumber and RSpec
warp May 6, 2026
33e08ed
Fix HKT date bucketing for appointment slots and holidays
warp May 6, 2026
98135c5
Fix UserSafeDeleteJob spec for non-existent user id
warp May 6, 2026
5885641
Stabilize PackagesController specs for full suite
warp May 6, 2026
ece872e
Tighten Order timestamp column specs
warp May 6, 2026
744f686
CI: upgrade Postgres to 14.20
warp May 6, 2026
0469d7a
Use bundler 2.6.9
warp May 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ orbs:

defaults: &defaults
docker:
- image: cimg/ruby:2.7.3
- image: cimg/ruby:3.4.9
working_directory: ~/api.goodcity

jobs:
Expand All @@ -40,7 +40,7 @@ jobs:
<<: *defaults
steps:
- run: mkdir -p ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
- run: gem install bundler:2.2.27
- run: gem install bundler:2.6.9
- restore_cache:
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache: *restore-bundler-cache
Expand All @@ -50,43 +50,55 @@ jobs:
test:
<<: *defaults
docker:
- image: cimg/ruby:2.7.3-browsers
- image: cimg/ruby:3.4.9-browsers
- image: cimg/redis:6.0
- image: cimg/postgres:9.6
- image: cimg/postgres:14.20
environment:
POSTGRES_USER: postgres
POSTGRES_DB: goodcity_server_test
parallelism: 3
environment:
RAILS_ENV: test
DATABASE_URL: "postgres://postgres@localhost:5432/goodcity_server_test"
# Parallel containers share one Postgres service — each node MUST use its own database or
# transactional specs race on delete_all / factories (flaky appointment_slots, orders, etc.).
# DATABASE_URL is set in each DB-using step via CIRCLE_NODE_INDEX.
steps:
- run: sudo apt update && sudo apt -y upgrade libu2f-udev
- browser-tools/install-browser-tools
- run:
name: Install PostgreSQL Client (required to run migrations)
command: |
sudo sh -c 'echo "deb https://apt-archive.postgresql.org/pub/repos/apt `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update
sudo apt-get install postgresql-client-9.6
sudo apt-get install -y postgresql-client
- attach_workspace:
at: ~/api.goodcity/tmp
- restore_cache:
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache: *restore-bundler-cache
- run: gem install bundler:2.2.27 && bundle config set --local deployment 'true' && (bundle check || bundle install --jobs=2 --retry=3)
- run: gem install bundler:2.6.9 && bundle config set --local deployment 'true' && (bundle check || bundle install --jobs=2 --retry=3)
- run:
name: Wait for DB and Redis containers to start
command: dockerize -wait tcp://localhost:5432 -wait tcp://localhost:6379 -timeout 1m
- run: bundle exec rails db:create:all db:migrate
- run:
name: Setup test database (per parallel container)
command: |
export DATABASE_URL="postgres://postgres@localhost:5432/goodcity_server_test_${CIRCLE_NODE_INDEX:-0}"
bundle exec rails db:create db:migrate
- run:
name: Cucumber tests
command: |
export DATABASE_URL="postgres://postgres@localhost:5432/goodcity_server_test_${CIRCLE_NODE_INDEX:-0}"
bundle exec cucumber
- run:
name: Recreate test database after Cucumber
command: |
export DATABASE_URL="postgres://postgres@localhost:5432/goodcity_server_test_${CIRCLE_NODE_INDEX:-0}"
bundle exec rails db:drop db:create db:schema:load
- run:
name: Rspec tests
command: |
export DATABASE_URL="postgres://postgres@localhost:5432/goodcity_server_test_${CIRCLE_NODE_INDEX:-0}"
mkdir -p ~/rspec
bundle exec rspec --format progress \
--format RspecJunitFormatter \
--out ~/rspec/rspec.xml \
Expand All @@ -108,7 +120,7 @@ jobs:
- restore_cache:
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache: *restore-bundler-cache
- run: gem install bundler:2.2.27 && bundle config set --local deployment 'true' && (bundle check || bundle install --jobs=2 --retry=3)
- run: gem install bundler:2.6.9 && bundle config set --local deployment 'true' && (bundle check || bundle install --jobs=2 --retry=3)
- run: |
STAGE=$(if [ "$CIRCLE_BRANCH" == "live" ]; then echo production; else echo staging; fi)
bundle exec cap ${STAGE} deploy
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.7.3
ruby-3.4.9
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.7.3-alpine
FROM ruby:3.4.9-alpine

ARG GITHUB_TOKEN

Expand Down
25 changes: 18 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
# frozen_string_literal: true

source 'https://rubygems.org'
ruby '2.7.3'
ruby '3.4.9'

gem 'pg'
gem 'rails', '~> 6.1.4'
gem 'rails', '~> 8.1', '>= 8.1.3'
gem 'rake'

# Required because `config/application.rb` loads `sprockets/railtie`
gem 'sprockets-rails'

# Ruby 3.4: stdlib gem needed by ActiveSupport 6.1
gem 'mutex_m', require: false
# Ruby 3.4: stdlib gem needed by ActiveSupport 6.1
gem 'drb', require: false

gem 'active_model_otp'
gem 'active_model_serializers', '~> 0.8.0'
gem 'active_record_union'
gem 'active_record_union', '~> 1.4'
gem 'apipie-rails', git: "https://github.com/Apipie/apipie-rails.git", ref: "a55d836"
gem 'bootsnap', require: false
gem 'by_star'
gem 'cancancan'
gem 'cloudinary'
gem 'csv'
gem 'dotenv-rails'
gem 'easyzpl', git: 'https://github.com/crossroads/easyzpl.git'
gem 'factory_bot_rails' # used in rake db:seed in production
Expand All @@ -31,13 +40,13 @@ gem 'nestful'
gem 'newrelic_rpm'
gem 'nokogiri'
gem 'oj'
gem 'paper_trail'
gem 'paper_trail', '>= 17.0.0'
gem 'paranoia'
gem 'puma'
gem 'rack-cors', require: 'rack/cors'
gem 'rack-protection'
gem 'rack-timeout', require: 'rack/timeout/base'
gem 'rails-i18n'
gem 'rails-i18n', '~> 8.1', '>= 8.1.0'
gem 'rake-progressbar'
gem 'redis' # Used for Rails cache_store
gem 'request_store'
Expand All @@ -47,7 +56,7 @@ gem 'rotp'
gem 'rubyXL'
gem 'sidekiq', '<8'
gem 'sidekiq-scheduler'
gem 'state_machine'
gem 'state_machines-activerecord', '~> 0.9.0'
gem 'traco'
gem 'twilio-ruby'
gem 'whenever', require: false
Expand Down Expand Up @@ -84,7 +93,9 @@ group :development, :test do
end

group :test do
gem 'cucumber-rails', require: false
# Cucumber < 9 raises ArgumentError on Ruby 3.4 (DataTable / Struct keywords).
gem 'cucumber', '~> 10.2'
gem 'cucumber-rails', '>= 4.0.1', require: false
gem 'database_cleaner'
gem 'email_spec'
gem 'rails-controller-testing'
Expand Down
Loading