feat(build): replace .flashignore with built-in ignore patterns#220
feat(build): replace .flashignore with built-in ignore patterns#220
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request replaces the .flashignore file mechanism with built-in ignore patterns for Flash builds. The change simplifies project structure by eliminating the need for a separate Flash-specific ignore file, instead relying on a combination of .gitignore patterns and opinionated built-in exclusions.
Changes:
- Replaced
.flashignorefile loading with built-in ignore patterns covering tests, docs, build artifacts, IDE files, and virtual environments - Added deprecation warning to guide users with existing
.flashignorefiles to migrate custom patterns - Updated all tests, documentation, and scripts to remove references to
.flashignore
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/runpod_flash/cli/utils/ignore.py | Replaced .flashignore loading with built-in patterns and added deprecation warning |
| tests/unit/cli/utils/test_ignore.py | Added 20 comprehensive tests for all built-in patterns and deprecation behavior |
| tests/unit/test_skeleton.py | Removed .flashignore from skeleton creation tests |
| tests/unit/cli/commands/build_utils/test_scanner.py | Renamed test_module.py to worker_module.py to avoid test_*.py exclusion |
| tests/integration/test_lb_remote_execution.py | Renamed test_api.py to api_worker.py to avoid test_*.py exclusion |
| src/runpod_flash/cli/utils/skeleton_template/.flashignore | Deleted template file |
| src/runpod_flash/cli/commands/build_utils/scanner.py | Updated comment to remove .flashignore reference |
| scripts/validate-wheel.sh | Removed .flashignore from wheel validation checks |
| TESTING.md | Removed .flashignore reference from documentation |
| README.md | Removed .flashignore from project structure and troubleshooting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e831dc6 to
5eb1f97
Compare
QA ReportStatus: PASS Targeted Test Results
Ignore Pattern AnalysisBuilt-in patterns cover:
Comparison with old .flashignore template: Missing patterns (minor, not blocking):
These are non-blocking since users can add custom patterns to .gitignore. Backward compatibility with existing .flashignore:
Full Suite ResultsParallel (-n 4, non-serial): 1270 passed, 2 failed, 2 warnings All 12 failures are pre-existing on main (confirmed by running same tests against main branch):
No regressions introduced by this PR. PR Diff AnalysisFiles changed (10):
Code quality: Clean, well-structured. The test renames from test_module.py to worker_module.py are a necessary consequence of the new test_*.py exclusion pattern and demonstrate the author correctly identified the impact. No stale references: Searched entire codebase for "flashignore" -- only the deprecation warning code and its test remain. No references in pyproject.toml or other config files. RecommendationMERGE -- Clean removal of .flashignore with comprehensive built-in defaults, proper deprecation warning for existing users, thorough test coverage (20 new tests), and no regressions. The scanner test fixture renames show careful attention to the cascading effects of the new test_*.py exclusion pattern. Generated by flash-qa agent |
8b2bf9c to
72feb2c
Compare
runpod-Henrik
left a comment
There was a problem hiding this comment.
Code Review — PR #220: Replace .flashignore with built-in patterns
Good cleanup. One issue:
Bug 1 (MEDIUM): Custom .flashignore patterns silently dropped
ignore.py — load_ignore_patterns()
flashignore = project_dir / ".flashignore"
if flashignore.exists():
log.warning(
".flashignore is no longer supported; "
"patterns are now built-in. "
"Move any custom patterns to .gitignore and delete .flashignore."
)
# NOTE: patterns from .flashignore are NOT loadedThe warning is log.warning() — only visible if logging is configured at WARNING level. Default CLI log level is typically ERROR/INFO for user output. If a user had custom patterns (e.g., excluding a large data/ dir or proprietary files), their next flash build will silently include those files, making the build artifact much larger or including sensitive data.
Fix: Either (a) still load .flashignore patterns when the file exists (with the deprecation warning), or (b) print to console.print() / stderr so it's always visible:
if flashignore.exists():
console.print("[yellow]warning:[/yellow] .flashignore is deprecated...")
# still load patterns for one more version
patterns.extend(parse_ignore_file(flashignore))Otherwise LGTM. The built-in pattern list covers all the same patterns that were in the old .flashignore template, plus the !README.md negation is handled correctly.
082d221 to
0faccfc
Compare
0faccfc to
00d1589
Compare
runpod-Henrik
left a comment
There was a problem hiding this comment.
What changed: flash build no longer reads .flashignore. Built-in patterns now automatically exclude tests, docs, markdown, env files, and IDE directories. Users with an existing .flashignore get a warning to migrate custom patterns to .gitignore.
Tests run against the PR branch (deanq/ae-2256-no-more-flashignore) using a worktree + flash build --no-deps on real project structures.
What works
- All built-in exclusions apply correctly:
tests/,test_*.py,*_test.py,docs/,*.md,.env,.vscode/,.idea/,dist/,build/,*.egg-info/ README.mdis kept while all other.mdfiles are excluded.gitignorepatterns are still respected- The
.flashignoredeprecation warning is visible at the CLI level — it appears in log output duringflash build
What doesn't work
A worker file named test_*.py produces a silent broken build.
flash build on a project with only test_auth.py as the worker completes with exit 0, reports "1 file, 0 deps", and produces an artifact with an empty manifest:
{
"resources": {},
"function_registry": {}
}No error. No warning. The endpoint deploys with no worker code. A user discovers this at runtime.
There is no escape hatch. Adding !test_auth.py to .gitignore does not override the built-in exclusion — the built-in test_*.py pattern is appended after gitignore patterns, so it always wins. Renaming the file is the only fix.
Custom .flashignore patterns are silently dropped. Patterns like secrets/ or large_data/ that aren't in the built-ins are no longer applied — those files now appear in the build artifact. The deprecation warning fires, but there's no build failure to force the user to act.
Not tested
flash deployend-to-end (requires live API)- Multi-file projects where only some workers are named
test_*.py
Verdict: The silent broken build when a worker is named test_*.py is a blocking issue. The build should either error when no endpoints are found after scanning, or warn when files containing @Endpoint decorators are excluded by ignore patterns. The custom .flashignore pattern drop is a migration risk but lower severity since the warning is visible.
7b1f2a2 to
41f3d21
Compare
- Add built-in ignore patterns to ignore.py including .gitignore - Remove skeleton_template/.flashignore - Update scanner and tests for new ignore behavior
41f3d21 to
270d41b
Compare
|
📝 Documentation updates detected! New suggestion: Update Flash docs for .flashignore deprecation and built-in ignore patterns Tip: Tell your friends working on non-commercial open-source projects to apply for free Promptless access at promptless.ai/oss ❤️ |
Summary
.flashignorefile loading with built-in ignore patterns inignore.pycovering tests, docs, build artifacts, IDE files, and virtual environments.flashignorefile, guiding them to migrate custom patterns to.gitignore.flashignorefrom skeleton template, documentation, and wheel validation scriptTest plan
tests/unit/cli/utils/test_ignore.pycovering all built-in patterns, deprecation warning, edge casestest_module.py->worker_module.pyto avoid built-intest_*.pyexclusion)make quality-checkpasses (1222 tests, 73% coverage, clean lint)flash buildexcludes tests/docs without needing.flashignore.flashignoreexists in project