Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug]: graphify tree ignores the repo tag on merged graphs: no per-repo roots, and identical relative paths from different repos collapse together

クローズ 初心者向け
#4,524 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

  • #4525 @AromalBiju1 による — マージされずにクローズ
  • #4541 @omsenjalia による — マージされずにクローズ

評価

難易度
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 の本文から書いたものです。

説明

bug
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:

  1. There are no per-repo roots. The root is the common prefix of the repo-relative source_file values, which is empty when the repos differ, so the viewer title is "/".
  2. Files that share a repo-relative path in different repos (e.g. src/engine.py in 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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Graphify-Labs/graphify のほかの issue

Graphify-Labs/graphify の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。