Add agent analytics commands over /v1/analytics/*#27
Merged
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.
Adds an
agent analyticscommand group so agents (and humans) can query the org's GitHub PR + review analytics — the data behind the /analytics dashboard — from the terminal.Requested by @hbrooks in Slack. Backend PR (adds the token-auth
/v1/analytics/*endpoints): ellipsis-dev/ellipsis#5625 — merge that first.Commands
--days N(server default: last 30 days) or--start/--end, and--jsonfor the raw API response (agent/script friendly).reviewersreads the reviewers leaderboard fromGET /v1/analytics/metrics(--account-type,--repo owner/name,--sort reviews|approved|changes-requested|comments|lines,--limit).prswrapsGET /v1/analytics/pull-requests(maps--account-type user|botto the endpoint's rawUser/Botfilter;--statusrepeatable).reviewswrapsGET /v1/analytics/reviews(--repobare name,--authorreviewer login,--review-state, top-reviewers table from the facets).Also: typed mirrors of the three response models in
src/lib/types.ts, threeApiClientmethods, README usage block.Verification
npm run typecheckandnpm run buildgreen.--helpoutput smoke-checked for the group and each subcommand from the built bundle.