feat: add startcollector management command for new collectors#226
Conversation
… guide Introduce `startcollector` to generate new collector apps (models, services, management command, tests, schedule snippet) with CI validation via validate_collector_scaffold.py. Document the workflow and service-layer rules in root CONTRIBUTING.md and update doc links across the repo. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@core/management/commands/startcollector.py`:
- Around line 375-377: The collision check in _validate_app_label builds
installed from settings.INSTALLED_APPS by filtering out entries containing ".",
which ignores dotted app-config entries and allows collisions; change the logic
that constructs the installed set (the variable named installed in
startcollector.py) to normalize entries by extracting the actual app
package/name from dotted strings (e.g., split on "." and take the first segment
or otherwise derive the app label) so both plain and dotted entries are
considered when checking if app_label is in installed; update the check that
raises CommandError to use this normalized installed set.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b507791f-a8e0-4a9d-991c-c03eaccca472
📒 Files selected for processing (16)
.github/workflows/actions.yml.gitignoreCONTRIBUTING.mdREADME.mdcore/README.mdcore/management/commands/startcollector.pycore/tests/test_startcollector.pydocs/How_to_add_a_collector.mddocs/Service_API.mddocs/service_api/boost_library_tracker.mddocs/service_api/boost_mailing_list_tracker.mddocs/service_api/core_protocols.mddocs/service_api/cppa_slack_tracker.mddocs/service_api/wg21_paper_tracker.mdscripts/generate_service_docs.pyscripts/validate_collector_scaffold.py
Summary
python manage.py startcollector <app_label>to generate a new collector Django app with the standard layout: stubmodels.py/services.py,run_<app>usingAbstractCollector+BaseCollectorCommand,tests/package,migrations/0001_initial.py, and a commentedschedule_snippet.yamlforconfig/boost_collector_schedule.yaml.--dry-run,--path(for tests/CI), validation of app labels (snake_case, reserved names, collisions withINSTALLED_APPSor existing paths).scripts/validate_collector_scaffold.pyand a pyright workflow step that scaffolds a throwaway app under.test_artifacts/and runs ruff + scoped pyright on the generated tree.core/tests/test_startcollector.pycover dry-run, validation errors, and expected file layout.Test plan
python manage.py startcollector my_test_app --dry-run(no files written; preview looks correct)python manage.py startcollector my_test_appin a temp directory or throwaway path; confirm layout matches existing collectors (AbstractCollector, noCollectorBase)pytest core/tests/test_startcollector.py -vpython scripts/validate_collector_scaffold.py(same check as CI pyright job)Closes #214
Summary by CodeRabbit
New Features
Documentation
Tests
Chores