[Bug]: graphify tree ignores the repo tag on merged graphs: no per-repo roots, and identical relative paths from different repos collapse together
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
tree_html.py の build_tree から始めます。ここでは現在、マージされたノードの repo 属性が無視されています。次に、tests/test_tree_html.py のツリーのテストを読みます。src/engine.py を共有する2つの repo で再現し、それぞれのノードが1つのファイルノードにまとめられるか確認します。ツリーに repo ごとのルートが個別に表示され、--root を指定した場合も含め、各 repo のディレクトリとファイルの階層が保たれれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Pre-flight checks
- I have checked the Troubleshooting section in the README
What happened?
On a graph produced by graphify merge-graphs, graphify tree does not use the repo attribute that merge-graphs sets on every node. As a result:
- There are no per-repo roots. The root is the common prefix of the repo-relative
source_filevalues, which is empty when the repos differ, so the viewer title is "/". - Files that share a repo-relative path in different repos (e.g.
src/engine.pyin both) collapse into ONE file node with all of their symbols interleaved.
Expected: each repo tag is a top-level root with its own directory/file hierarchy built from that repo's relative paths. This would also fix --root on merged graphs, since each repo subtree would be anchored by its tag rather than an absolute path.
Steps to reproduce
1. Create two graph.json files (repo-a, repo-b) whose nodes have source_file "src/engine.py".
2. graphify merge-graphs repo-a/graphify-out/graph.json repo-b/graphify-out/graph.json --out world/graphify-out/graph.json
3. graphify tree --graph world/graphify-out/graph.json --output WORLD_TREE.html
4. Or inspect directly: python3 -c "import json; from graphify.tree_html import build_tree; print(build_tree(json.load(open('world/graphify-out/graph.json'))))"
Merged nodes do carry `repo: "repo-a"` / `"repo-b"` and `local_id`, so the data needed to group by repo is present. tree_html.py never reads `repo`.
Error output or graph output
build_tree output (name, total_count), both repos sharing src/engine.py:
engine.py (8)
src (8)
engine.py (8)
Cls (1) x4
fn (1) x4
Symbols from repo-a and repo-b are mixed under one file node. Viewer title: "/".
Graphify version
0.9.92
Operating System
Linux
Python Version
3.13
Installation Method
uv tool install (recommended)
Additional Environment Details
No provider environment variables set. Reproduced on a fresh shallow clone of main at the 0.9.92 release commit.Also reproduced with a fresh uv venv; same result.”
Additional context
Suggested fix: in build_tree (tree_html.py), if nodes carry repo, group by it first and build each repo's subtree independently under a root named after the tag. A test in tests/test_tree_html.py with two repos sharing a relative path would cover it.
Related to #4522 (merged-graph tree rendering), but a different cause: here source_file is intact and the repo tag is simply unused by tree.
- 主要言語
- Python
- スター
- 124k
- フォーク
- 11.9k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Graphify-Labs/graphify のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Graphify-Labs/graphify#4831 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 75/100
Graphify-Labs/graphify#4829 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
hooks: last-resort `python3` probe launches the Microsoft Store redirector on Windows (visible console flash, exit 9009)対応中かも @Deepjyoti-Sarmah が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Graphify-Labs/graphify#4563 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
GRAPHIFY_DISABLE_THINKING is ignored by the claude backend, so thinking eats max_tokens and extraction truncates対応中かも @bercedev が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
Graphify-Labs/graphify#4546 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
--update runbook: graph.json backup instruction comes after the diff that needs it, so the graph diff never runs対応中かも @sunildivakar96-cpu が 9 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Graphify-Labs/graphify#4539 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
Graphify-Labs/graphify の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
letsencrypt/cp-cps#361 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
CI: startup_failure because callers grant fewer permissions than ledger-app-workflows@v1 declares対応中かも @maykonmichel が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
LedgerHQ/app-boilerplate-rust#227 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
linuxmint/mintupdate#1107 ·