my-reviews
v3.6.1
Published
Review queue helpers for GitHub and Phabricator.
Maintainers
Readme
My Reviews CLI
A small Node.js tool that prints your current review queue from GitHub, Bugzilla, and Phabricator so you can keep up with incoming requests from the terminal.
Example Usage
➤ my-reviews
Phabricator author: @gregtatum
└─ Bug 1998228
├─ D271264 Review Type check StaticEmbeddingsPipeline.mjs
├─ D271263 Review Type check MLEngineParent.sys.mjs
├─ D271262 Review Type check MLEngineChild.sys.mjs
└─ D271261 Approved Add toolkit/components/ml/tsconfig.json for some initial type checking
Phabricator reviewer: @gregtatum
└─ Bug 2000885
└─ D273122 Review @aosmond create an ai window singleton registered with BrowserComponents.manifest
Phabricator reviewer: #ai-platform-reviewers
└─ Bug 2001120
└─ D273450 Review @czhou add getTabGroups to TabManagementServiceReview requests where you are personally the reviewer are listed first (highest
signal). Requests that reach you only through a review group you belong to are
split into their own reviewer: #group sections, ordered alphabetically. When
several of your groups are on the same revision, it is filed under the smallest
(most specialized) group so it appears only once.
Installation
Install from npm to get the CLI on your PATH:
npm install -g my-reviewsOr run it ad-hoc with npx:
npx my-reviewsAdd your projects, you will be prompted for API tokens as needed.
# Add phabricator.services.mozilla.com support.
my-reviews phabricator gregtatum
# Add phabricator support for a custom domain.
my-reviews phabricator gregtatum https://phabricator.example.com/
# Add support for bugzilla needinfos
my-reviews bugzilla [email protected]
# Add a github project with the org, repo, and user.
my-reviews github mozilla translations gregtatum
# Ignore reviews that you don't need to look at.
my-reviews ignore mozilla/translations#123Usage
Save configurations first, then run my-reviews to print everything in one go. Subcommands include phabricator, bugzilla, github, ignore, and ignore-list.
Command reference (mirrors my-reviews --help)
- Run all saved configs
my-reviews - Add or delete your Phabricator user
my-reviews phabricator <username> [phabricator_url]my-reviews phabricator <username> [phabricator_url] --delete - Add or delete your Bugzilla account
my-reviews bugzilla <email> [bugzilla_url]my-reviews bugzilla <email> [bugzilla_url] --delete - Add or delete a GitHub repo/user combo
my-reviews github <org> <repo> <user>my-reviews github <org> <repo> <user> --delete - Add or delete an ignored Phabricator diff/bug or GitHub PR
my-reviews ignore <target>my-reviews ignore <target> --delete - List ignored entries
my-reviews ignore-list
Phabricator reviews
my-reviews phabricator <username> [phabricator_url]
# remove a saved config
my-reviews phabricator --delete <username> [phabricator_url]- The command will prompt for a Phabricator API token (stored locally) the first time you run it.
- Tokens can be generated at:
https://phabricator.services.mozilla.com/settings/user/<your-username>/page/apitokens/ - If you use a custom Phabricator URL, use that base URL in the token page.
- The command will detect your Phabricator user via the Conduit API and save it.
Once added, running my-reviews will fetch and print the current queue for all saved Phabricator configs.
Bugzilla needinfo
my-reviews bugzilla [email protected]
# custom Bugzilla instance
my-reviews bugzilla [email protected] https://bugzilla-dev.allizom.org
# remove a saved config
my-reviews bugzilla [email protected] --deleteGet a Bugzilla API key from your Bugzilla user preferences (API Keys section) at https://bugzilla.mozilla.org/userprefs.cgi?tab=apikey. The CLI will prompt for the key the first time you configure Bugzilla and store it for future runs, using the REST mydashboard/run_flag_query endpoint to fetch open needinfo? requests.
GitHub reviews
my-reviews github <org> <repo> <github-username>
# remove a saved config
my-reviews github --delete <org> <repo> <github-username>The command saves the configuration and fetches open pull requests for the given repository when you run my-reviews, printing:
- PRs where you are a requested reviewer and the review is still outstanding.
- Your own open PRs (excluding drafts and WIPs) so you can monitor their status.
Example:
my-reviews github mozilla translations gregtatumIgnoring reviews
Add Phabricator or GitHub reviews to a persistent ignore list
# Phabricator
my-reviews ignore https://phabricator.services.mozilla.com/D271264
my-reviews ignore D271264
my-reviews ignore Bug 1998228
my-reviews ignore https://bugzilla.mozilla.org/show_bug.cgi?id=1998228
# GitHub
my-reviews ignore https://github.com/mozilla/translations/pull/123
my-reviews ignore mozilla/translations#123
# remove an ignore entry
my-reviews ignore -d mozilla/translations#123
# list ignored entries
my-reviews ignore-listDevelopment
npm run tsruns TypeScript against the JSDoc annotations.- Persist or log API responses when working on fixtures:
MY_REVIEWS_PERSIST=phabricator,MY_REVIEWS_PERSIST=bugzilla, orMY_REVIEWS_PERSIST=githubwrites raw responses totests/utils/*-<endpoint>.json.MY_REVIEWS_LOG=1logs responses to stdout.
- Update Jest snapshots after fixture or output changes with:
npm test -- -u # or to target a single suite: npm test -- --runTestsByPath tests/cli.test.mjs -u
Publishing
To publish a new version to npm, login to npm via npm login then helper script from the repo root:
./publish.sh [patch|minor|major]