Repository navigation
feat(cli): polymorfa doctor - #23
Conversation
|
@coderabbitai review |
|
Warning Review limit reached
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 15 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 89 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. The included review limit has been reached and this organization has disabled usage-based review continuation. Wait for reviews to reset or ask a billing admin to change After included review limits. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
Comment |
|
|
@coderabbitai review |
|
|
Reviewed locally because CodeRabbit is rate-limited (it answered Fixed one finding:
Nothing left unfixed. |
|
Tip For best results, initiate chat on the files or code changes.
✏️ Learnings added
You are interacting with an AI system. |
0cae9bd to
618dbdf
Compare
|
@coderabbitai review |
|
618dbdf to
9d58496
Compare
|
Rebased onto Two further fixes:
README's keyring row updated to match. Deliberately left unfixed, as design questions larger than this PR:
|
Checks Node.js version, profile config, keyring access, API reachability via /ping, and server API key validity via an authenticated project list.
…dentials The missing-profile branch hardcoded fail, so a stale activeProfile made doctor exit non-zero even when the environment credential was the one being validated. Downgrade to warn, matching the sibling branch.
…dentials The catch around the keyring block hardcoded fail, bypassing the env downgrade the branches above apply, so doctor exited 1 in CI containers without a secret service even though commands resolve the environment credential first. Also point the remediation at a runnable auth login invocation; it requires a credential-source flag.
4a270c4 to
cd18911
Compare
Summary
Adds
polymorfa doctor. The keyring error message ondevalready tells users to "Run polymorfa doctor", but the command did not exist until now.nodeengines).configkeyringapiSystemClient.ping()(/ping) against the resolved base URL, without retries.credentialClient.projects.list()is the authenticated ping. Authentication error → fail; authorization error → warn (valid key, missingsessions:read). Skipped when the API is unreachable. Project and client tokens are reported as present but not validated remotely.The command exits 1 if any check fails, and
--jsonprints{checks, ok}. Credential values are registered for redaction and never appear in output. Environment credentials take precedence over the profile, matching the other commands.Independent of #19 (project context): it does not report directory links yet, so the two PRs don't have to land in order.
Five-part assessment
/pingandGET /platform/projects.SystemClient.ping,Client.projects.list. The SDK has no credential-introspection ("whoami") method, so the project list stands in as the authenticated ping, and project/client tokens cannot be validated generically.doctorcommand with help and examples, plus a README section.Verification
npm run verifypasses.test/services/doctor.test.ts(8 tests) covers the all-green path, old Node, keyring failure, invalid config, unreachable API skipping the key check, 401 vs 403, env precedence, and client tokens. It also asserts that the key never appears in the report.https://api.polymorfa.com/pingwas also unreachable, so a real successful remote ping and key validation were not exercised.Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.