Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive api command to the CLI, providing direct access to the QA Sphere public API. The changes are extensive and well-executed, including new commands for various API resources, detailed documentation in README.md and SKILL.md, and a robust testing suite with both mocked and live tests. The code is well-structured, modular, and follows best practices. My review includes one minor suggestion to enhance error reporting for better user experience when dealing with malformed JSON files.
| try { | ||
| return JSON.parse(content) | ||
| } catch { | ||
| throw new Error(`Failed to parse JSON from file ${filePath} for ${optionName}`) | ||
| } |
There was a problem hiding this comment.
For better error reporting and consistency with the other JSON.parse error handling in this file, it would be beneficial to include the original error message when parsing from a file fails. This will provide more context to the user when debugging malformed JSON files.
try {
return JSON.parse(content)
} catch (e) {
const errorMessage = e instanceof Error ? e.message : String(e)
throw new Error(
`Failed to parse JSON from file ${filePath} for ${optionName}: ${errorMessage}`
)
}- Add Zod schemas at API level for all request types with validateRequest() that throws RequestValidationError, caught by apiHandler for clean error output - Add handleValidationError() + buildArgumentMap() to map API field names to CLI argument names (e.g., title → --title) for user-friendly error messages - Move validation schemas from command-level to API-level as single source of truth; command handlers pass args directly to API functions - Add customFields, parameterValues, and filledTCaseTitleSuffixParams to test-case create/update commands with proper validation (parameterValues restricted to template type) - Fix jsonResponse null crash, expand ResultStatus with custom statuses, relax test-cases update check, extract shared superRefine for run schemas - Add tests for new fields (mocked + live) and batch-create validation errors
|
Claude finished @ramilamparo's task in 6m 24s —— View job Reviewing PR #58: Add public API commands
Reviewed the full diff (~424K chars, 100 files) with 4 specialized subagents (code quality, security, performance, test coverage). Posted a new review with 2 inline comments. Resolved 9 outdated bot threads, minimized 9 outdated bot review summaries, and deleted 2 progress comments. 7 issues fixed since last review:
Correction on "yargs metadata leak": After deeper analysis, the 2 remaining issues (inline comments posted):
|
|
Claude finished @ramilamparo's task in 6m 31s —— View job Reviewing PR #58: Add public API commands
All 12 previously raised issues are now resolved — fixed in code or confirmed correct by the author. Posted review with 1 minor nit (explicit field picking vs |
There was a problem hiding this comment.
Review Summary (re-review after e484fb2)
All previously raised issues have been addressed:
milestoneIds/tagsmissing.int().positive()— Fixed in latest commits. All numeric array schemas now use.int().positive(), which also prevents NaN from.split(',').map(Number).- Shared-preconditions response unwrapping — Confirmed correct by author; thread resolved.
ResultStatustype — Now includes custom1-4 statuses.test-cases update.check()— Rewritten to check for empty merged body.- DRY body-merging — Extracted to
mergeBodyWithOverrideshelper. - DRY
superRefine— Extracted to sharedvalidateQueryPlansfunction. projects createvalidation — Now uses API-layerhandleValidationError.test-cases create/updatebody leak — Uses explicit field picking viamergeBodyWithOverrides.listRunTCasesresponse unwrapping — Now correctly unwraps.- Path parameter injection — Mitigated via
validatePathParamsregex ([a-zA-Z0-9_-]+). - Schemas inlined —
results/schemas.tsandsettings/schemas.tsremoved, schemas moved into their respectivecommand.tsfiles.
1 minor nit posted inline (explicit field picking vs ...args spread — not a bug, just readability).
No new security, performance, or correctness issues found. Well-structured PR with good separation of concerns.
|
Claude finished @ramilamparo's task in 8m 43s —— View job Reviewing PR #58: Add public API commands
Reviewed the full diff (~424K chars, 102 files) with 4 specialized subagents. All 12 previously raised issues are resolved. Posted an approving review with no new blocking issues. Minimized 10 outdated bot review summaries. |
There was a problem hiding this comment.
Review Summary
All 12 previously raised issues have been resolved. Reviewed the full diff (~424K chars, 102 files) with 4 specialized subagents (code quality, security, performance, test coverage). No new critical, high, or medium issues found.
Security: Clean — path parameter validation via validatePathParams regex, Zod schema enforcement at all API boundaries, no hardcoded credentials, proper auth token handling.
Performance: No issues in PR-scoped changes.
Code quality: Well-structured PR with consistent patterns (apiHandler + connectApi lazy-loading, per-resource command.ts/help.ts organization, mergeBodyWithOverrides DRY helper, shared validateQueryPlans). The author's approach of relying on Zod's validateRequest() to strip unknown keys from ...args spread is a valid design choice.
Test coverage observation (non-blocking): Validation error paths are lightly tested for several commands (settings update-statuses, folders bulk-create, test-plans create, results create, files upload). The runs create and test-cases create specs are good models for what coverage could look like. This is a quality improvement opportunity, not a blocker.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e484fb2a50
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| description: z.string(), | ||
| expected: z.string().optional(), | ||
| sharedStepId: z.number().int().positive().optional(), |
There was a problem hiding this comment.
Accept shared-step-only payloads in step schema
The stepSchema makes description mandatory, so requests like steps: [{"sharedStepId": 123}] are rejected before hitting the API. QA Sphere's Test Cases API docs define step fields as optional (sharedStepId?, description?, expected?), which means shared-step references without inline text are valid; this client-side requirement blocks that supported workflow.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Renamed the file to runs.ts to keep it uniform with the others.
There was a problem hiding this comment.
New skill can be added with npx skills add Hypersequent/qas-cli
| - name: Run live API tests | ||
| env: | ||
| QAS_TEST_URL: ${{ secrets.QAS_TEST_URL }} | ||
| QAS_TEST_TOKEN: ${{ secrets.QAS_TEST_TOKEN }} | ||
| QAS_TEST_USERNAME: ${{ secrets.QAS_TEST_USERNAME }} | ||
| QAS_TEST_PASSWORD: ${{ secrets.QAS_TEST_PASSWORD }} | ||
| QAS_DEV_AUTH: ${{ secrets.QAS_DEV_AUTH }} | ||
| run: npm run test:live |
There was a problem hiding this comment.
Live tests are added that allows running automated tests with a real live qasphere instance. QAS_TEST_USERNAME and QAS_TEST_PASSWORD are required because we don't have a public API yet for deleting projects, which is required for clean-ups after the tests. So we use login credentials and call a non-public API instead.
| "typescript": "^5.8.3", | ||
| "typescript-eslint": "^8.31.1", | ||
| "vitest": "^3.1.2" | ||
| "vitest": "^4.1.0" |
There was a problem hiding this comment.
Updated vitest to allow specifying tags. Which is useful for live tests and excluding them on normal testing.
Summary
Adds a new
qasphere apicommand that provides direct CLI access to the full QA Sphere public API. Users can now manage projects, test runs, test cases, results, and other resources programmatically without writing custom API integration code.What's included
projects,runs,test-cases,results,folders,milestones,tags,requirements,shared-steps,shared-preconditions,custom-fields,audit-logs,settings,test-plans,files,users@filenamereferences[0].tcaseIds: not allowed for "live" runsQAS_URL/QAS_TOKENloaded only when the API is called, so CLI validation errors surface firstnpx skills add Hypersequent/qas-cliFolder structure
Other changes
audit-logs,custom-fields,milestones,requirements,results,settings,shared-preconditions,shared-steps,tags,test-plans,users,file— plus expandedruns,tcases,projects,foldersCLAUDE.mdupdated with full architecture docs for the API commandREADME.mdupdated with usage documentationSKILL.mdadded for AI coding agent supportnpm audit fixapplied to dependencies (high vulnerability issues were being reported)Testing
src/tests/api/organized by resource, one spec per action (e.g.,projects/list.spec.ts,runs/create.spec.ts){ tags: ['live'] }test-helper.tswithuseMockServer(),runCli(), and atestfixture that provides project lifecycle managementglobal-setup.ts) handles live API authentication🤖 Generated with Claude Code