Skip to content

Resolve update-command-spec-version repo paths dynamically#290

Merged
acarl005 merged 3 commits into
mainfrom
factory/dynamic-repo-paths
Jul 13, 2026
Merged

Resolve update-command-spec-version repo paths dynamically#290
acarl005 merged 3 commits into
mainfrom
factory/dynamic-repo-paths

Conversation

@warp-dev-github-integration

Copy link
Copy Markdown
Contributor

Description

The update-command-spec-version skill's scripts hardcoded fixed repo
locations (~/warp and ~/command-signatures), so they only worked when both
repos happened to be checked out at those exact paths and failed everywhere
else. This resolves both repos dynamically instead.

Changes

  • Added scripts/common.sh, sourced by every bash script, which resolves:
    • command-signatures from the script's own location via
      git rev-parse --show-toplevel (the scripts live inside the repo).
    • warp from $WARP_DIR when set, otherwise a sibling of the
      command-signatures repo (<parent>/warp).
  • Mirrored the command-signatures resolution in list_merged_prs.py.
  • ensure_repos.sh now only fetches the command-signatures checkout it runs
    from (it no longer checkout main + pulls into the user's working tree,
    which is unsafe now that it operates on the real checkout rather than a
    throwaway clone); warp is still cloned if missing, else fetched.
  • Documented the new resolution in SKILL.md.

Validation

  • bash -n on all shell scripts + py_compile on list_merged_prs.py: pass.
  • common.sh resolves correctly both with $WARP_DIR set and unset (falling
    back to the sibling path).
  • End-to-end read-only runs against real checkouts:
    • get_latest_hash.sh returns the command-signatures origin/main hash.
    • get_current_hash.sh reads the warp origin/master:Cargo.toml rev via the
      sibling-resolved WARP_DIR (previously would have failed on ~/warp).
    • list_merged_prs.py resolves its repo dir and runs.

Conversation: https://staging.warp.dev/conversation/b34001b4-4abb-4cb1-be9d-98f75676605e
Run: https://oz.staging.warp.dev/runs/019f5d4d-27c2-750d-823f-90a8b0a92b9c

This PR was generated with Oz.

The update-command-spec-version skill scripts hardcoded ~/warp and
~/command-signatures, so they only worked when both repos happened to be
checked out at those exact paths. Resolve both dynamically instead:

- command-signatures is inferred from the script location via
  git rev-parse --show-toplevel (the scripts live inside the repo).
- warp is taken from $WARP_DIR when set, else assumed to be a sibling of
  command-signatures.

Shared resolution lives in scripts/common.sh (sourced by the bash
scripts) and is mirrored in list_merged_prs.py. ensure_repos.sh now only
fetches the command-signatures checkout it runs from rather than
switching branches / pulling into it.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Jul 13, 2026
@oz-for-oss

oz-for-oss Bot commented Jul 13, 2026

Copy link
Copy Markdown

@warp-dev-github-integration[bot]

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overview

This PR removes hardcoded ~/warp and ~/command-signatures assumptions by adding shared repo-path resolution and wiring the update-command-spec-version scripts to use it. The path resolution approach is reasonable, and I did not find security issues or spec-drift concerns because no approved/repository spec context was provided.

Concerns

  • ensure_repos.sh now avoids mutating the command-signatures working tree, but its generic git fetch origin calls do not guarantee the specific remote refs later consumed by get_latest_hash.sh and get_current_hash.sh are present or fresh in branch-limited/shallow checkouts.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment on lines 10 to 15
echo "Fetching command-signatures (${CMD_SIGS_DIR})..." >&2
git -C "${CMD_SIGS_DIR}" fetch origin

if [ -d "${WARP_DIR}" ]; then
echo "Fetching warp..." >&2
echo "Fetching warp (${WARP_DIR})..." >&2
git -C "${WARP_DIR}" fetch origin

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ [IMPORTANT] Fetch the exact remote refs that later scripts read; git fetch origin follows the checkout's configured refspec, so branch-limited or shallow checkouts can leave origin/main or origin/master missing/stale.

Suggested change
echo "Fetching command-signatures (${CMD_SIGS_DIR})..." >&2
git -C "${CMD_SIGS_DIR}" fetch origin
if [ -d "${WARP_DIR}" ]; then
echo "Fetching warp..." >&2
echo "Fetching warp (${WARP_DIR})..." >&2
git -C "${WARP_DIR}" fetch origin
echo "Fetching command-signatures (${CMD_SIGS_DIR})..." >&2
git -C "${CMD_SIGS_DIR}" fetch origin main:refs/remotes/origin/main
if [ -d "${WARP_DIR}" ]; then
echo "Fetching warp (${WARP_DIR})..." >&2
git -C "${WARP_DIR}" fetch origin master:refs/remotes/origin/master

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in e9cdee2ensure_repos.sh now fetches the exact refs the later scripts read: git -C "${CMD_SIGS_DIR}" fetch origin main:refs/remotes/origin/main and git -C "${WARP_DIR}" fetch origin master:refs/remotes/origin/master, so origin/main / origin/master stay fresh even in branch-limited or shallow checkouts.

oz-agent added 2 commits July 13, 2026 21:20
Address review feedback: a bare 'git fetch origin' follows the checkout's
configured refspec, so branch-limited or shallow clones could leave
origin/main / origin/master (read later by get_latest_hash.sh and
get_current_hash.sh) missing or stale. Fetch each exact ref explicitly.

Co-Authored-By: Oz <oz-agent@warp.dev>
Drop the references to the previous hardcoded ~/warp / ~/command-signatures
paths from the code comments; comments now describe only current behavior.

Co-Authored-By: Oz <oz-agent@warp.dev>
@acarl005 acarl005 merged commit ec1ae8e into main Jul 13, 2026
8 checks passed
@acarl005 acarl005 deleted the factory/dynamic-repo-paths branch July 13, 2026 21:26
acarl005 pushed a commit to warpdotdev/warp that referenced this pull request Jul 13, 2026
## Description

Updates `warp-command-signatures` to ec1ae8e8.

### Merged PRs
- Fix git status parser to handle paths with spaces and renames
(warpdotdev/command-signatures#272)
- fix(git): complete nested untracked files for git add
(warpdotdev/command-signatures#279)
- Resolve update-command-spec-version repo paths dynamically
(warpdotdev/command-signatures#290)

## Changelog Entries for Stable

CHANGELOG-BUG-FIX: Fixed `git status` completion parsing for paths with
spaces and renames, and completion of nested untracked files for `git
add`.

<!-- factory-client:
{"source":"factory-client","slack_channel":"C0BCE7AELJ2","slack_thread_ts":"1783976762.109799","slack_permalink":"https://warpdev.slack.com/archives/C0BCE7AELJ2/p1783976762109799?thread_ts=1783976762.109799&cid=C0BCE7AELJ2","oz_run_id":"019f5d4d-27c2-750d-823f-90a8b0a92b9c","repo":"warpdotdev/warp"}
-->

_Conversation:
https://staging.warp.dev/conversation/b34001b4-4abb-4cb1-be9d-98f75676605e_
_Run:
https://oz.staging.warp.dev/runs/019f5d4d-27c2-750d-823f-90a8b0a92b9c_

_This PR was generated with [Oz](https://warp.dev/oz)._

Co-authored-by: Oz <oz-agent@warp.dev>
@acarl005 acarl005 self-assigned this Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants