Allow empty manifest, fixes #1197#1204
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (11)
WalkthroughThe PR enables dfetch manifests to omit the ChangesSupport empty manifests for bootstrapping
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
dfetch/manifest/manifest.py (1)
153-155:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winMark
projectsasNotRequiredin the TypedDict.The
projectsfield is now optional in the schema and handled as potentially absent throughout the code, but the type hint still declares it as required. This creates a type inconsistency.🔧 Proposed fix
class ManifestDict(TypedDict, total=True): # pylint: disable=too-many-ancestors """Serialized dict types.""" version: int | str remotes: NotRequired[Sequence[RemoteDict | Remote]] - projects: Sequence[ + projects: NotRequired[Sequence[ ProjectEntryDict | ProjectEntry | dict[str, str | list[str] | dict[str, str]] - ] + ]]🤖 Prompt for 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. In `@dfetch/manifest/manifest.py` around lines 153 - 155, The TypedDict field projects is currently declared as required but the schema treats it as optional; change the projects annotation in the TypedDict to be NotRequired[Sequence[ProjectEntryDict | ProjectEntry | dict[str, str | list[str] | dict[str, str]]]] and add an import for NotRequired (from typing_extensions for compatibility or typing on py3.11+), so the projects key is marked optional in the TypedDict definition (update the TypedDict declaration and imports accordingly and run typechecking).
🤖 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.
Outside diff comments:
In `@dfetch/manifest/manifest.py`:
- Around line 153-155: The TypedDict field projects is currently declared as
required but the schema treats it as optional; change the projects annotation in
the TypedDict to be NotRequired[Sequence[ProjectEntryDict | ProjectEntry |
dict[str, str | list[str] | dict[str, str]]]] and add an import for NotRequired
(from typing_extensions for compatibility or typing on py3.11+), so the projects
key is marked optional in the TypedDict definition (update the TypedDict
declaration and imports accordingly and run typechecking).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: d169122c-60f7-4e8b-a880-fe00ad5fd9aa
📒 Files selected for processing (11)
CHANGELOG.rstdfetch/manifest/manifest.pydfetch/manifest/schema.pydoc/howto/adding-a-project.rstfeatures/check-git-repo.featurefeatures/fetch-git-repo.featurefeatures/freeze-projects.featurefeatures/interactive-add.featurefeatures/report-sbom.featurefeatures/validate-manifest.featuretests/test_manifest.py
Summary by CodeRabbit
New Features
dfetch addto bootstrap an empty manifest.Documentation