Playbook: review a change
The question, in the user's words: "This branch changes two credential methods. Before I approve it: what does it reach, which routes and services are affected, and is it tested?"
What you get at the end: for the changed methods together, the size of the change, its callers by name, the routes and other services on the way, and the tests that reach it. Run it from the branch's own folder: a new branch of an indexed folder gets its own copy of the graph.
The steps
1. List the changed methods, from the diff
Take the method names from git diff --stat and the diff itself. Niro does not read git history; it answers about the code as it is on disk.
2. One call for the whole change, then the names
niro ask get_blast_radius method_fqns='["org.keycloak.models.jpa.JpaUserCredentialStore.createCredentialEntity","org.keycloak.models.jpa.JpaUserCredentialStore.removeCredentialEntity"]' answer=count
Blast radius for 2 methods — 46 affected functions, risk: high (+6 in tests, not counted in risk) (upstream 27, downstream 25)
niro ask get_blast_radius method_fqns='[...same two...]' direction=upstream answer=names
upstream:
...
PasswordCredentialProvider.deleteCredential (depth 3)
UserResource.removeCredential (depth 3)
CredentialModelTest.testCredentialCRUD [test] (depth 3)
...
[shown all 27 entries; ask without answer= for signatures and code]
What to look for in review: a REST method on the list (UserResource.removeCredential is the admin API), entries marked "over HTTP" (another service calls it), and whether [test] entries cover both changed methods. Here the six tests sit on the createCredentialEntity side (two of them reach it only in the code as written, not at run time: see Playbook: test a change). For the other method, ask it alone one level further: get_reverse_call_chain method_fqn=...removeCredentialEntity depth=4 answer=locations lists 3 tests at depth 4, among them CredentialModelTest.testCredentialCRUD. The same run-time check applies: the third, at UserStorageTest.java:1017, is inside UserStorageTest.testCredentialCRUD, which uses the federated user, so at run time it does not reach this method either.
3. Did a route change?
Compare the routes of the branch with the main branch, each from its own folder:
niro ask find_api_endpoints path_pattern=/credentials
Run it in both folders and compare the two lists. A route that disappears is a breaking change for every caller.
4. Did a call to another service change?
find_outbound_http_calls in both folders, compared the same way. For a monorepo, get_service_topology shows the links between its services.
Why the answer is deterministic
The reviewer and the author get the same list for the same code, because it is read from the graph rather than from whatever each of them thought to search. The answer says when it stopped at a depth, and how many entries were cut there.
What it does not do
- It is not a pull request review product. Automatic review is hosted Niro only, and review bots cannot reach the local engine. See Review bots and Niro and Features of hosted Niro.
- It does not judge whether the change is right, only what it reaches.
Cost
What these steps cost depends on your code and your question. How Niro counts the size of its answers, and how to measure the cost on your own tasks, is in Tokens, speed and accuracy.
Related
Review changes with Niro, Playbook: "it broke after my change", Playbook: test a change.