feat(cli): integrate devmetrics into rsk-cli with hardened validation, docs, and full test coverage#301
Open
lucifer1017 wants to merge 1 commit intorsksmart:mainfrom
Open
feat(cli): integrate devmetrics into rsk-cli with hardened validation, docs, and full test coverage#301lucifer1017 wants to merge 1 commit intorsksmart:mainfrom
lucifer1017 wants to merge 1 commit intorsksmart:mainfrom
Conversation
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
This PR cleanly integrates the
devmetricscommand intorsk-cli2(without breaking existing CLI structure), adds production-grade validation/error handling, resolves README conflicts, documents dependency decisions, and adds comprehensive test coverage for command flow + supporting modules.What Was Added
bin/index.ts(registersdevmetricscommand/options)src/commands/devmetrics.tssrc/services/github.service.tssrc/services/rootstock.service.tssrc/formatters/devmetrics/index.tssrc/formatters/devmetrics/table.formatter.tssrc/formatters/devmetrics/json.formatter.tssrc/formatters/devmetrics/markdown.formatter.tssrc/utils/devmetricsValidation.tssrc/utils/types.ts(DevMetrics-related interfaces)README Updates (with ranges)
devmetrics, gas estimator numbering, dependency notes):README.mdL12-L33Developer Health Metricsdocs section:README.mdL1155-L1256eas-sdkpin rationale documentation:README.mdL1259-L1267README.mdL1093-L1151 now resolvedFindings Addressed
3) VULNERABILITY: Unvalidated
--rpc-url(SSRF risk)src/commands/devmetrics.ts:http://andhttps://4) VULNERABILITY:
eas-sdkdowngrade undocumentedREADME.mdL1259-L12672.9.0ESM internal import compatibility issue under Node 22 (ERR_MODULE_NOT_FOUND), pinning2.7.0intentionally until upstream fix.5) CODE_SMELL: Unsafe
repo.split("/") as [string, string]splitRepo) insrc/commands/devmetrics.tsowner/repoName6) IMPROVEMENT: Recursive
getMetrics()timeout complexityGitHubServiceflow:getMetrics()owns a single outer timeout budgetfetchMetrics()directly after auth resetPromise.racebehavior and simplifies timeout reasoningRequired Changes Status
eas-sdkversion pin rationale--rpc-urlprotocollogError/logMessage/logWarning/logSuccess+createSpinner) in command flowTests Added
src/__tests__/validation.test.tssrc/__tests__/formatters/json.formatter.test.tssrc/__tests__/formatters/markdown.formatter.test.tssrc/__tests__/formatters/table.formatter.test.tssrc/__tests__/services/github.service.test.tssrc/__tests__/services/rootstock.service.test.tssrc/__tests__/commands/devmetrics.test.tsVerification
npm test→ 102/102 passingnpm run build→ success