⚘ use your pds as a git remote if you want to ⚘
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

remote test'

notplants 9321eb01 adbd7fe8

+268
+134
scripts/remote-test/MANUAL-TEST.md
··· 1 + # Manual Testing Against a Remote PDS 2 + 3 + Step-by-step guide for testing `git-remote-pds` against a real Bluesky PDS. 4 + 5 + ## Prerequisites 6 + 7 + 1. Build the binary: 8 + 9 + ```bash 10 + cd pds-git-remote 11 + cargo build 12 + ``` 13 + 14 + 2. Add the binary to your PATH: 15 + 16 + ```bash 17 + export PATH="$(cargo metadata --format-version 1 --no-deps \ 18 + | python3 -c 'import sys,json; print(json.load(sys.stdin)["target_directory"])')/debug:${PATH}" 19 + ``` 20 + 21 + 3. Confirm the PDS is reachable: 22 + 23 + ```bash 24 + curl https://YOUR-PDS-URL/xrpc/_health 25 + # Should return: {"version":"..."} 26 + ``` 27 + 28 + ## 1. Login 29 + 30 + ```bash 31 + git-remote-pds auth login --pds-url https://YOUR-PDS-URL --handle YOUR-HANDLE 32 + # Enter your password when prompted (or set PDS_PASSWORD env var) 33 + ``` 34 + 35 + Verify stored credentials: 36 + 37 + ```bash 38 + git-remote-pds auth status 39 + ``` 40 + 41 + ## 2. Create a Test Repo 42 + 43 + ```bash 44 + mkdir /tmp/pds-manual-test && cd /tmp/pds-manual-test 45 + git init 46 + git checkout -b main 47 + 48 + echo "hello world" > README.md 49 + mkdir src 50 + echo 'fn main() { println!("test"); }' > src/main.rs 51 + git add . 52 + git commit -m "initial commit" 53 + ``` 54 + 55 + ## 3. Push to PDS 56 + 57 + ```bash 58 + git remote add pds "pds://YOUR-HANDLE/manual-test-$(date +%s)" 59 + git push pds main 60 + ``` 61 + 62 + The remote URL format is `pds://HANDLE/REPO-NAME`. Using a timestamp suffix 63 + avoids collisions with previous test runs. 64 + 65 + ## 4. Clone from PDS 66 + 67 + In a separate directory, clone from the same remote URL you pushed to: 68 + 69 + ```bash 70 + cd /tmp 71 + git clone "pds://YOUR-HANDLE/REPO-NAME" pds-manual-clone 72 + ``` 73 + 74 + Replace `REPO-NAME` with the full name from step 3 (including the timestamp). 75 + 76 + Verify files match: 77 + 78 + ```bash 79 + diff /tmp/pds-manual-test/README.md /tmp/pds-manual-clone/README.md 80 + diff /tmp/pds-manual-test/src/main.rs /tmp/pds-manual-clone/src/main.rs 81 + ``` 82 + 83 + ## 5. Incremental Push + Fetch 84 + 85 + Add another commit to the original repo: 86 + 87 + ```bash 88 + cd /tmp/pds-manual-test 89 + echo "new file" > file2.txt 90 + git add . 91 + git commit -m "second commit" 92 + git push pds main 93 + ``` 94 + 95 + Fetch into the clone: 96 + 97 + ```bash 98 + cd /tmp/pds-manual-clone 99 + git fetch origin 100 + git merge --ff-only origin/main 101 + ``` 102 + 103 + Verify the new file arrived: 104 + 105 + ```bash 106 + diff /tmp/pds-manual-test/file2.txt /tmp/pds-manual-clone/file2.txt 107 + ``` 108 + 109 + ## 6. Cleanup 110 + 111 + Remove local test directories: 112 + 113 + ```bash 114 + rm -rf /tmp/pds-manual-test /tmp/pds-manual-clone 115 + ``` 116 + 117 + Records left on the PDS are harmless — each test run uses a unique repo name. 118 + 119 + To log out: 120 + 121 + ```bash 122 + git-remote-pds auth logout --handle YOUR-HANDLE 123 + ``` 124 + 125 + ## Automated Alternative 126 + 127 + The `run.sh` script in this directory automates all the above steps: 128 + 129 + ```bash 130 + PDS_URL=https://YOUR-PDS-URL \ 131 + PDS_HANDLE=YOUR-HANDLE \ 132 + PDS_PASSWORD=your-password \ 133 + bash pds-git-remote/scripts/remote-test/run.sh 134 + ```
+134
scripts/remote-test/run.sh
··· 1 + #!/usr/bin/env bash 2 + # Tests git-remote-pds against a remote PDS. 3 + # 4 + # Unlike run-e2e.sh, this does NOT start/stop/reset the PDS — it assumes 5 + # the PDS is already running at PDS_URL with the given account. 6 + # 7 + # Usage: 8 + # PDS_URL=https://my-pds.example.com PDS_HANDLE=alice.my-pds.example.com PDS_PASSWORD=secret ./run.sh 9 + # 10 + # Environment variables: 11 + # PDS_URL — full URL of the PDS (required) 12 + # PDS_HANDLE — AT Protocol handle (required) 13 + # PDS_PASSWORD — account password (required) 14 + set -euo pipefail 15 + 16 + SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" 17 + CRATE_DIR="$(cd "${SCRIPT_DIR}/../.." && pwd)" 18 + 19 + # ── check required env vars ────────────────────────────────────────── 20 + for var in PDS_URL PDS_HANDLE PDS_PASSWORD; do 21 + if [ -z "${!var:-}" ]; then 22 + echo "ERROR: ${var} is not set" 23 + echo "Usage: PDS_URL=https://... PDS_HANDLE=alice.example PDS_PASSWORD=secret $0" 24 + exit 1 25 + fi 26 + done 27 + 28 + echo "PDS_URL = ${PDS_URL}" 29 + echo "PDS_HANDLE = ${PDS_HANDLE}" 30 + echo "" 31 + 32 + # ── unique rkey to avoid collisions across runs ────────────────────── 33 + RKEY="test-$(date +%s%N)" 34 + REPO_NAME="${RKEY}" 35 + 36 + # ── temp dirs, cleaned up on exit ──────────────────────────────────── 37 + TMPDIR_BASE="$(mktemp -d)" 38 + cleanup() { 39 + echo "" 40 + echo "Cleaning up temp dirs..." 41 + rm -rf "${TMPDIR_BASE}" 42 + } 43 + trap cleanup EXIT 44 + 45 + PUSH_REPO="${TMPDIR_BASE}/push-repo" 46 + CLONE_REPO="${TMPDIR_BASE}/clone-repo" 47 + FETCH_REPO="${TMPDIR_BASE}/fetch-repo" 48 + 49 + # ── build the binary ───────────────────────────────────────────────── 50 + echo "=== Building git-remote-pds ===" 51 + cargo build -p pds-git-remote --quiet 52 + BINARY="$(cargo metadata --format-version 1 --no-deps \ 53 + | python3 -c 'import sys,json; print(json.load(sys.stdin)["target_directory"])')/debug/git-remote-pds" 54 + 55 + if [ ! -x "${BINARY}" ]; then 56 + echo "ERROR: binary not found at ${BINARY}" 57 + exit 1 58 + fi 59 + echo "Binary: ${BINARY}" 60 + echo "" 61 + 62 + # put the binary on PATH so git can find it as a remote helper 63 + export PATH="$(dirname "${BINARY}"):${PATH}" 64 + 65 + # ── verify PDS is reachable ────────────────────────────────────────── 66 + echo "=== Checking PDS health ===" 67 + HEALTH=$(curl -sf "${PDS_URL}/xrpc/_health" 2>&1) || { 68 + echo "ERROR: PDS not reachable at ${PDS_URL}/xrpc/_health" 69 + echo "Response: ${HEALTH}" 70 + exit 1 71 + } 72 + echo "PDS health: ${HEALTH}" 73 + echo "" 74 + 75 + # ── verify login works ─────────────────────────────────────────────── 76 + echo "=== Verifying login ===" 77 + echo "${PDS_PASSWORD}" | "${BINARY}" auth login \ 78 + --pds-url "${PDS_URL}" --handle "${PDS_HANDLE}" 79 + echo "Login OK" 80 + echo "" 81 + 82 + # ── test push ──────────────────────────────────────────────────────── 83 + echo "=== Test: initial push ===" 84 + mkdir -p "${PUSH_REPO}" 85 + cd "${PUSH_REPO}" 86 + git init --quiet 87 + git checkout -b main 88 + 89 + echo "hello from remote test" > file.txt 90 + mkdir -p subdir 91 + echo "nested content" > subdir/nested.txt 92 + git add . 93 + git commit --quiet -m "initial commit" 94 + 95 + REMOTE_URL="pds://${PDS_HANDLE}/${REPO_NAME}" 96 + git remote add pds "${REMOTE_URL}" 97 + git push pds main 98 + 99 + echo "Push OK" 100 + echo "" 101 + 102 + # ── test clone ─────────────────────────────────────────────────────── 103 + echo "=== Test: clone ===" 104 + cd "${TMPDIR_BASE}" 105 + git clone "${REMOTE_URL}" clone-repo 106 + 107 + # verify files match 108 + diff "${PUSH_REPO}/file.txt" "${CLONE_REPO}/file.txt" 109 + diff "${PUSH_REPO}/subdir/nested.txt" "${CLONE_REPO}/subdir/nested.txt" 110 + echo "Clone OK — files match" 111 + echo "" 112 + 113 + # ── test incremental push + fetch ──────────────────────────────────── 114 + echo "=== Test: incremental push ===" 115 + cd "${PUSH_REPO}" 116 + echo "second commit content" > file2.txt 117 + git add . 118 + git commit --quiet -m "second commit" 119 + git push pds main 120 + 121 + echo "Incremental push OK" 122 + echo "" 123 + 124 + echo "=== Test: fetch into clone ===" 125 + cd "${CLONE_REPO}" 126 + git fetch origin 127 + git merge --ff-only origin/main 128 + 129 + diff "${PUSH_REPO}/file2.txt" "${CLONE_REPO}/file2.txt" 130 + echo "Fetch OK — incremental content matches" 131 + echo "" 132 + 133 + # ── done ───────────────────────────────────────────────────────────── 134 + echo "=== All remote tests passed ==="