Skip to content

fix: mount .git folder to itk for local runs#940

Closed
kdziedzic70 wants to merge 1 commit into1.0-devfrom
mount-git-folder-to-itk
Closed

fix: mount .git folder to itk for local runs#940
kdziedzic70 wants to merge 1 commit into1.0-devfrom
mount-git-folder-to-itk

Conversation

@kdziedzic70
Copy link
Copy Markdown
Contributor

Description

.git folder needs to be mounted in order to recognize git project for local runs

  • Follow the CONTRIBUTING Guide.
  • Make your Pull Request title in the https://www.conventionalcommits.org/ specification.
    • Important Prefixes for release-please:
      • fix: which represents bug fixes, and correlates to a SemVer patch.
      • feat: represents a new feature, and correlates to a SemVer minor.
      • feat!:, or fix!:, refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a SemVer major.
  • Ensure the tests and linter pass (Run bash scripts/format.sh from the repository root to format)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@kdziedzic70 kdziedzic70 requested a review from a team as a code owner April 7, 2026 12:46
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the itk/run_itk.sh script to automate the A2A_SAMPLES_REVISION assignment and mount the .git directory into the Docker container. The review identifies a logic error in the REPO_ROOT path calculation and suggests a more robust method for parsing the revision string from the YAML file to handle quotes and comments.

Comment thread itk/run_itk.sh Outdated
# Mounting a2a-python as repo and itk as current agent
A2A_PYTHON_ROOT=$(cd .. && pwd)
ITK_DIR=$(pwd)
REPO_ROOT=$(cd ../.. && pwd)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

REPO_ROOT is calculated as ../../, which points to the directory above the repository root (since itk/run_itk.sh is located in the itk/ subdirectory). The .git directory is typically located at the repository root, which is already captured by A2A_PYTHON_ROOT (../). Using ../../ will likely result in a non-existent or incorrect .git path being mounted.

Suggested change
REPO_ROOT=$(cd ../.. && pwd)
REPO_ROOT=$A2A_PYTHON_ROOT

Comment thread itk/run_itk.sh

# 1. Pull a2a-samples and checkout revision
: "${A2A_SAMPLES_REVISION:?A2A_SAMPLES_REVISION environment variable must be set}"
: "${A2A_SAMPLES_REVISION:=$(grep "A2A_SAMPLES_REVISION:" ../.github/workflows/itk.yaml | head -n 1 | awk '{print $2}')}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

The extraction of A2A_SAMPLES_REVISION from the YAML file might include surrounding quotes (e.g., "v1.0.0") if they are present in the workflow file. This would cause the git checkout command on line 31 to fail. It is safer to strip any quotes from the extracted value. Additionally, using a more specific regex prevents matching commented-out lines.

Suggested change
: "${A2A_SAMPLES_REVISION:=$(grep "A2A_SAMPLES_REVISION:" ../.github/workflows/itk.yaml | head -n 1 | awk '{print $2}')}"
: "${A2A_SAMPLES_REVISION:=$(grep \"^ *A2A_SAMPLES_REVISION:\" ../.github/workflows/itk.yaml | head -n 1 | awk '{print $2}' | tr -d '\"' | tr -d \"'\")}"

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

🧪 Code Coverage (vs 1.0-dev)

⬇️ Download Full Report

No coverage changes.

Generated by coverage-comment.yml

@kdziedzic70 kdziedzic70 force-pushed the mount-git-folder-to-itk branch 4 times, most recently from c5c68f0 to 0d474a0 Compare April 7, 2026 13:45
@kdziedzic70 kdziedzic70 force-pushed the mount-git-folder-to-itk branch from 0d474a0 to 92784a9 Compare April 7, 2026 13:56
@kdziedzic70 kdziedzic70 closed this Apr 7, 2026
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.

2 participants