Skip to content

Take only the tag from the googletest GIT_TAG line - #446

Closed
philipcraig wants to merge 1 commit into
mainfrom
googletest-tag-extraction-445
Closed

philipcraig wants to merge 1 commit into
mainfrom
googletest-tag-extraction-445

Conversation

@philipcraig

Copy link
Copy Markdown
Collaborator

Part of #445.

  • docker/Dockerfile passed the whole rest of the GIT_TAG line to git clone --branch. A CRLF checkout, a trailing # comment or a second GIT_TAG line made the clone fail with "Remote branch not found".
  • The sed expression now captures the tag alone, accepts tab indentation, ignores a longer keyword such as GIT_TAGGED, and stops at the first match, so it needs no pipe to head.
  • The rest of Harden the sandbox image's googletest tag extraction and .dockerignore #445 overlaps Tell contributors when the sandbox image is stale #444, which deletes .dockerignore and rewrites the bazel fetch comment. This change touches neither, so the two merge cleanly in either order.

The sandbox image passed the whole rest of the GIT_TAG line to
git clone --branch, so a CRLF checkout, a trailing comment or a second
GIT_TAG line made the clone fail with "Remote branch not found". The sed
expression now captures the tag alone, accepts tab indentation and stops
at the first match.

Part of #445.
@philipcraig
philipcraig marked this pull request as ready for review September 20, 2026 09:31
@philipcraig
philipcraig requested a review from jbcoe as a code owner September 20, 2026 09:31
@philipcraig

Copy link
Copy Markdown
Collaborator Author

Folded into #444 as 7cecd46, a cherry-pick of this PR's commit, so the sandbox image changes land together. #444 now closes #445. Closing this one.

philipcraig added a commit that referenced this pull request Sep 20, 2026
Closes #441. Closes #445.

- `scripts/agentic-sandbox.py` labels the image with a hash of its
inputs and prints a one-line hint to pass `--rebuild-docker` when the
hash no longer matches. It never rebuilds on its own. An image with no
label, such as one built before #392, counts as stale.
- The inputs are `docker/Dockerfile`, `.bazelversion`, `MODULE.bazel`,
`MODULE.bazel.lock`, `pyproject.toml`, `uv.lock` and the googletest
`GIT_TAG` in `CMakeLists.txt`. Only the tag is hashed from
`CMakeLists.txt`, so adding a test does not raise the hint.
- The `bazel fetch` layer mounts only the files that define the graph,
which need no sources. That removes `.dockerignore` and the
whole-checkout mount, and an ordinary source edit no longer invalidates
the layer. `BUILD.bazel` and `.bazelrc` are mounted but not hashed: a
new dependency has to change `MODULE.bazel` as well.
- `CONTRIBUTING.md` lists the inputs once, states the network fallback
and the googletest exception, and the `.bazelversion` rule near the top
now points there.
- The Docker workflow drops `.dockerignore` from its `paths` filters.

From #445:

- The googletest clone takes only the tag from the first `GIT_TAG` line,
so a CRLF checkout, a trailing comment or a second `GIT_TAG` line no
longer breaks `git clone --branch`. This is the commit from #446.
- The `bazel fetch` comment now says that any `CMakeLists.txt` edit
re-clones googletest and re-runs the fetch, and notes the repository
cache and output base the layer captures.
- The two `.dockerignore` items are moot, because this PR deletes the
file.

---------

Co-authored-by: Jonathan B. Coe <jonathanbcoe@gmail.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