feat(submit): add --gh flag for gh CLI-based submission#278
feat(submit): add --gh flag for gh CLI-based submission#278kami619 merged 4 commits intoambient-code:mainfrom
Conversation
Add alternative submission method using gh CLI instead of GITHUB_TOKEN. This allows users who prefer gh's built-in authentication to submit assessments without managing personal access tokens. Changes: - Add --gh flag to submit command - Implement submit_with_gh_cli() using gh api and gh pr create - Refactor common logic into helper functions - Fix edge case where repo URL is null Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
#279 is submitted using this PR branch |
AgentReady Code ReviewSummaryThis PR adds a --gh flag to the agentready submit command, enabling gh CLI-based submission without requiring GITHUB_TOKEN management. The refactoring improves maintainability by extracting common logic into helper functions. Security Issues (HIGH PRIORITY)
Code QualityStrengths:
Issues:
RecommendationsRequired Before Merge:
Suggested Improvements:
AgentReady Attribute Impact
Overall AssessmentSecurity Score: 6/10 - Missing timeout, validation, size checks Recommendation: Request changes - Address security issues and add tests before merge. Review generated by AgentReady /review-agentready |
AgentReady Code Review: PR #278OverviewThis PR adds Overall Assessment: ✅ Approved with minor recommendations AgentReady Attribute Compliance✅ StrengthsCode Modularity (Tier 2: Critical)
Error Handling (Tier 2: Critical)
Type Annotations (Tier 2: Critical)
CLI Usability (Tier 1: Essential)
|
- Add SUBPROCESS_TIMEOUT (60s) to prevent hanging on unresponsive gh CLI - Add MAX_ASSESSMENT_SIZE (10MB) check before base64 encoding - Add GITHUB_NAME_PATTERN regex to validate org/repo names - Wrap json.loads() in try/except for JSONDecodeError handling - Add docstring to run_gh_command() function Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AgentReady Code Review: PR #278OverviewPR: feat(submit): add --gh flag for gh CLI-based submission Executive SummaryThis PR successfully adds gh CLI support as an alternative to GITHUB_TOKEN authentication, improving developer experience and security. The refactoring significantly enhances code organization, security, and maintainability. Overall Score Impact: +2 points (improved code quality, security, documentation) AgentReady Attribute Analysis✅ Strengths1. Security Best Practices (CRITICAL)
2. Code Quality & Maintainability
3. Error Handling
4. Documentation
|
| Attribute | Before | After | Change | Notes |
|---|---|---|---|---|
| code_complexity | 85 | 88 | +3 | Better function decomposition |
| type_annotations | 60 | 65 | +5 | Some type hints added |
| error_handling | 80 | 85 | +5 | Comprehensive coverage |
| input_validation | 70 | 90 | +20 | Regex validation, size checks |
| documentation | 75 | 80 | +5 | Docstrings, updated help |
| security_best_practices | 65 | 85 | +20 | Command injection prevention |
| testing | 40 | 40 | 0 | No tests added |
Estimated Score Impact: +2.5 points (weighted average)
Final Recommendations
Must Fix Before Merge
- Add type hints to all function signatures
- Add unit tests for new helper functions (minimum 80% coverage)
- Add integration test for gh CLI flow with mocked subprocess
Should Fix Before Merge
- Extract duplicate permission validation logic
- Add --verbose flag for progress feedback
- Document gh CLI authentication in README
Nice to Have
- Streaming base64 encoding for large files
- Dynamic timeout based on operation type
- Retry logic for transient network failures
Conclusion
This PR represents a significant improvement to the AgentReady codebase:
✅ Security: Prevents command injection, validates inputs
✅ Usability: Simplifies authentication for users
✅ Maintainability: Better code organization
✅ Documentation: Clear help text and examples
Recommended Action: APPROVE with suggested improvements
AgentReady Score Impact: +2 points (current: 80.0 → estimated: 82.0)
Review conducted by AgentReady review-agentready agent
Timestamp: 2026-02-07
Reviewer: Claude Sonnet 4.5
Addressed Review FeedbackPushed commit High Priority Fixes
Code Quality
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📉 Test Coverage Report
Coverage calculated from unit tests only |
There was a problem hiding this comment.
AgentReady Code Review
Overall Assessment: APPROVED WITH SUGGESTIONS
This PR adds a --gh flag to enable GitHub CLI-based submission. The implementation is solid with good security practices.
AgentReady Attribute Compliance
Strengths:
- Type Annotations (Tier 1): All new functions have proper type hints
- Documentation (Tier 1): Clear docstrings with Args/Returns sections
- Error Handling (Tier 2): Comprehensive validation
- Security (Tier 1): Input validation with regex patterns
Areas for Improvement:
- Test Coverage (Tier 2): Missing automated unit tests
- Add tests in tests/unit/cli/test_submit.py
Security Analysis
Strong Practices:
- Input validation prevents command injection
- File size limits prevent DoS attacks
- Subprocess safety with timeouts
- Authentication verification
Issue: Base64 encoding buffer (lines 280-284) creates ~46MB peak memory for 10MB files
Priority: Medium (acceptable with current limit)
Code Quality
Excellent refactoring with helper functions following SOLID principles
Minor Issues:
- Magic numbers in constants
- Duplicate error handling
- Error message consistency
Testing Recommendations
- Add unit tests for validators
- Mock subprocess.run for gh CLI tests
- Integration test for full flow
Impact on Score
Estimated delta: +1.5 points
Improvements to Type Annotations, Error Handling, Security, Code Organization
Final Verdict
APPROVED - Core implementation is secure and well-structured
Before Merge: Add unit tests (recommended)
Post-Merge: Consider streaming base64 encoding, extract verify_repo_access() function, add debug logging
Great work improving user experience!
|
🎉 This PR is included in version 2.27.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
# [2.14.0](v2.13.0...v2.14.0) (2026-02-12) ### Bug Fixes * add bounded retry logic for LLM rate limit handling ([ambient-code#205](https://github.com/kami619/agentready/issues/205)) ([6ecb786](6ecb786)), closes [ambient-code#104](https://github.com/kami619/agentready/issues/104) * **assessors:** FileSizeLimitsAssessor now respects .gitignore ([ambient-code#248](https://github.com/kami619/agentready/issues/248)) ([eaaecc2](eaaecc2)), closes [ambient-code#245](https://github.com/kami619/agentready/issues/245) * **ci:** add permissions for leaderboard PR comment posting ([ambient-code#276](https://github.com/kami619/agentready/issues/276)) ([33252e4](33252e4)) * **ci:** use gh pr view for fork PR number lookup in coverage comment ([ambient-code#253](https://github.com/kami619/agentready/issues/253)) ([1688362](1688362)) * Correct pre-commit template path in PrecommitHooksFixer ([ambient-code#269](https://github.com/kami619/agentready/issues/269)) ([c42a3c9](c42a3c9)) * downgrade docker/metadata-action to v5 and fix shellcheck warnings ([12f5509](12f5509)) * enable Harbor task filtering for smoketest support ([ambient-code#222](https://github.com/kami619/agentready/issues/222)) ([f780188](f780188)) * make E2E test timeouts configurable and add sensitive directory test ([ambient-code#206](https://github.com/kami619/agentready/issues/206)) ([27e87e5](27e87e5)), closes [ambient-code#104](https://github.com/kami619/agentready/issues/104) [ambient-code#192](https://github.com/kami619/agentready/issues/192) * prevent unauthorized message for non-command comments ([ambient-code#262](https://github.com/kami619/agentready/issues/262)) ([84c6f69](84c6f69)) * rename research report in data directory ([b8ddfdc](b8ddfdc)) * resolve all broken links failing CI lychee check ([ambient-code#288](https://github.com/kami619/agentready/issues/288)) ([4412c27](4412c27)) * resolve all test suite failures - achieve zero failures ([ambient-code#180](https://github.com/kami619/agentready/issues/180)) ([990fa2d](990fa2d)), closes [ambient-code#148](https://github.com/kami619/agentready/issues/148) [ambient-code#147](https://github.com/kami619/agentready/issues/147) [ambient-code#145](https://github.com/kami619/agentready/issues/145) * resolve YAML syntax error in continuous-learning workflow ([ambient-code#172](https://github.com/kami619/agentready/issues/172)) ([3d40fcc](3d40fcc)) * resolve YAML syntax error in update-docs workflow and add actionlint ([ambient-code#173](https://github.com/kami619/agentready/issues/173)) ([97b06af](97b06af)) * schema backwards compat for attributes_skipped key ([ambient-code#277](https://github.com/kami619/agentready/issues/277)) ([841bcc4](841bcc4)) * update --version flag to show correct version and research report date ([ambient-code#221](https://github.com/kami619/agentready/issues/221)) ([5a85abb](5a85abb)) * **workflows:** ensure post-comment step runs after Claude Code Action ([b087e5c](b087e5c)) * **workflows:** handle all event types in agentready-dev workflow ([9b942bf](9b942bf)) * **workflows:** improve error handling and logging for comment posting ([9ea1e6b](9ea1e6b)) * **workflows:** improve issue number extraction and add debug step ([ecd896b](ecd896b)) * **workflows:** remove if:always() to test step execution ([ff0bb12](ff0bb12)) * **workflows:** simplify post-comment step condition ([1bbf40a](1bbf40a)) ### Features * add dgutride/odh-dashboard to leaderboard ([ambient-code#268](https://github.com/kami619/agentready/issues/268)) ([f4911b2](f4911b2)) * add Harbor Terminal-Bench comparison for agent effectiveness ([ambient-code#199](https://github.com/kami619/agentready/issues/199)) ([a56e318](a56e318)) * add Memory MCP server allow list to repository settings ([ambient-code#203](https://github.com/kami619/agentready/issues/203)) ([41d87bb](41d87bb)) * add Red-Hat-AI-Innovation-Team/sdg_hub to leaderboard ([ambient-code#279](https://github.com/kami619/agentready/issues/279)) ([5b71392](5b71392)) * **assessors:** support AGENTS.md and @ references in CLAUDEmdAssessor ([ambient-code#265](https://github.com/kami619/agentready/issues/265)) ([450ec25](450ec25)), closes [ambient-code#244](https://github.com/kami619/agentready/issues/244) * centralize Claude instructions via AGENTS.md and add init redirect tests ([ambient-code#273](https://github.com/kami619/agentready/issues/273)) ([92c8f3f](92c8f3f)) * consolidate GitHub Actions workflows by purpose ([ambient-code#217](https://github.com/kami619/agentready/issues/217)) ([717ca6b](717ca6b)), closes [ambient-code#221](https://github.com/kami619/agentready/issues/221) * container support ([ambient-code#171](https://github.com/kami619/agentready/issues/171)) ([c6874ea](c6874ea)) * convert AgentReady assessment to on-demand workflow ([ambient-code#213](https://github.com/kami619/agentready/issues/213)) ([b5a1ce0](b5a1ce0)), closes [ambient-code#191](https://github.com/kami619/agentready/issues/191) * enhance assessors with multi-language support and security ([ambient-code#200](https://github.com/kami619/agentready/issues/200)) ([85712f2](85712f2)), closes [ambient-code#10](https://github.com/kami619/agentready/issues/10) * Harbor framework integration for Terminal-Bench evaluations ([ambient-code#202](https://github.com/kami619/agentready/issues/202)) ([d73a8c8](d73a8c8)), closes [#4](#4) [ambient-code#178](https://github.com/kami619/agentready/issues/178) [ambient-code#178](https://github.com/kami619/agentready/issues/178) * integrate ACL file with Claude Code Action allowed_users ([ambient-code#261](https://github.com/kami619/agentready/issues/261)) ([fe52489](fe52489)) * Redesign homepage features with two-column layout and research links ([ambient-code#189](https://github.com/kami619/agentready/issues/189)) ([570087d](570087d)), closes [ambient-code#187](https://github.com/kami619/agentready/issues/187) * replace markdown-link-check with lychee for link validation ([ambient-code#177](https://github.com/kami619/agentready/issues/177)) ([f1a4545](f1a4545)) * **submit:** add --gh flag for gh CLI-based submission ([ambient-code#278](https://github.com/kami619/agentready/issues/278)) ([48bb624](48bb624)) * Terminal-Bench eval harness (MVP Phase 1) ([ambient-code#178](https://github.com/kami619/agentready/issues/178)) ([d06bab4](d06bab4)), closes [ambient-code#171](https://github.com/kami619/agentready/issues/171) * **workflows:** add comment posting for [@agentready-dev](https://github.com/agentready-dev) agent ([5dff614](5dff614))
Summary
--ghflag toagentready submitcommand for gh CLI-based submissionGITHUB_TOKEN- usesgh auth logininsteadUsage
Test plan
agentready submit --helpshows new--ghflagagentready submit --dry-runworks with existing assessment filesruff checkandruff format)--ghflag🤖 Generated with Claude Code