You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,19 @@ This repository contains the **Better Together Community Engine** (an isolated R
92
92
93
93
## Coding Guidelines
94
94
95
+
### Debugging and Development Practices
96
+
- **Never use Rails console or runner for debugging** - These commands don't support our test-driven development approach
97
+
- **Debug through comprehensive tests**: Write detailed test scenarios to reproduce, understand, and verify fixes for issues
98
+
- **Use test-driven debugging workflow**:
99
+
- Create specific tests that reproduce the problematic behavior
100
+
- Add debugging assertions in tests to verify intermediate state
101
+
- Trace through code by reading files and using grep search
102
+
- Validate fixes by ensuring tests pass
103
+
- **Leverage RSpec debugging tools**: Use `--format documentation` for detailed output, `fit` for focused testing, `puts` for temporary debug output in tests
104
+
- **Analyze logs and error messages**: Examine Rails logs, test output, and stack traces for debugging information
105
+
- **Read code systematically**: Use file reading tools to understand code paths and data flow
106
+
- **Temporary debug output**: Add debug statements in application code if needed, but remove before committing
107
+
95
108
### Docker Environment Usage
96
109
- **All database-dependent commands must use `bin/dc-run`**: This includes tests, generators, and any command that connects to PostgreSQL, Redis, or Elasticsearch
97
110
- **Dummy app commands use `bin/dc-run-dummy`**: For Rails commands that need the dummy app context (console, migrations specific to dummy app)
@@ -102,10 +115,11 @@ This repository contains the **Better Together Community Engine** (an isolated R
102
115
- RuboCop: `bin/dc-run bundle exec rubocop`
103
116
- **IMPORTANT**: Never use `rspec -v` - this displays version info, not verbose output. Use `--format documentation` for detailed output.
104
117
- **Examples of commands requiring `bin/dc-run-dummy`**:
105
-
- Rails console: `bin/dc-run-dummy rails console`
118
+
- Rails console: `bin/dc-run-dummy rails console` (for administrative tasks only, NOT for debugging)
@@ -29,7 +40,7 @@ Instructions for GitHub Copilot and other automated contributors working in this
29
40
- Multiple specific lines: `bin/dc-run bundle exec rspec spec/file1_spec.rb:123 spec/file2_spec.rb:456`
30
41
-**Important**: RSpec does NOT support hyphenated line numbers (e.g., `spec/file_spec.rb:123-456` is INVALID)
31
42
-**Do NOT use `-v` flag**: The `-v` flag displays RSpec version information, NOT verbose output. Use `--format documentation` for detailed test descriptions.
32
-
-**Rails Console:**`bin/dc-run-dummy rails console` (runs console in the dummy app context)
43
+
-**Rails Console:**`bin/dc-run-dummy rails console` (for administrative tasks only - NOT for debugging. Use comprehensive tests for debugging instead)
33
44
-**Rails Commands in Dummy App:**`bin/dc-run-dummy rails [command]` for any Rails commands that need the dummy app environment
0 commit comments