Repository navigation
test: add package import contract smoke - #244
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: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds release-hardening task G40 to verify package import boundaries. It introduces a test suite ensuring agentkit public APIs do not pull in coding_agent, top-level coding_agent imports keep heavy dependencies lazy, and wheel configuration includes both packages, along with task definition and completion documentation. ChangesPackage Import Contract Testing
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
coding-agent/tests/coding_agent/test_package_import_contract.py (1)
60-60: 💤 Low valueConsider whether order-sensitive equality is appropriate.
The test uses exact list equality, so package order in
pyproject.tomlmatters. If the intent is to verify that both packages are present (regardless of order), consider using set comparison:assert set(packages) == {"src/coding_agent", "src/agentkit"}However, if strict ordering is part of the contract, the current assertion is correct.
🤖 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 `@coding-agent/tests/coding_agent/test_package_import_contract.py` at line 60, The test currently asserts order-sensitive equality on the packages list (assert packages == ["src/coding_agent", "src/agentkit"]); if the intent is to only verify presence regardless of order, change the assertion to a set comparison (assert set(packages) == {"src/coding_agent", "src/agentkit"}) in the test function (test_package_import_contract / variable packages) so the test no longer fails due to ordering; if ordering is intentional, leave the assertion as-is.
🤖 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 `@coding-agent/tests/coding_agent/test_package_import_contract.py`:
- Around line 36-42: The guarded_import function shadows builtins by using
parameter names globals and locals; rename those parameters (for example to
globals_ and locals_) and update all uses inside guarded_import (including the
call to __import__ and any references) to use the new names so you no longer
shadow Python builtins while keeping the same behavior.
---
Nitpick comments:
In `@coding-agent/tests/coding_agent/test_package_import_contract.py`:
- Line 60: The test currently asserts order-sensitive equality on the packages
list (assert packages == ["src/coding_agent", "src/agentkit"]); if the intent is
to only verify presence regardless of order, change the assertion to a set
comparison (assert set(packages) == {"src/coding_agent", "src/agentkit"}) in the
test function (test_package_import_contract / variable packages) so the test no
longer fails due to ordering; if ordering is intentional, leave the assertion
as-is.
🪄 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 Plus
Run ID: 77b58357-bfd7-488f-8027-1fc11aa67e9b
📒 Files selected for processing (3)
coding-agent/.opencode/prompts/tasks/release-hardening-g40-import-contract.mdcoding-agent/docs/release_hardening/GOAL_PROGRESS.mdcoding-agent/tests/coding_agent/test_package_import_contract.py
c66af87 to
0c02862
Compare
0c02862 to
9071ee3
Compare
Summary
Verification
Summary by CodeRabbit
Tests
Documentation