Skip to content

Commit 37b97c8

Browse files
authored
Merge branch 'main' into fix-issue-213-decoder-constraints
2 parents c89fc9f + 3a3ab7b commit 37b97c8

6 files changed

Lines changed: 329 additions & 267 deletions

File tree

.github/workflows-archive/README.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows-archive/blueprint-old.yml

Lines changed: 0 additions & 158 deletions
This file was deleted.

.github/workflows/review.yml

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,87 @@
1-
name: AI Code Review with External Context
2-
1+
name: PR Review
32
on:
3+
pull_request:
4+
types: [opened]
45
issue_comment:
56
types: [created]
6-
77
jobs:
88
review:
99
if: >-
10-
github.event.issue.pull_request &&
11-
startsWith(github.event.comment.body, '/review') &&
1210
(
13-
github.event.comment.author_association == 'OWNER' ||
14-
github.event.comment.author_association == 'MEMBER' ||
15-
github.event.comment.author_association == 'COLLABORATOR'
11+
github.event_name == 'pull_request' &&
12+
(
13+
github.event.pull_request.author_association == 'OWNER' ||
14+
github.event.pull_request.author_association == 'MEMBER' ||
15+
github.event.pull_request.author_association == 'COLLABORATOR'
16+
)
17+
) ||
18+
(
19+
github.event_name == 'issue_comment' &&
20+
github.event.issue.pull_request &&
21+
startsWith(github.event.comment.body, '/review') &&
22+
(
23+
github.event.comment.author_association == 'OWNER' ||
24+
github.event.comment.author_association == 'MEMBER' ||
25+
github.event.comment.author_association == 'COLLABORATOR'
26+
)
1627
)
1728
runs-on: ubuntu-latest
29+
timeout-minutes: 90
1830
permissions:
1931
contents: read
2032
pull-requests: write
2133
steps:
2234
- name: Extract arguments from comment
2335
id: get_args
36+
if: github.event_name == 'issue_comment'
37+
env:
38+
COMMENT_BODY: ${{ github.event.comment.body }}
2439
run: |
25-
PARSED_ARGS=$(awk '
40+
# Generate a random EOF marker for the GITHUB_OUTPUT heredoc.
41+
# This variable is passed to awk which handles all output writing.
42+
EOF=$(openssl rand -hex 8)
43+
44+
awk -v eof="$EOF" -v gh_out="$GITHUB_OUTPUT" '
45+
BEGIN {
46+
ext = ""
47+
repo = ""
48+
com = ""
49+
section = ""
50+
}
2651
/^External:/ { section="ext"; next }
27-
/^Internal:/ { section="int"; next }
52+
/^Internal:/ { section="repo"; next }
2853
/^Comments:/ { section="com"; next }
2954
{
30-
gsub(/^[ ]+|[ ]+$/, "", $0);
55+
gsub(/\r/, "", $0);
56+
gsub(/^[ \t]+|[ \t]+$/, "", $0);
3157
if ($0 == "" || $0 == "/review") { next }
58+
3259
if (section == "ext") {
3360
sub(/^- +/, "");
34-
if (ext) { ext = ext "," $0 } else { ext = $0 }
61+
if (ext != "") { ext = ext "," $0 } else { ext = $0 }
3562
}
36-
else if (section == "int") {
63+
else if (section == "repo") {
3764
sub(/^- +/, "");
38-
if (ark) { ark = ark "," $0 } else { ark = $0 }
65+
if (repo != "") { repo = repo "," $0 } else { repo = $0 }
3966
}
4067
else if (section == "com") {
41-
if (com) { com = com " " $0 } else { com = $0 }
68+
if (com != "") { com = com "\n" $0 } else { com = $0 }
4269
}
4370
}
4471
END {
45-
print "external_refs=" ext
46-
print "arklib_refs=" ark
47-
print "additional_comments=" com
72+
printf "external_refs=%s\n", ext >> gh_out
73+
printf "repo_context_refs=%s\n", repo >> gh_out
74+
printf "additional_comments<<%s\n", eof >> gh_out
75+
printf "%s\n", com >> gh_out
76+
printf "%s\n", eof >> gh_out
4877
}
49-
' <<< "${{ github.event.comment.body }}")
50-
echo "$PARSED_ARGS" >> $GITHUB_OUTPUT
78+
' <<< "$COMMENT_BODY"
5179
shell: bash
52-
5380
- uses: alexanderlhicks/lean-review-workflow@main
5481
with:
5582
github_token: ${{ secrets.GITHUB_TOKEN }}
5683
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
57-
pr_number: ${{ github.event.issue.number }}
84+
pr_number: ${{ github.event.issue.number || github.event.pull_request.number }}
5885
external_refs: "${{ steps.get_args.outputs.external_refs }}"
59-
arklib_refs: "${{ steps.get_args.outputs.arklib_refs }}"
86+
repo_context_refs: "${{ steps.get_args.outputs.repo_context_refs }}"
6087
additional_comments: "${{ steps.get_args.outputs.additional_comments }}"
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
name: PR Summary
2-
32
on:
43
pull_request_target:
5-
6-
permissions:
7-
pull-requests: write
8-
issues: read
9-
4+
types: [opened, synchronize]
105
jobs:
116
summarize:
127
runs-on: ubuntu-latest
8+
timeout-minutes: 30
9+
permissions:
10+
pull-requests: write
11+
issues: read
1312
steps:
1413
- uses: alexanderlhicks/lean-summary-workflow@main
1514
with:
1615
github_token: ${{ secrets.GITHUB_TOKEN }}
1716
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
1817
github_repository: ${{ github.repository }}
19-
pr_number: ${{ github.event.pull_request.number }}
18+
pr_number: ${{ github.event.pull_request.number }}

0 commit comments

Comments
 (0)