Add cross-package dependency verification to CI (Dispatch #68)#713
Open
Add cross-package dependency verification to CI (Dispatch #68)#713
Conversation
- Implement verify-cross-package-deps.py script to scan workspace packages for undeclared cross-package imports - Prevent monorepo from silently devolving into monolith by enforcing dependency boundaries - Integration with CI workflow as part of dependency-check job - Uses Python AST parsing to accurately identify imports and cross-reference with pyproject.toml dependencies - Handles workspace package discovery, relative imports, and module name mapping - Provides clear error messages and remediation guidance when violations are found The script complements existing deptry checks by focusing specifically on cross-package boundaries within the monorepo workspace.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements cross-package dependency verification for the busylight monorepo to prevent it from silently devolving into a monolith by catching undeclared cross-package dependencies.
Changes
New Script:
scripts/verify-cross-package-deps.pyCI Integration
.github/workflows/ci.ymldependency-checkjobDocumentation
scripts/README.mdexplaining the verification processTechnical Details
astmodule to accurately parse import statementsfrom .module import ...)busylight-core) and module names (busylight_core)Testing
The script correctly identifies the current valid cross-package dependency:
busylight-for-humans→busylight_core(properly declared asbusylight-core>=2.3.0)Dispatch #68
This addresses the requirement to "Add prek dependency verification to busylight-core monorepo CI" by implementing a custom solution that:
The tool provides better monorepo-specific dependency verification than generic tools, focusing specifically on cross-package boundaries within the workspace.