diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 097cae4..4f12633 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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: | @@ -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() @@ -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 }} \ No newline at end of file + SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} diff --git a/Gemfile b/Gemfile index 0f140f1..fd8b509 100644 --- a/Gemfile +++ b/Gemfile @@ -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' @@ -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 diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb deleted file mode 100644 index d672697..0000000 --- a/app/channels/application_cable/channel.rb +++ /dev/null @@ -1,4 +0,0 @@ -module ApplicationCable - class Channel < ActionCable::Channel::Base - end -end diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb deleted file mode 100644 index 0ff5442..0000000 --- a/app/channels/application_cable/connection.rb +++ /dev/null @@ -1,4 +0,0 @@ -module ApplicationCable - class Connection < ActionCable::Connection::Base - end -end diff --git a/app/models/application_record.rb b/app/models/application_record.rb deleted file mode 100644 index b63caeb..0000000 --- a/app/models/application_record.rb +++ /dev/null @@ -1,3 +0,0 @@ -class ApplicationRecord < ActiveRecord::Base - primary_abstract_class -end diff --git a/config/application.rb b/config/application.rb index c7d8ab0..2375031 100644 --- a/config/application.rb +++ b/config/application.rb @@ -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. diff --git a/config/database.yml b/config/database.yml index 796466b..d6fa123 100644 --- a/config/database.yml +++ b/config/database.yml @@ -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 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 diff --git a/config/environments/development.rb b/config/environments/development.rb index 2e7fb48..ec4ea63 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -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 @@ -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 diff --git a/config/environments/production.rb b/config/environments/production.rb index 7c4ef8f..4405914 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -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" @@ -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 @@ -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 = [ diff --git a/config/environments/test.rb b/config/environments/test.rb index adbb4a6..98f5b1f 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -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 diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb deleted file mode 100644 index 2eeef96..0000000 --- a/config/initializers/assets.rb +++ /dev/null @@ -1,12 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Version of your assets, change this if you want to expire all your assets. -Rails.application.config.assets.version = "1.0" - -# Add additional assets to the asset load path. -# Rails.application.config.assets.paths << Emoji.images_path - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in the app/assets -# folder are already added. -# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index ba57c54..4e599d2 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -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