-
Notifications
You must be signed in to change notification settings - Fork 294
fix(aw): Issue Arborist - re-apply curl REST API workaround for DIFC proxy #8573
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,21 +29,46 @@ steps: | |
| - name: Fetch issues data | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GH_AW_ORIGINAL_GITHUB_API_URL: ${{ github.api_url }} | ||
| GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} | ||
| run: | | ||
| # Create output directory | ||
| mkdir -p /tmp/gh-aw/issues-data | ||
|
|
||
| echo "⬇ Downloading the last 100 open issues (excluding sub-issues)..." | ||
|
|
||
| # Fetch the last 100 open issues that don't have a parent issue | ||
| gh issue list --repo "$GH_AW_GITHUB_REPOSITORY" \ | ||
| --search "-parent-issue:*" \ | ||
| --state open \ | ||
| --json number,title,author,createdAt,state,url,body,labels,updatedAt,closedAt,milestone,assignees \ | ||
| --limit 100 \ | ||
| > /tmp/gh-aw/issues-data/issues.json | ||
| # Use REST API directly to avoid gh CLI failures under the DIFC proxy | ||
| # (see https://github.com/githubnext/agentics/issues/339 and microsoft/testfx#8571). | ||
| # The /meta block referenced in #339 was fixed in gh-aw-mcpg v0.3.12, but | ||
| # `gh issue list` still fails under the proxy with `malformed version:` | ||
| # (observed with mcpg v0.3.17), so we keep the curl-based fallback. | ||
| # Fetches the most recently created 100 issues (intentional limit matching previous behavior). | ||
| # State is normalized to uppercase (OPEN/CLOSED) to match gh CLI GraphQL output format. | ||
| curl -s \ | ||
| -H "Authorization: Bearer ${GITHUB_TOKEN}" \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| --get \ | ||
| --data-urlencode "q=repo:${GH_AW_GITHUB_REPOSITORY} is:issue is:open -is:sub-issue" \ | ||
| --data-urlencode "sort=created" \ | ||
| --data-urlencode "order=desc" \ | ||
| --data-urlencode "per_page=100" \ | ||
| "${GH_AW_ORIGINAL_GITHUB_API_URL}/search/issues" \ | ||
| | jq '.items // [] | map({ | ||
| number: .number, | ||
|
Comment on lines
+55
to
+57
|
||
| title: .title, | ||
| author: {login: .user.login}, | ||
| createdAt: .created_at, | ||
| state: (.state | ascii_upcase), | ||
| url: .html_url, | ||
| body: .body, | ||
| labels: [.labels[] | {name: .name}], | ||
| updatedAt: .updated_at, | ||
| closedAt: .closed_at, | ||
| milestone: (if .milestone != null then {title: .milestone.title} else null end), | ||
| assignees: [.assignees[] | {login: .login}] | ||
| })' \ | ||
| > /tmp/gh-aw/issues-data/issues.json \ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [MAJOR] Defensive Coding at Boundaries jq parse failure not caught by fallback The Concrete failing scenario:
Proof: # Simulate malformed JSON
echo "not json" | jq '.items // []' > output.json || echo '[]' > output.json
# jq exits 1, but the || fallback doesn't fire because it's not part of the piped commandRecommendation: curl -s \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github+json" \
--get \
--data-urlencode "q=repo:${GH_AW_GITHUB_REPOSITORY} is:issue is:open -is:sub-issue" \
--data-urlencode "sort=created" \
--data-urlencode "order=desc" \
--data-urlencode "per_page=100" \
"${GH_AW_ORIGINAL_GITHUB_API_URL}/search/issues" \
| jq '.items // [] | map({
number: .number,
title: .title,
author: {login: .user.login},
createdAt: .created_at,
state: (.state | ascii_upcase),
url: .html_url,
body: .body,
labels: [.labels[] | {name: .name}],
updatedAt: .updated_at,
closedAt: .closed_at,
milestone: (if .milestone != null then {title: .milestone.title} else null end),
assignees: [.assignees[] | {login: .login}]
})' > /tmp/gh-aw/issues-data/issues.json \
|| echo '[]' > /tmp/gh-aw/issues-data/issues.jsonMove the |
||
| || echo '[]' > /tmp/gh-aw/issues-data/issues.json | ||
|
|
||
| echo "✓ Issues data saved to /tmp/gh-aw/issues-data/issues.json" | ||
| echo "Total issues fetched: $(jq 'length' /tmp/gh-aw/issues-data/issues.json)" | ||
|
|
||
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.
[MAJOR] Algorithmic Correctness
Semantic mismatch in issue filtering query
The old query uses
-parent-issue:*which excludes issues that have aparent-issue:custom field (i.e., issues that are children in a parent-child relationship).The new query uses
-is:sub-issuewhich excludes issues marked by GitHub's native sub-issue feature.These are not equivalent.
Concrete failing scenario:
parent-issue: #100field-parent-issue:*) → excludes Removed Attribute from the namespace for DynamicDataAttribute #200 (has parent)-is:sub-issue) → includes Removed Attribute from the namespace for DynamicDataAttribute #200 (not marked as native sub-issue)Impact: Child issues that should be excluded will now be included, breaking the workflow's core filtering logic. The arborist may attempt to re-link issues that are already children, or create duplicate parent-child relationships.
Recommendation:
The search query should match the original intent. Options:
NOT "parent-issue" in:bodyif the parent relationship is tracked in issue bodiesgh issue listNote: The comment states this "re-applies the exact same workaround" from #8185 and #8507, but if those PRs had the same query mismatch, the filtering bug has been present since the original workaround.