-
Notifications
You must be signed in to change notification settings - Fork 168
adds a attribution test script #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,287 @@ | ||||||
| #!/bin/bash | ||||||
| # End-to-end test for attribution tracking with real Claude calls | ||||||
| # Usage: ./scripts/test-attribution-e2e.sh [--keep] | ||||||
| # --keep: Don't delete the test repo after running (for inspection) | ||||||
|
|
||||||
| set -e | ||||||
|
|
||||||
| # Colors for output | ||||||
| RED='\033[0;31m' | ||||||
| GREEN='\033[0;32m' | ||||||
| YELLOW='\033[1;33m' | ||||||
| BLUE='\033[0;34m' | ||||||
| NC='\033[0m' # No Color | ||||||
|
|
||||||
| # Store the CLI directory and build the binary fresh | ||||||
| CLI_DIR="$(cd "$(dirname "$0")/.." && pwd)" | ||||||
| echo -e "${BLUE}Building entire CLI from: $CLI_DIR${NC}" | ||||||
|
|
||||||
| # Build binary to a temp directory and add it to PATH | ||||||
| # This ensures BOTH our direct calls AND Claude's hook calls use the new binary | ||||||
| ENTIRE_BIN_DIR=$(mktemp -d) | ||||||
| ENTIRE_BIN="$ENTIRE_BIN_DIR/entire" | ||||||
| if ! go build -o "$ENTIRE_BIN" "$CLI_DIR/cmd/entire"; then | ||||||
|
||||||
| if ! go build -o "$ENTIRE_BIN" "$CLI_DIR/cmd/entire"; then | |
| if ! (cd "$CLI_DIR" && go build -o "$ENTIRE_BIN" ./cmd/entire); then |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jq is used unconditionally to pretty-print and to extract fields from metadata.json. With set -e, a missing jq will abort the script even though it could still show raw JSON. Consider guarding jq usage with command -v jq and falling back to cat/raw output (or emitting an explicit error early in the preflight check).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script depends on external tools (
claude,jq,git,go) but doesn’t check for them up front. Add a small preflight section (and/or update the header usage block) that validates required commands are available and prints a clear install/setup hint before doing any work; this avoids confusing “command not found” failures mid-run.