From d4d9fb46e665ffae548923c8cc78bae90dafc53a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 13:56:14 +0000 Subject: [PATCH 1/6] Add GitHub Copilot instructions file Co-authored-by: tagliala <556268+tagliala@users.noreply.github.com> --- .github/copilot-instructions.md | 117 ++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 00000000000..e3aa80b9a87 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,117 @@ +# Active Admin - GitHub Copilot Instructions + +## Project Overview + +Active Admin is a Ruby on Rails framework for creating elegant backends for website administration. It provides a DSL for developers to quickly create good-looking administration interfaces. + +## Technology Stack + +- **Backend**: Ruby on Rails (currently Rails ~> 8.1.0) +- **Frontend**: JavaScript (ES6+), Tailwind CSS, Flowbite +- **Testing**: RSpec (unit tests), Cucumber (feature tests), Capybara (integration tests) +- **Build Tools**: Rollup (JavaScript bundling), cssbundling-rails +- **Key Dependencies**: Devise (authentication), Ransack (search), Formtastic (forms), Kaminari (pagination) + +## Ruby Conventions + +- Target Ruby version: 3.2+ +- Target Rails version: 7.2+ +- Follow RuboCop style guide (configuration in `.rubocop.yml`) +- RuboCop plugins enabled: capybara, packaging, performance, rails, rspec +- Use frozen string literals: `# frozen_string_literal: true` at the top of Ruby files + +## JavaScript Conventions + +- Use ES6+ modern JavaScript syntax +- Follow ESLint configuration (see `eslint.config.js`) +- JavaScript source files are in `app/javascript/` +- Build JavaScript with: `npm run build` +- Lint JavaScript with: `npm run lint` + +## Testing Guidelines + +### Ruby Tests (RSpec) +- Unit tests are in `spec/unit/` +- Request specs are in `spec/requests/` +- Helper specs are in `spec/helpers/` +- Run RSpec tests: `bundle exec rspec` + +### Feature Tests (Cucumber) +- Cucumber features are in `features/` +- Uses Capybara with Cuprite (headless Chrome) +- Cucumber scenarios require Chrome to be installed +- Run Cucumber tests: `bundle exec cucumber` +- Lint Gherkin files: `npm run gherkin-lint` + +### Running All Tests +- Run the complete test suite: `bin/rake` +- Tests run against a sample Rails app generated in `tmp/test_apps/` + +## Building and Development + +### Setup +```bash +gem install foreman +bundle install +yarn install +``` + +### Testing Against Different Rails Versions +```bash +export BUNDLE_GEMFILE=gemfiles/rails_61/Gemfile +``` + +### Local Development Server +```bash +bin/rake local server +# Visit http://localhost:3000/admin +# Login: admin@example.com / password +``` + +### Other Local Commands +```bash +bin/rake local console # Rails console +bin/rake local db:migrate # Run migrations +``` + +## Code Organization + +- `lib/active_admin/` - Core framework code +- `app/` - Rails application components (controllers, helpers, views, assets) +- `spec/` - RSpec tests +- `features/` - Cucumber feature tests +- `docs/` - VitePress documentation (run with `npm run docs:dev`) + +## Important Guidelines + +1. **Minimal Changes**: Make surgical, precise changes. Don't refactor unrelated code. +2. **Backward Compatibility**: Active Admin is a widely-used gem. Maintain backward compatibility unless explicitly breaking changes are intended. +3. **Test Coverage**: Include tests for new features. Follow existing test patterns. +4. **Documentation**: Update documentation in `docs/` if adding user-facing features. +5. **Internationalization**: Support i18n - translation files are in `config/locales/` +6. **Security**: This is an authentication/authorization framework - be extra cautious with security implications. + +## Contributing Workflow + +1. Create feature request discussion before starting significant new features +2. Fork and create a descriptive branch +3. Ensure tests pass: `bin/rake` +4. View changes in browser: `bin/rake local server` +5. Submit pull request with passing CI + +## Release Process (Maintainers Only) + +1. Create feature branch from master +2. Run `bin/prep-release [version]` and commit +3. Merge PR +4. Run `bin/rake release` from master branch +5. Create GitHub Release from tag + +## Additional Context + +- This is both a Ruby gem and an npm package +- Published to RubyGems as `activeadmin` +- Published to npm as `@activeadmin/activeadmin` +- The project uses both Ruby and JavaScript tooling +- CI runs tests against multiple Rails versions +- Code coverage tracked with SimpleCov and CodeCov From 6a7057bc71642b7b972c56896f4025a91ef41ae3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 13:57:49 +0000 Subject: [PATCH 2/6] Fix inaccuracies in Copilot instructions based on code review Co-authored-by: tagliala <556268+tagliala@users.noreply.github.com> --- .github/copilot-instructions.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index e3aa80b9a87..fdf72906c47 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -14,8 +14,9 @@ Active Admin is a Ruby on Rails framework for creating elegant backends for webs ## Ruby Conventions -- Target Ruby version: 3.2+ -- Target Rails version: 7.2+ +- Minimum Ruby version: 3.2+ (required) +- Minimum Rails version: 7.2+ (required by gemspec) +- Current development uses Rails ~> 8.1.0 - Follow RuboCop style guide (configuration in `.rubocop.yml`) - RuboCop plugins enabled: capybara, packaging, performance, rails, rspec - Use frozen string literals: `# frozen_string_literal: true` at the top of Ruby files @@ -51,14 +52,16 @@ Active Admin is a Ruby on Rails framework for creating elegant backends for webs ### Setup ```bash -gem install foreman bundle install yarn install ``` +Note: The `bin/rake local server` command requires foreman, which it will invoke automatically. Install with `gem install foreman` if needed. + ### Testing Against Different Rails Versions ```bash -export BUNDLE_GEMFILE=gemfiles/rails_61/Gemfile +# Available versions: rails_72, rails_80 +export BUNDLE_GEMFILE=gemfiles/rails_72/Gemfile ``` ### Local Development Server From 942b3e20bffc56325550d809904e28726123571c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 14:07:02 +0000 Subject: [PATCH 3/6] Add RuboCop requirement to Copilot instructions Co-authored-by: tagliala <556268+tagliala@users.noreply.github.com> --- .github/copilot-instructions.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index fdf72906c47..a63839580ec 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -93,14 +93,16 @@ bin/rake local db:migrate # Run migrations 4. **Documentation**: Update documentation in `docs/` if adding user-facing features. 5. **Internationalization**: Support i18n - translation files are in `config/locales/` 6. **Security**: This is an authentication/authorization framework - be extra cautious with security implications. +7. **Code Quality**: Always run `bundle exec rubocop` before submitting any PR to ensure code follows project style guidelines. ## Contributing Workflow 1. Create feature request discussion before starting significant new features 2. Fork and create a descriptive branch 3. Ensure tests pass: `bin/rake` -4. View changes in browser: `bin/rake local server` -5. Submit pull request with passing CI +4. Run linting: `bundle exec rubocop` for Ruby code, `npm run lint` for JavaScript +5. View changes in browser: `bin/rake local server` +6. Submit pull request with passing CI ## Release Process (Maintainers Only) From e677974c267efe79d4de51e90cb0da9a1a679f00 Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Fri, 16 Jan 2026 10:13:43 +0100 Subject: [PATCH 4/6] Update .github/copilot-instructions.md Co-authored-by: Javier Julio --- .github/copilot-instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index a63839580ec..9e0e8c4aab6 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -92,7 +92,7 @@ bin/rake local db:migrate # Run migrations 3. **Test Coverage**: Include tests for new features. Follow existing test patterns. 4. **Documentation**: Update documentation in `docs/` if adding user-facing features. 5. **Internationalization**: Support i18n - translation files are in `config/locales/` -6. **Security**: This is an authentication/authorization framework - be extra cautious with security implications. +6. **Security**: This is an administration framework so be extra cautious with security implications. 7. **Code Quality**: Always run `bundle exec rubocop` before submitting any PR to ensure code follows project style guidelines. ## Contributing Workflow From a3d421d063548a13b3b1d8b72dd9552654d461e6 Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Fri, 16 Jan 2026 10:13:49 +0100 Subject: [PATCH 5/6] Update .github/copilot-instructions.md Co-authored-by: Javier Julio --- .github/copilot-instructions.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 9e0e8c4aab6..4efe384bf15 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -104,14 +104,6 @@ bin/rake local db:migrate # Run migrations 5. View changes in browser: `bin/rake local server` 6. Submit pull request with passing CI -## Release Process (Maintainers Only) - -1. Create feature branch from master -2. Run `bin/prep-release [version]` and commit -3. Merge PR -4. Run `bin/rake release` from master branch -5. Create GitHub Release from tag - ## Additional Context - This is both a Ruby gem and an npm package From 27fbdc3780dfd022cc9fc46ac1395b7cdb185dd7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 16 Jan 2026 09:16:51 +0000 Subject: [PATCH 6/6] Prefer RSpec specs over Cucumber features in test guidelines Co-authored-by: tagliala <556268+tagliala@users.noreply.github.com> --- .github/copilot-instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 4efe384bf15..52f5a5677bd 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -89,7 +89,7 @@ bin/rake local db:migrate # Run migrations 1. **Minimal Changes**: Make surgical, precise changes. Don't refactor unrelated code. 2. **Backward Compatibility**: Active Admin is a widely-used gem. Maintain backward compatibility unless explicitly breaking changes are intended. -3. **Test Coverage**: Include tests for new features. Follow existing test patterns. +3. **Test Coverage**: Include tests for new features. Prefer RSpec specs (especially request specs) over Cucumber features when possible, as specs are easier to work with and maintain. 4. **Documentation**: Update documentation in `docs/` if adding user-facing features. 5. **Internationalization**: Support i18n - translation files are in `config/locales/` 6. **Security**: This is an administration framework so be extra cautious with security implications.