Skip to content

Fix feedback: default-branch detection, tests out of the box, self-ignoring .junior/.gitignore - #8

Draft
mishachepi wants to merge 3 commits into
mainfrom
feedback-fixes
Draft

Fix feedback: default-branch detection, tests out of the box, self-ignoring .junior/.gitignore#8
mishachepi wants to merge 3 commits into
mainfrom
feedback-fixes

Conversation

@mishachepi

Copy link
Copy Markdown
Owner

Три фикса по репортам из feedback/ (тестирование junior на стороннем репозитории), каждый отдельным коммитом:

1. fix(collect) — определение default branch репозитория

На master-репозитории захардкоженный дефолт main давал три обречённые попытки диффа с warning'ами. Теперь настроенная target branch валидируется: если её нет, junior резолвит дефолтную ветку репо (origin/HEADmain/master). Промежуточные кандидаты логируются на debug, итоговый источник диффа — одной info-строкой.

2. fix(tests) — тесты работают на свежем клоне

  • dev-инструменты перенесены из extra dev в PEP 735 [dependency-groups] — uv ставит группу по умолчанию, uv run pytest -q просто работает;
  • опциональные импорты (httpx, openai, gitlab) в тестах защищены importorskip — отсутствующий extra скипает тесты, а не убивает collection;
  • conftest.py фиксирует детерминированное терминальное окружение: внешний FORCE_COLOR (типично для CI) ломал assertions на help-текст.

3. feat(run_record) — self-ignoring .junior/.gitignore

Первый записанный run record кладёт рядом .junior/.gitignore (output/ + сам файл) — ?? .junior/ больше не появляется в git status host-репозитория. runbooks//prompts/ остаются трекаемыми, существующий .gitignore не перезаписывается.

Проверено

  • uv run pytest -q на чистом venv без extras: 304 passed, 6 skipped (раньше — падение collection);
  • uv run --all-extras pytest -q: 325 passed;
  • uv run ruff check src/ tests/: чисто;
  • docs-site: npm run build — 25 страниц;
  • вживую на временном master-репозитории: вместо трёх warning — одна info-строка о подмене ветки, .junior/ не виден в git status.

🤖 Generated with Claude Code

mishachepi and others added 3 commits July 19, 2026 15:40
…ates

On a master-based repo the hardcoded 'main' default produced three doomed
diff attempts, each logged as a warning, before falling back to the
working diff. Now the configured target branch is validated first: when
it doesn't exist, the repo default branch is resolved via origin/HEAD,
falling back to whichever of main/master exists. Failed diff candidates
in auto mode log at debug; one info line reports the diff source used.

Closes feedback/01-default-branch-detection.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Move dev tooling from the 'dev' extra to a PEP 735 dependency group:
  uv installs it by default, so plain 'uv run pytest -q' works.
- Guard optional platform/SDK imports (httpx, openai, gitlab) with
  pytest.importorskip so a missing extra skips those tests instead of
  killing the whole collection run — matching the runtime's lazy-import
  philosophy.
- Pin a deterministic terminal env in conftest.py: ambient FORCE_COLOR
  (common in CI) made rich emit ANSI inside CliRunner captures and broke
  help-text/table assertions.

Closes feedback/02-test-suite-out-of-the-box.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Every run writes .junior/output/{ts}.json, which showed up as
'?? .junior/' untracked noise in any repo junior reviews — each host
repo had to gitignore it by hand. On first record write junior now
drops a .junior/.gitignore covering output/ and itself (so the
directory disappears from git status entirely), while runbooks/ and
prompts/ stay trackable. An existing .junior/.gitignore is never
overwritten.

Closes feedback/03-junior-output-gitignore.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant