Commit 37f5894
Security and reliability improvements for CI debugging tools (#2024)
## Summary
This PR addresses the security and reliability improvements outlined in
issue #1975.
## Changes Made
### High Priority - Security
- **Remove eval from bin/ci-rerun-failures**
- Replaced `eval` usage with a safe `run_command()` function using case
statement
- Commands are now explicitly defined in case branches, eliminating
potential injection risks
- Maintains same functionality while being more maintainable and secure
### Medium Priority - Documentation
- **Document Ruby version requirement in bin/ci-switch-config**
- Added comment explaining that script/convert uses current Ruby in PATH
- Documents that version manager may not have reloaded yet
- Specifies Ruby 2.6+ compatibility requirement
### Low Priority - Reliability
- **Add bounds check for array access in bin/ci-run-failed-specs**
- Added defensive check before accessing UNIQUE_SPECS[0]
- Prevents potential errors if array is empty
- **Improve git restore error handling in bin/ci-switch-config**
- Replaced silent failure (2>/dev/null || true) with explicit warning
- Users now see a clear message if files cannot be restored
- Differentiates between success and partial failure
## Testing
- All scripts validated with `bash -n` for syntax errors
- RuboCop linting passed with zero offenses
- Code formatted with Prettier
Fixes #1975
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg"
height="34" align="absmiddle"
alt="Reviewable"/>](https://reviewable.io/reviews/shakacode/react_on_rails/2024)
<!-- Reviewable:end -->
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3fe5033 commit 37f5894
3 files changed
+48
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
185 | 211 | | |
186 | 212 | | |
187 | 213 | | |
| |||
236 | 262 | | |
237 | 263 | | |
238 | 264 | | |
239 | | - | |
240 | | - | |
| 265 | + | |
| 266 | + | |
241 | 267 | | |
242 | | - | |
| 268 | + | |
243 | 269 | | |
244 | 270 | | |
245 | 271 | | |
| |||
270 | 296 | | |
271 | 297 | | |
272 | 298 | | |
273 | | - | |
274 | | - | |
| 299 | + | |
| 300 | + | |
275 | 301 | | |
276 | 302 | | |
277 | 303 | | |
278 | | - | |
279 | 304 | | |
280 | 305 | | |
281 | | - | |
282 | | - | |
283 | | - | |
| 306 | + | |
284 | 307 | | |
285 | 308 | | |
286 | 309 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
258 | 261 | | |
259 | 262 | | |
260 | 263 | | |
| |||
395 | 398 | | |
396 | 399 | | |
397 | 400 | | |
398 | | - | |
399 | | - | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
400 | 406 | | |
401 | 407 | | |
402 | 408 | | |
| |||
0 commit comments