fix: use indexed commit in generated editor files - #1875
Conversation
|
✅ Health of changed files: 5.0 (unchanged) 📋 At a glance Files & modules (2)
✅ Health gate: passed 📌 Before you merge
🔎 More signals (2)🗺️ Change map flowchart LR
subgraph PR ["Changed in this PR (1 with dependents)"]
f_packages_core_src_repowise_core_generation_editor_files_fetcher_py[".../editor_files/fetcher.py 🔥"]:::changed
end
f_packages_cli_src_repowise_cli_commands_status_cmd_py[".../commands/status_cmd.py"]
f_packages_core_src_repowise_core_generation_editor_files_fetcher_py --> f_packages_cli_src_repowise_cli_commands_status_cmd_py
f_packages_core_src_repowise_core_generation_editor_files___init___py[".../editor_files/__init__.py"]
f_packages_core_src_repowise_core_generation_editor_files_fetcher_py --> f_packages_core_src_repowise_core_generation_editor_files___init___py
t_tests_unit_generation_test_editor_fetcher_helpers_py(["✅ .../generation/test_editor_fetcher_helpers.py"]):::guard
t_tests_unit_generation_test_editor_fetcher_helpers_py -.-> f_packages_core_src_repowise_core_generation_editor_files_fetcher_py
classDef changed fill:#dbeafe,stroke:#1d4ed8,color:#1e3a5f
classDef warn fill:#fef3c7,stroke:#b45309,color:#78350f
classDef guard fill:#dcfce7,stroke:#15803d,color:#14532d
Solid arrows: code that imports the changed files (2 direct dependents, from the last indexed snapshot). Dashed: history/tests. 🔥 Hotspots touched (2)
👀 Suggested reviewers @RaghavChamadiya 📊 See the full report for this PR |
b56d9f6 to
4f39f33
Compare
|
Thanks @mikemikimike, you got to #1874 first and your read of it was right: the stamp has to come from I went with #1877 for this one, and it was close enough that I want to say why rather than leave you guessing. Three PRs landed on the same one-line change within a few hours, so the production diff did not separate them. What did was the fallback: One thing worth carrying forward. Your test sets Your #1881 is the trailing-glob fix I am taking over the other PR on that one, so this is not a pattern. Closing this as covered by #1877. |
Summary
head_commitwhen rendering the indexed commit in generated editor filesFixes #1874
Root cause
EditorFileDataFetcher.fetch()already loaded theRepositoryrow but discarded its indexedhead_commitand queried the checkout's currentgit HEAD. Rebases or later commits could therefore make the generatedCLAUDE.mdstamp describe a different commit than the index.Validation
uv run --frozen pytest tests/unit/generation/test_editor_file_fetcher.py tests/unit/generation/test_editor_fetcher_helpers.py -q— 23 passed (136 Python 3.14 / pytest-asyncio deprecation warnings)uv run --frozen ruff check packages/core/src/repowise/core/generation/editor_files/fetcher.py tests/unit/generation/test_editor_file_fetcher.py— passedgit diff --check— passedThe regression test exercises the real SQLAlchemy
Repositoryobject returned by the existing fixture and verifies the stored commit takes precedence over the live checkout fallback. No real LLM or external service is required.