Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 2 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
DB_CONN_STR: ${{ vars.DB_CONN_STR }}
DB_USERNAME: ${{ vars.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
CI: true

steps:
- name: Checkout code
Expand Down Expand Up @@ -48,10 +49,6 @@ jobs:
fi

echo "✓ All Couchbase environment variables are configured"
env:
DB_CONN_STR: ${{ vars.DB_CONN_STR }}
DB_USERNAME: ${{ vars.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}

- name: Test Couchbase Connection
run: |
Expand All @@ -70,22 +67,12 @@ jobs:
exit 1
end
'
env:
DB_CONN_STR: ${{ vars.DB_CONN_STR }}
DB_USERNAME: ${{ vars.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
CI: true

- name: Run integration tests
run: bundle exec rspec spec/requests/api/v1

- name: Verify Swagger documentation generates
run: bundle exec rake rswag:specs:swaggerize
env:
DB_CONN_STR: ${{ vars.DB_CONN_STR }}
DB_USERNAME: ${{ vars.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
CI: true

- name: Report Status
if: always()
Expand All @@ -97,4 +84,4 @@ jobs:
message_format: "{emoji} *{status_message}* in <{repo_url}|{repo}@{branch}> on <{commit_url}|{commit_sha}>"
footer: "<{run_url}|View Full Run on GitHub>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
19 changes: 1 addition & 18 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,9 @@ ruby '3.4.1'
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem 'rails', '~> 7.1.3', '>= 7.1.3.2'

# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem 'sprockets-rails'

# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.4'

# Use the Puma web server [https://github.com/puma/puma]
gem 'puma', '>= 5.0'

# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
gem 'importmap-rails'

# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
gem 'turbo-rails'

# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
gem 'stimulus-rails'

# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem 'jbuilder'

Expand Down Expand Up @@ -62,7 +47,5 @@ group :development do
end

group :test do
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
gem 'capybara'
gem 'selenium-webdriver'
# API-only testing with RSpec (no system/browser testing needed)
end
4 changes: 0 additions & 4 deletions app/channels/application_cable/channel.rb

This file was deleted.

4 changes: 0 additions & 4 deletions app/channels/application_cable/connection.rb

This file was deleted.

3 changes: 0 additions & 3 deletions app/models/application_record.rb

This file was deleted.

19 changes: 18 additions & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
require_relative 'boot'

require 'rails/all'
# Load Rails components individually (excluding activerecord since we use Couchbase directly)
require 'rails'
%w(
action_controller
action_view
action_mailer
active_job
).each do |framework|
begin
require "#{framework}/railtie"
rescue LoadError
end
end

# Excluded components (using Couchbase directly via SDK):
# - active_record/railtie - Using Couchbase SDK directly
# - active_storage/engine - Not needed for API-only app
# - action_cable/railtie - Not using WebSockets

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Expand Down
22 changes: 8 additions & 14 deletions config/database.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
# SQLite. Versions 3.8.0 and up are supported.
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem "sqlite3"
# NOTE: This file is not used by the application.
# This application uses Couchbase as its database through the Couchbase Ruby SDK.
# Database connections are configured in config/initializers/couchbase.rb
#
# The configuration below is kept for Rails compatibility but is not actively used.
# No SQL database (SQLite, PostgreSQL, MySQL) is required for this application.

# Minimal configuration to prevent Rails from attempting database connections
default: &default
adapter: sqlite3
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
adapter: nulldb

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The nulldb adapter is not a standard Rails adapter and requires the activerecord-nulldb-adapter gem, which is not present in the Gemfile. While this doesn't cause an issue now because active_record/railtie is not loaded, it could lead to errors if ActiveRecord is re-enabled in the future.

The comment on line 8 is also slightly misleading; the removal of the ActiveRecord railtie is what prevents Rails from attempting a database connection. Since this file is documented as unused, it's best to remove this line to avoid any future confusion.


development:
<<: *default
database: storage/development.sqlite3

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: storage/test.sqlite3

production:
<<: *default
database: storage/production.sqlite3
8 changes: 4 additions & 4 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
end

# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local
# config.active_storage.service = :local # Commented out - not using ActiveStorage

# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
Expand All @@ -51,16 +51,16 @@
config.active_support.disallowed_deprecation_warnings = []

# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# config.active_record.migration_error = :page_load # Commented out - not using ActiveRecord

# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true
# config.active_record.verbose_query_logs = true # Commented out - not using ActiveRecord

# Highlight code that enqueued background job in logs.
config.active_job.verbose_enqueue_logs = true

# Suppress logger output for asset requests.
config.assets.quiet = true
# config.assets.quiet = true # Commented out - not using asset pipeline

# Raises error for missing translations.
# config.i18n.raise_on_missing_translations = true
Expand Down
6 changes: 3 additions & 3 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# config.assets.css_compressor = :sass

# Do not fall back to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# config.assets.compile = false # Commented out - not using asset pipeline

# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.asset_host = "http://assets.example.com"
Expand All @@ -37,7 +37,7 @@
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX

# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local
# config.active_storage.service = :local # Commented out - not using ActiveStorage

# Mount Action Cable outside main process or domain.
# config.action_cable.mount_path = nil
Expand Down Expand Up @@ -85,7 +85,7 @@
config.active_support.report_deprecations = false

# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
# config.active_record.dump_schema_after_migration = false # Commented out - not using ActiveRecord

# Enable DNS rebinding protection and other `Host` header attacks.
# config.hosts = [
Expand Down
2 changes: 1 addition & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
config.action_controller.allow_forgery_protection = false

# Store uploaded files on the local file system in a temporary directory.
config.active_storage.service = :test
# config.active_storage.service = :test # Commented out - not using ActiveStorage

config.action_mailer.perform_caching = false

Expand Down
12 changes: 0 additions & 12 deletions config/initializers/assets.rb

This file was deleted.

23 changes: 13 additions & 10 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,27 @@

# Checks for pending migrations and applies them before tests are run.
# If you are not using ActiveRecord, you can remove these lines.
begin
ActiveRecord::Migration.maintain_test_schema!
rescue ActiveRecord::PendingMigrationError => e
abort e.to_s.strip
end
# NOTE: Commented out - this application uses Couchbase directly, not ActiveRecord with SQL database
# begin
# ActiveRecord::Migration.maintain_test_schema!
# rescue ActiveRecord::PendingMigrationError => e
# abort e.to_s.strip
# end
RSpec.configure do |config|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_paths = [
Rails.root.join('spec/fixtures')
]
# NOTE: Commented out - this application uses Couchbase directly, not ActiveRecord
# config.fixture_paths = [
# Rails.root.join('spec/fixtures')
# ]

# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
config.use_transactional_fixtures = true
# NOTE: Commented out - this application uses Couchbase directly, not ActiveRecord
# config.use_transactional_fixtures = true

# You can uncomment this line to turn off ActiveRecord support entirely.
# config.use_active_record = false
config.use_active_record = false

# RSpec Rails can automatically mix in different behaviours to your tests
# based on their file location, for example enabling you to call `get` and
Expand Down