Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 48 additions & 4 deletions .just/gh-process.just
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ sync:
git pull
git stp

# PR create 3.2
# PR create 3.3
[group('Process')]
pr: _has_commits
pr: _has_commits && pr_checks
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

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

Using && between dependencies is not valid Just syntax; Just expects a space-separated list of recipe dependencies. This will likely cause a parse error or treat '&&' as an invalid recipe name. Replace with a space: pr: _has_commits pr_checks.

Suggested change
pr: _has_commits && pr_checks
pr: _has_commits pr_checks

Copilot uses AI. Check for mistakes.
#!/usr/bin/env bash
set -euxo pipefail # strict mode

Expand Down Expand Up @@ -48,7 +48,6 @@ pr: _has_commits

echo "{{BLUE}}sleeping for 10s because github is lazy with their API{{NORMAL}}"
sleep 10
gh pr checks --watch -i 5

# merge PR and return to starting point
[group('Process')]
Expand Down Expand Up @@ -119,4 +118,49 @@ _main_branch:
# make a release
[group('Process')]
release rel_version:
gh release create {{rel_version}} --generate-notes
gh release create {{rel_version}} --generate-notes

# watch GHAs then check for Copilot suggestions
[group('Process')]
pr_checks:
#!/usr/bin/env bash
set -euo pipefail # bash strict mode

gh pr checks --watch -i 5

echo checking copilot...
PR_META=$(gh pr view --json number,headRepository,headRepositoryOwner)
PR_REPO_NAME=$(echo $PR_META | jq -r '.headRepository.name')
PR_REPO_OWNER=$(echo $PR_META | jq -r '.headRepositoryOwner.login')
PR_NUMBER=$(echo $PR_META | jq '.number')
#echo "$PR_NUMBER $PR_REPO_OWNER/$PR_REPO_NAME"
gh api graphql \
-F owner=$PR_REPO_OWNER -F name=$PR_REPO_NAME -F pr=$PR_NUMBER \
--jq '[ .data.repository.pullRequest.reviews.nodes.[] | select(.author.login=="copilot-pull-request-reviewer") | .comments.nodes.[] ]' \
-f query='
query($name: String!, $owner: String!, $pr: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $pr) {
reviews(last: 20) {
nodes {
author {
resourcePath
login
}
comments(first: 100) {
nodes {
body
path
originalLine
}
}
}
}
}
}
}
'

Comment on lines +139 to +165
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

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

Limiting reviews to last: 20 risks missing an earlier Copilot review if more than 20 reviews exist, causing false negatives when checking for Copilot suggestions. Increase the limit or implement pagination (e.g., use after cursors) to ensure all relevant reviews are considered.

Suggested change
gh api graphql \
-F owner=$PR_REPO_OWNER -F name=$PR_REPO_NAME -F pr=$PR_NUMBER \
--jq '[ .data.repository.pullRequest.reviews.nodes.[] | select(.author.login=="copilot-pull-request-reviewer") | .comments.nodes.[] ]' \
-f query='
query($name: String!, $owner: String!, $pr: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $pr) {
reviews(last: 20) {
nodes {
author {
resourcePath
login
}
comments(first: 100) {
nodes {
body
path
originalLine
}
}
}
}
}
}
}
'
# Paginate through all reviews to avoid missing Copilot reviews
COPILOT_COMMENTS=()
REVIEWS_AFTER=""
while : ; do
# Run GraphQL query for a page of reviews
PAGE=$(gh api graphql \
-F owner=$PR_REPO_OWNER -F name=$PR_REPO_NAME -F pr=$PR_NUMBER -F after="$REVIEWS_AFTER" \
-f query='
query($name: String!, $owner: String!, $pr: Int!, $after: String) {
repository(owner: $owner, name: $name) {
pullRequest(number: $pr) {
reviews(first: 100, after: $after) {
nodes {
author {
resourcePath
login
}
comments(first: 100) {
nodes {
body
path
originalLine
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
}
}
')
# Extract Copilot comments from this page
PAGE_COMMENTS=$(echo "$PAGE" | jq '[.data.repository.pullRequest.reviews.nodes[] | select(.author.login=="copilot-pull-request-reviewer") | .comments.nodes[]]')
COPILOT_COMMENTS+=("$PAGE_COMMENTS")
# Check if there are more pages
HAS_NEXT=$(echo "$PAGE" | jq -r '.data.repository.pullRequest.reviews.pageInfo.hasNextPage')
if [[ "$HAS_NEXT" != "true" ]]; then
break
fi
REVIEWS_AFTER=$(echo "$PAGE" | jq -r '.data.repository.pullRequest.reviews.pageInfo.endCursor')
done
# Combine all Copilot comments into one array and output
echo "${COPILOT_COMMENTS[@]}" | jq -s 'add'

Copilot uses AI. Check for mistakes.
# did Claude comment?
echo -e "\n\nπŸŸ§πŸŸ πŸ”ΆπŸ”Έ Claude:"
gh pr view --json comments --jq '[.comments[] | select(.author.login == "claude")] | last | .body'