Skip to content

fix(validator): allow frappe in required_apps - #537

Closed
mihir-kandoi wants to merge 2 commits into
developfrom
fix/required-apps-lists-frappe
Closed

mihir-kandoi wants to merge 2 commits into
developfrom
fix/required-apps-lists-frappe

Conversation

@mihir-kandoi

Copy link
Copy Markdown
Contributor

Apps that list frappe in hooks.py's required_apps (tally_migrator, shop, Letters, sherlock) failed validation with "requires ['frappe'] ... doesn't declare them", even though pyproject.toml declares frappe. The check removed frappe from the declared side only. frappe is already required in pyproject.toml, so the sets are now compared directly.

Fixes #485

Apps like tally_migrator list "frappe" in hooks.py's required_apps. The
check dropped frappe from the declared side only, so it was reported as
undeclared even though pyproject.toml declares it. frappe is already
guaranteed to be declared, so compare the sets directly.

Fixes #485
@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Changes how app dependency validation compares frappe declarations.

The behavior appears safe to merge; update the dependency documentation and test name.

Reviews (1) · Last reviewed commit: "test(validator): cover frappe listed in ..."

# hooks.py's required_apps never lists frappe itself (it's implicit),
# while pyproject.toml always does - exclude it before comparing.
missing = sorted(set(self.get_hooks_required_apps(app)) - (set(declared) - {"frappe"}))
missing = sorted(set(self.get_hooks_required_apps(app)) - set(declared))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Dependency docs omit new behavior The validator now accepts frappe in required_apps when pyproject declares it, but docs/app-dependencies.md does not explain that behavior. The repository review rules require relevant documentation to be updated with a behavior change; please add it in this PR.

Prompt To Fix With AI
This is a comment left during a code review.
Path: pilot/core/app/validator/dependency_declarations.py
Line: 33

Comment:
**Dependency docs omit new behavior** The validator now accepts `frappe` in `required_apps` when pyproject declares it, but `docs/app-dependencies.md` does not explain that behavior. The repository review rules require relevant documentation to be updated with a behavior change; please add it in this PR.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

def test_dependency_declarations_excludes_frappe_from_hooks_comparison(tmp_path: Path) -> None:
"""pyproject always declares frappe; hooks.py's required_apps never does -
frappe being present in pyproject alone must not cause any false failure."""
"""frappe being present in pyproject alone must not cause any false failure."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Test name misstates behavior The existing test is still named test_dependency_declarations_excludes_frappe_from_hooks_comparison, but the comparison no longer excludes frappe. Please rename the test so future readers do not mistake what it verifies.

Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/pilot/core/test_app_validator.py
Line: 181

Comment:
**Test name misstates behavior** The existing test is still named `test_dependency_declarations_excludes_frappe_from_hooks_comparison`, but the comparison no longer excludes `frappe`. Please rename the test so future readers do not mistake what it verifies.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

Unable to install tally_migrator app — false dependency validation error

1 participant