Skip to content

feat: add startcollector management command for new collectors#226

Merged
wpak-ai merged 3 commits into
cppalliance:developfrom
leostar0412:feat/startcollector-scaffold
May 21, 2026
Merged

feat: add startcollector management command for new collectors#226
wpak-ai merged 3 commits into
cppalliance:developfrom
leostar0412:feat/startcollector-scaffold

Conversation

@leostar0412

@leostar0412 leostar0412 commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds python manage.py startcollector <app_label> to generate a new collector Django app with the standard layout: stub models.py / services.py, run_<app> using AbstractCollector + BaseCollectorCommand, tests/ package, migrations/0001_initial.py, and a commented schedule_snippet.yaml for config/boost_collector_schedule.yaml.
  • Supports --dry-run, --path (for tests/CI), validation of app labels (snake_case, reserved names, collisions with INSTALLED_APPS or existing paths).
  • Documents the workflow in CONTRIBUTING.md (new “Creating a new collector” section), README.md, and docs/How_to_add_a_collector.md.
  • Adds scripts/validate_collector_scaffold.py and a pyright workflow step that scaffolds a throwaway app under .test_artifacts/ and runs ruff + scoped pyright on the generated tree.
  • Unit tests in core/tests/test_startcollector.py cover 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_app in a temp directory or throwaway path; confirm layout matches existing collectors (AbstractCollector, no CollectorBase)
  • pytest core/tests/test_startcollector.py -v
  • python scripts/validate_collector_scaffold.py (same check as CI pyright job)
  • Confirm CI pyright job passes on the PR

Closes #214

Summary by CodeRabbit

  • New Features

    • Added a command to scaffold new collector applications with generated templates and structure.
  • Documentation

    • Updated contributing guide and README with instructions for creating new collectors.
    • Corrected documentation link references across guides.
  • Tests

    • Added comprehensive test coverage for collector scaffolding validation.
  • Chores

    • Enhanced CI workflow validation and updated project configuration for new collectors.

Review Change Stack

leostar0412 and others added 2 commits May 21, 2026 10:40
… 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>
@leostar0412 leostar0412 self-assigned this May 21, 2026
@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f960bf89-d079-4577-8b56-cfbdf6418c2f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 70cc837 and ffd8f49.

📒 Files selected for processing (16)
  • .github/workflows/actions.yml
  • .gitignore
  • CONTRIBUTING.md
  • README.md
  • core/README.md
  • core/management/commands/startcollector.py
  • core/tests/test_startcollector.py
  • docs/How_to_add_a_collector.md
  • docs/Service_API.md
  • docs/service_api/boost_library_tracker.md
  • docs/service_api/boost_mailing_list_tracker.md
  • docs/service_api/core_protocols.md
  • docs/service_api/cppa_slack_tracker.md
  • docs/service_api/wg21_paper_tracker.md
  • scripts/generate_service_docs.py
  • scripts/validate_collector_scaffold.py

Comment thread core/management/commands/startcollector.py Outdated
@leostar0412 leostar0412 marked this pull request as ready for review May 21, 2026 18:37
@jonathanMLDev jonathanMLDev requested a review from wpak-ai May 21, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce Local Dev Setup Ceremony

3 participants