G
Graphify
graphify.homes
PR impact analysis

PR impact analysis with a code knowledge graph

A pull request diff shows which lines changed. It does not show everything those lines touch. Graph-based PR impact analysis uses the repository structure to find likely callers, dependents, affected communities, and tests before review begins. Graphify can produce that evidence from a code graph and print it locally with graphify prs, or post a structured impact summary into a pull request workflow. The result is a review map, not a proof that the change is safe.

Published Updated

Graphify outputs
graph.html
graph.json
GRAPH_REPORT.md

Graphify stores inspectable artifacts so codebase knowledge can be reviewed by humans and reused by AI coding assistants.

A pull-request change ripple spreading through a codebase dependency atlas

Input

A code graph

Repository structure supplies callers, dependencies, communities, and file relationships beyond the diff.

Output

Review evidence

A concise impact summary points reviewers to affected areas and tests before they open the patch.

Limit

Structural estimate

Dynamic and external callers may be missing, so the map guides verification rather than replacing tests.

What is PR impact analysis?

PR impact analysis estimates what a pull request can reach: callers of changed symbols, dependent files, affected packages, related communities, and tests that may cover the change. It adds structural context to the diff so reviewers know where to look before they approve or merge.

  • Map changed files to symbols and relationships.
  • Find direct and nearby dependents.
  • Group affected areas into reviewable communities.
  • Connect the change to tests and supporting documentation.

Why is a diff not enough?

A diff is local to changed lines. A small signature change can affect callers several modules away, and a generated client can hide a contract change behind a clean patch. The graph supplies a wider candidate set, which helps reviewers choose tests and inspect the right boundaries.

  • A one-line change can alter a public contract.
  • Dynamic calls may not appear in the diff.
  • Generated code can hide the real source change.
  • Tests may cover the behavior without naming the changed symbol.

How does Graphify produce a PR impact report?

The open-source workflow builds a code graph, then runs graphify prs for a pull request number. The command reads the PR through the GitHub CLI and prints status, branch, CI, graph impact, affected communities, and changed files. It can also compare against another base branch or inspect conflicts.

  • Build the graph before asking for impact.
  • Authenticate the GitHub CLI for private repositories.
  • Use the graph revision that matches the base branch.
  • Read the impact summary as a set of candidates to verify.

How do you post impact comments on every PR?

The documented GitHub Actions recipe checks out the repository, installs graphifyy, builds a code-only graph, writes graphify prs output to a Markdown file, and uses gh pr comment with edit-last and create-if-none. The job needs only contents and pull-request permissions.

  • Use fetch-depth: 0 so the workflow can compare history.
  • Build with --code-only when no model inputs are needed.
  • Write the command output into a stable comment body.
  • Update one comment instead of adding a new comment on every push.

What should reviewers do with the impact report?

Start with the changed files, then inspect the most connected dependents and the tests that cover the affected behavior. Use the report to prioritize reading and test selection. Do not treat a large impact count as a defect or a small impact count as proof of safety.

  • Check the highest-risk public contracts first.
  • Open the affected caller and dependent files.
  • Confirm tests exercise the changed behavior.
  • Look for generated or dynamic paths the graph may miss.
  • Record any unresolved uncertainty in the review.

How should a team handle false positives?

A graph impact report is intentionally conservative. Similar names, broad references, or generated relationships can add candidates that are not real runtime dependencies. Treat them as review prompts, and document recurring false positives so the graph filters and extraction rules can improve.

  • Verify the edge type and confidence before acting.
  • Distinguish direct calls from references or containment.
  • Exclude generated and vendored directories deliberately.
  • Review recurring noise after several pull requests.

What about dynamic and external callers?

Static graphs can miss reflection, runtime registration, dynamic imports, external clients, and code generated outside the repository. The documented Graphify impact view explicitly says dynamic and external callers may not be represented. The review process should keep an explicit checklist for these paths.

  • Check dependency-injection and plugin registration.
  • Look for generated clients and schema-driven code.
  • Search for external API or message contracts.
  • Run integration tests where static evidence ends.

How does PR impact analysis improve review quality?

It gives reviewers a consistent starting point and reduces the chance that a distant caller is missed. It also creates a shared artifact that authors, reviewers, and AI assistants can discuss. The quality gain comes from matching the graph's revision to the base commit and verifying the evidence.

  • Use one impact artifact across author and reviewer workflows.
  • Attach file and symbol references to each risk.
  • Compare impact with the tests that actually ran.
  • Track false negatives as well as false positives.

What is a safe rollout plan?

Start on a small set of active repositories, compare impact comments with human review findings for several weeks, and tune filters before enabling the workflow everywhere. Keep the graph build and comment permissions read-only except for the PR comment itself.

  • Pilot on three representative repositories.
  • Measure missed dependencies and comment noise.
  • Tune exclusions and graph depth.
  • Document the escalation path for ambiguous cases.
  • Review access tokens and retention before wider rollout.

How should PR impact analysis fit into CI without adding noise?

Run the graph and impact report as an advisory signal first, not a required check that blocks every pull request. Publish a concise comment with the changed files, affected dependency paths, confidence, and the tests that actually ran. Keep the full report as an artifact for reviewers who need detail. Once the team measures false positives and missed dependencies, it can decide whether any high-confidence condition deserves a required check.

  • Start advisory and keep the review comment short enough to read.
  • Attach the complete report as a CI artifact or job summary.
  • Separate graph impact from compile, test, and security gates.
  • Let a maintainer suppress noisy paths with a documented reason.
  • Do not block on an inferred edge without source-level confirmation.

What evidence belongs in a useful PR impact comment?

A useful comment answers what changed, what the graph believes is connected, why that connection matters, and what remains uncertain. It should include the base revision, changed symbols or files, affected communities or packages, nearby tests, and any dynamic or external callers the graph cannot see. The comment should point reviewers to source rather than replace the diff.

  • Name the PR number, base branch, and graph revision.
  • List changed symbols and the impacted dependency paths.
  • Show confidence and distinguish extracted from inferred edges.
  • Link affected tests, owners, and relevant documentation.
  • State known blind spots for dynamic or external callers.

How should a team measure whether impact analysis works?

Compare impact reports with accepted review findings over a representative period. Track missed dependencies, time spent locating owners or tests, reviewer disagreement, and how often the comment changes an action. A workflow that produces impressive diagrams but never affects review is not working. Retire or tune it when the evidence does not justify the maintenance burden.

  • Sample merged PRs and check whether reported impact was acknowledged.
  • Ask reviewers to mark false positives with a short reason.
  • Track missed cross-package dependencies that appeared in review.
  • Measure time spent identifying affected tests and owners.
  • Review the workflow after a migration or package-boundary change.
Working commands

How do the setup commands fit together?

Read impact locally

Shell
uv tool install --python 3.12 graphifyy
graphify extract . --code-only
graphify prs 123

Post one impact comment in CI

GitHub Actions
uv tool install --python 3.12 graphifyy
graphify extract . --code-only
graphify prs ${{ github.event.pull_request.number }} > impact.md
gh pr comment ${{ github.event.pull_request.number }} --body-file impact.md --edit-last --create-if-none
FAQ

Frequently asked questions

Does graphify prs need a model API key?

The documented CI recipe uses graphify extract . --code-only, which parses code with tree-sitter and needs no model credential.

What does graphify prs output?

The documented output includes PR status, branch, CI, graph impact counts, affected communities, and changed files.

Is the impact count a defect count?

No. It is a structural estimate of what the change can reach. Reviewers still need to inspect evidence and run tests.

Can the workflow use another base branch?

Yes. The documented graphify prs command supports a --base option for a different comparison branch.

Why might a real dependency be missing?

Dynamic imports, reflection, external clients, and generated code may not be represented in a static graph. Keep explicit checks for those paths.

Does the PR workflow modify source code?

The documented workflow builds a graph, writes a report, and comments on the PR. It does not need write permission to repository contents.

Can PR impact analysis run on forked pull requests?

Forked PRs often have reduced token and secret permissions, which can prevent graph builds or comments. Do not expose a high-privilege token just to make the workflow work. Run the analysis in a trusted context, publish only a safe artifact, or document that fork PRs receive a reduced check until an approved workflow handles them.

How much history does a PR impact report need?

The workflow needs the changed revision and enough repository structure to build the graph; it does not need to reconstruct every historical decision. Compare the base and head revisions consistently, and state which sources were unavailable. If a shallow checkout omits files required by the parser, the report should disclose the incomplete input rather than implying full coverage.

How long should generated PR impact artifacts be retained?

Retention should match the review's usefulness and the repository's data policy. A short-lived CI artifact may be enough for the active discussion, while an accepted decision record may need a longer human-readable summary. Avoid retaining generated graph data indefinitely without an owner, deletion path, and clarity about whether it contains sensitive source structure.

Key takeaways

What should you remember?

  • PR impact analysis adds structural reach to the changed-line view.
  • Use the graph as a conservative review map, not as proof of safety.
  • Post one updated comment per PR and keep CI permissions minimal.
Sources

Where can you verify the details?

Related Graphify guides

Continue through the Graphify topic cluster with pages that explain assistant context, architecture review, documentation, and graph-based codebase understanding.

Turn this concept into a real project graph

Start from the use cases page or upload a project ZIP to build a graph that your team can inspect and reuse.