Skip to content

Erd 1633 reproduce ci locally tool#31

Open
tomqext wants to merge 62 commits intoERD-1633_reproduce_ci_locallyfrom
ERD-1633_reproduce_ci_locally_tool
Open

Erd 1633 reproduce ci locally tool#31
tomqext wants to merge 62 commits intoERD-1633_reproduce_ci_locallyfrom
ERD-1633_reproduce_ci_locally_tool

Conversation

@tomqext
Copy link
Collaborator

@tomqext tomqext commented Feb 18, 2026

No description provided.

Your Name and others added 30 commits February 18, 2026 00:30
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…prompt

- Ask for optional CI run URL first, extract repo/branch/run ID via GitHub API
- Named sessions: containers are named er_ci_<session_name> for tracking
- Resume existing sessions or start new ones from interactive menu
- Improved CI compare prompt: verify commits match, structured comparison steps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tool

  - Add claude_session.py for launching interactive Claude sessions in CI containers
  - Add ci_context/CLAUDE.md with ROS workspace instructions for in-container Claude
  - Add bin/setup.sh one-command setup script that installs helpers, sets GH_TOKEN, and verifies Claude auth
  - Add "Claude session (interactive)" option to ci_tool CLI menu
  - Add is_claude_installed_in_container() to skip redundant setup on re-entry
  - Add copy_ci_context() to inject CI-specific CLAUDE.md into containers
  - Update .helper_bash_functions to fetch CI_TOOL_DATA_FILES (subdirectory assets)
  - Update merge_helper_vars.py to handle export prefixes and support --set mode
  - Update ci_reproduce.py to not raise on non-zero exit (test failures are expected)
  - Add comprehensive README documentation for ci_tool usage and setup
  - add display_progress.py to render Claude stream-json output with live spinner, tool activity, and elapsed time
  - support resuming previous Claude sessions by reading state file from container
  - make container setup idempotent — skip full install if Claude already present, refresh config only
  - inject resume_claude bash function into container for interactive session resumption
  - install Python deps (rich) in container for display script
  - simplify parse_fix_args by removing container-name parsing
  - write session state (session_id, phase, attempt_count) on exit for later resume
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace bash wrapper chain with direct Python Docker orchestration:
- reproduce_ci() takes explicit params instead of args list
- Fetch internal scripts via urllib with auth header
- Validate deps.repos reachable before creating container
- Docker create/start/exec directly from Python
- Container existence guard after execution
- prompt_for_reproduce_args() returns (repo_url, branch, only_needed_deps) tuple
- Rich output with checkmarks and colors
- Graceful KeyboardInterrupt handling during workspace setup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove graphical fallback: fail fast when DISPLAY not set (matches bash)
- Remove skip_preflight param (YAGNI — callers handle preflight)
- Standardize URL format (remove refs/heads/ prefix)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Validate URL prefix before parsing org/repo
- Warn on xhost failure instead of silent swallow
- Document bind-mount temp dir persistence
- Clarify container guard comment

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gather_session_info() collects all user input up front. fix_ci() is
now a linear sequence: gather -> preflight -> reproduce -> claude -> shell.
Fixes the missing repo/branch prompt when CI URL is left blank.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
_handle_reproduce now prompts for repo/branch, handles container
collision, runs preflight, then calls reproduce_ci with explicit params.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds step 5 that downloads ci_tool Python package files, installs
Python dependencies, then execs into ci_tool for immediate use.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused imports from ci_reproduce.py (container collision code was moved to callers)
- Extract prompt_for_repo_and_branch() to eliminate duplicate prompting code between ci_fix.py and ci_reproduce.py
- Extract _handle_container_collision() in cli.py to reduce locals and improve readability
- Fix line-too-long issues in ci_reproduce.py
- Add pylint disable comments for intentional patterns (lazy imports, factory function args)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…handling

- Replace removesuffix/removeprefix with Python 3.8-compatible string ops
  in _parse_repo_url (regression from earlier rewrite)
- Change DEFAULT_SCRIPTS_BRANCH from feature branch to "main"
- Add URL validation and HTTP/URL error handling to extract_info_from_ci_url
- Add duplicate-code pylint disables for shared import blocks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Your Name and others added 30 commits February 18, 2026 18:11
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rich's Live display doesn't work inside docker exec without a PTY.
- Add force_terminal=True so Rich outputs ANSI codes regardless
- Replace Live spinner with direct console.print for tool activity
- Write text deltas directly to stderr (bypasses Rich buffering)
- Extract handle_event and print_session_summary to fix lint warnings

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Allocates a PTY via docker exec -t so Rich spinners and ANSI output
work properly inside the container without needing -i (interactive).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sthrough

THIS_SCRIPT_BRANCH is the er_build_tools branch name, not the
er_build_tools_internal branch name. These are different repos with
different branch names. The default must match the internal repo.

CI_TOOL_SCRIPTS_BRANCH env var override still works for manual testing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Pass quiet=True to docker_exec for Claude streaming calls so the
  raw command with prompt text isn't displayed to the user
- Log all raw stream-json events to /ros_ws/.ci_fix_events.jsonl
  for debugging display issues

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude Code's stream-json uses {type:"assistant", message:{content:[...]}}
not the Anthropic API format (content_block_start/content_block_delta).
Rewrite event handler to match the actual format:
- assistant events: extract text and tool_use from message.content[]
- tool_result events: show completion
- system/result events: extract session_id

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Without IS_SANDBOX=1, Claude refuses to run as root and shows the
login screen instead of resuming the session.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace colcon test-result --verbose with compact failure reporting:
- Skip CTest XMLs (contain entire roslaunch logs) by using
  test_results/ subdirectory as the test-result-base
- Parse JUnit XMLs directly to show only failing test names,
  assertion messages, and tracebacks (first 20 lines)
- All-pass runs show a single summary line

Applies to both the helper bash functions (colcon_test_this_package)
and the rerun_tests function injected into CI containers.
Replace per-tool-invocation lines with a single updating spinner
line showing aggregated tool counts. Prints a one-line tool summary
at session end.
Packages with a .verbose_tests file get live console output
(console_direct+). All other packages run quietly, showing output only
on failure. Applied to both host helper functions and container
rerun_tests function.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Parallel remote log analysis + local reproduction with Rich Live
split-panel display. Remote side filters GH Actions logs with regex
then sends reduced context to Claude haiku. Local side uses existing
reproduce_ci + Claude analysis in container.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add remote-only (fast) sub-mode that skips Docker entirely. User picks
analysis depth via sub-menu after providing GH Actions URL: remote-only
fetches/filters/diagnoses logs with Claude haiku, full mode also
reproduces locally in parallel with split Rich Live display.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Links to docs/plans/2026-02-25-ci-analyse-mode-plan.md for full
implementation details.

Co-Authored-By: Claude Opus 4.6 <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