You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by ch...@apache.org on 2026/04/20 17:33:54 UTC
(gluten) branch feature/ansi-baseline-workflow created (now 94904ab5d9)
This is an automated email from the ASF dual-hosted git repository.
baibaichen pushed a change to branch feature/ansi-baseline-workflow
in repository https://gitbox.apache.org/repos/asf/gluten.git
at 94904ab5d9 [GLUTEN-10134][VL] Restructure report: JSON-only overview, XML failed suite summary
This branch includes the following new commits:
new 3a97685e02 [GLUTEN-10134][VL] Fix recursive glob for JSON offload data in analyze script
new 728e2eb2a2 [GLUTEN-10134][VL] Add CI AI deep analysis via Copilot CLI to ANSI workflow
new b4321ea211 [GLUTEN-10134][VL] Fix Copilot CLI auth in CI: add copilot_requests permission and GITHUB_TOKEN
new 8126c03bc1 [GLUTEN-10134][VL] Remove invalid copilot_requests permission from workflow
new 957a870b6f [GLUTEN-10134][VL] Fix analyze-only: find run with actual artifacts instead of latest run
new f39de9f507 [GLUTEN-10134][VL] Fix jq expression for finding workflow runs with artifacts
new 03f8ad9a63 [GLUTEN-10134][VL] Replace Copilot CLI with GitHub Models API for CI AI analysis
new 38e7944700 [GLUTEN-10134][VL] Add models:read permission for GitHub Models API access
new d5af4441cb [GLUTEN-10134][VL] Compact AI context to fit GitHub Models 16K token limit
new 94904ab5d9 [GLUTEN-10134][VL] Restructure report: JSON-only overview, XML failed suite summary
The 10 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
(gluten) 02/10: [GLUTEN-10134][VL] Add CI AI deep analysis via Copilot CLI to ANSI workflow
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
baibaichen pushed a commit to branch feature/ansi-baseline-workflow
in repository https://gitbox.apache.org/repos/asf/gluten.git
commit 728e2eb2a2978802f53da6a17b006c6e21040899
Author: Chang chen <ch...@apache.org>
AuthorDate: Mon Apr 20 23:53:55 2026 +0800
[GLUTEN-10134][VL] Add CI AI deep analysis via Copilot CLI to ANSI workflow
Integrate Copilot CLI to generate AI-powered deep analysis reports appended
to PR comments. Supports model selection via PR comment (--model flag) with
fallback chain: user-specified → claude-sonnet-4 → auto.
Co-Authored-By: Claude Opus 4 <no...@anthropic.com>
---
.github/scripts/analyze-ansi.py | 334 ++++++++++++++++++++++++++-----
.github/workflows/velox_backend_ansi.yml | 20 +-
2 files changed, 305 insertions(+), 49 deletions(-)
diff --git a/.github/scripts/analyze-ansi.py b/.github/scripts/analyze-ansi.py
index 394338d688..5f93f42d07 100644
--- a/.github/scripts/analyze-ansi.py
+++ b/.github/scripts/analyze-ansi.py
@@ -38,14 +38,60 @@ import sys
import xml.etree.ElementTree as ET
from collections import defaultdict
-# ---------------------------------------------------------------------------
-# Fail cause classification patterns
-# ---------------------------------------------------------------------------
NO_EXCEPTION_RE = re.compile(
r"Expected .+ to be thrown, but no exception was thrown")
-WRONG_EXCEPTION_RE = re.compile(r"Expected \S+ but got \S+:")
+WRONG_EXCEPTION_RE = re.compile(r"Expected (\S+) but got (\S+):")
MSG_MISMATCH_RE = re.compile(r"Expected error message containing")
+ANALYSIS_PROMPT_TEMPLATE = """\
+你是 Gluten 项目的 ANSI 模式测试分析专家。Gluten 是 Apache Spark 的 native engine 加速插件,
+通过 Velox (C++) 后端 offload 表达式计算。ANSI 模式要求对溢出、类型转换错误等抛出异常。
+
+以下是 analyze-ansi.py --mode json 的结构化输出:
+
+```json
+{json_data}
+```
+
+请按以下结构生成分析报告(Markdown 格式,中文):
+
+## 总体概览
+- 总测试数、通过/失败
+- 色彩分布表(🟢 Passed+Offload / 🔴 Passed+Fallback / ⚪ No data / 🟡 Failed),含数量和占比
+- 各 category 分布表(Category / Pass / Fail / Entries)
+- 标注"假绿"隐性问题:Passed+Fallback 表示测试通过但实际由 Spark fallback 执行,非 Velox offload
+
+## 关键发现
+- 失败集中区域表(Suite / 失败数 / 主要症结)
+- failCause 类型统计表(类型 / 数量 / 占比 / 解读):
+ - WRONG_EXCEPTION: Velox 抛了异常但被 Spark 调度层包装为 SparkException,丢失原始异常类型
+ - NO_EXCEPTION: Velox 在 ANSI 模式下未抛出期望的异常
+ - OTHER: 计算结果不匹配或其他错误
+- 对 WRONG_EXCEPTION 做根因深度分析(异常包装链路径、关键代码位置)
+- 对 NO_EXCEPTION 按根因细分(算术/cast/datetime 等)
+
+## 修复建议(只列 P0 / P1 / P2 三个优先级)
+每个修复建议包含:
+- 症状:测试失败的模式描述
+- 根因:具体代码路径和逻辑问题
+- 修复点:文件路径 + 改动方向
+- 代表测试:受影响的典型测试名
+- 预计影响:修复后可转绿的测试数
+
+关键源码位置(供参考):
+- 异常查找: gluten-ut/common/src/test/scala/org/apache/spark/sql/GlutenTestsTrait.scala (findCause 方法)
+- 异常包装: gluten-arrow/src/main/java/org/apache/gluten/vectorized/ColumnarBatchOutIterator.java (translateException)
+- 表达式转换: gluten-core/.../ExpressionConverter.scala
+- 类型映射: gluten-substrait/.../ConverterUtils.scala (getTypeNode)
+- Velox Cast: ep/build-velox/build/velox_ep/velox/functions/sparksql/SparkCastExpr.cpp
+- Velox 算术: ep/build-velox/build/velox_ep/velox/functions/sparksql/Arithmetic.cpp
+
+限制:
+- 使用 Markdown 表格,不要用 ASCII box drawing 字符
+- 修复建议最多 3 个
+- 如果可以访问源码,请读取关键文件验证根因分析
+"""
+
def classify_fail_cause(message):
if not message:
@@ -59,6 +105,32 @@ def classify_fail_cause(message):
return "OTHER"
+def _extract_short_message(message):
+ if not message:
+ return ""
+ m = WRONG_EXCEPTION_RE.search(message)
+ if m:
+ return f"Expected {m.group(1)} but got {m.group(2)}"
+ if NO_EXCEPTION_RE.search(message):
+ m2 = re.search(
+ r"Expected (.+?) to be thrown, but no exception was thrown",
+ message)
+ if m2:
+ return f"Expected {m2.group(1)} but no exception was thrown"
+ if message.startswith("Exception evaluating"):
+ return message.split("\n")[0][:150]
+ if message.startswith("Incorrect evaluation"):
+ return message.split("\n")[0][:150]
+ return message.split("\n")[0][:120]
+
+
+def _extract_expected_got(message):
+ m = WRONG_EXCEPTION_RE.search(message)
+ if m:
+ return m.group(1), m.group(2)
+ return None, None
+
+
# ===========================================================================
# DATA LAYER
# ===========================================================================
@@ -253,7 +325,6 @@ def build_summary(json_tests, xml_tests):
# ---------------------------------------------------------------------------
def _normalize_type(t):
- """Normalize Spark type names for display."""
simple = {
"boolean": "Boolean", "byte": "TinyInt", "short": "SmallInt",
"int": "Int", "bigint": "BigInt", "float": "Float",
@@ -273,12 +344,10 @@ def _normalize_type(t):
parts = inner.split(",", 1)
if len(parts) == 2:
return "Map\\<" + _normalize_type(parts[0]) + "," + _normalize_type(parts[1]) + "\\>"
- return t
+ return t.replace("<", "\\<").replace(">", "\\>")
def _cell_symbol(offload, status):
- """Determine cell symbol using unified three-color scheme.
- TODO: accept fail_cause_type to differentiate 🟡 subtypes (NO_EXCEPTION/WRONG_EXCEPTION/etc.)."""
if offload == "FALLBACK":
return "🔴"
if status == "PASS":
@@ -341,24 +410,10 @@ def _build_cast_matrix(entries, suites):
return matrix
-def _build_arithmetic_matrix(entries, suites):
- """Build arithmetic matrix: operator -> {suite: symbol}."""
+def _build_keyed_matrix(entries, suites, meta_key):
matrix = defaultdict(lambda: defaultdict(lambda: "⚪"))
for e in entries:
- op = e["meta"].get("operator", "?")
- key = op
- sym = _cell_symbol(e["offload"], e["status"])
- cur = matrix[key].get(e["suite"], "⚪")
- matrix[key][e["suite"]] = _worse(sym, cur)
- return matrix
-
-
-def _build_mechanism_b_matrix(entries, suites):
- """Build mechanism B matrix: expr_class -> {suite: symbol}."""
- matrix = defaultdict(lambda: defaultdict(lambda: "⚪"))
- for e in entries:
- expr = e["meta"].get("expr", "?")
- key = expr
+ key = e["meta"].get(meta_key, "?")
sym = _cell_symbol(e["offload"], e["status"])
cur = matrix[key].get(e["suite"], "⚪")
matrix[key][e["suite"]] = _worse(sym, cur)
@@ -376,16 +431,17 @@ def _worse(a, b):
# OUTPUT LAYER
# ===========================================================================
-def format_summary(summary, json_tests):
+def format_summary(summary, json_tests, suites=None):
"""Format test-level summary as markdown."""
lines = ["## ANSI Mode Test Analysis Report\n"]
lines.append(f"**Total tests: {summary['total']}** "
f"(JSON: {summary['json_test_count']}, "
f"XML: {summary['xml_test_count']})\n")
+ # --- Overview with percentage ---
lines.append("### Overview\n")
- lines.append("| Classification | Count |")
- lines.append("|---|---|")
+ lines.append("| Classification | Count | % |")
+ lines.append("|---|---|---|")
for label in ["Passed+Offload", "Failed+Offload", "Passed+Fallback",
"Failed+Fallback", "Failed", "Passed (no data)",
"Failed (no data)", "Skipped"]:
@@ -395,23 +451,118 @@ def format_summary(summary, json_tests):
"Passed+Fallback": "🔴", "Failed+Fallback": "🔴",
"Failed": "🟡", "Passed (no data)": "⚪",
"Failed (no data)": "🟡", "Skipped": "⚪"}.get(label, "")
- lines.append(f"| {color} {label} | {count} |")
+ pct = count * 100 / summary["total"] if summary["total"] else 0
+ lines.append(f"| {color} {label} | {count} | {pct:.1f}% |")
lines.append("")
- if summary["failures"]:
- lines.append("### Failed Tests (sample, max 50)\n")
- lines.append("| Suite | Test | Source | Color | Message |")
- lines.append("|---|---|---|---|---|")
- for t in summary["failures"][:50]:
- msg = (t.get("message") or "")[:200].replace("|", "\\|").replace("\n", " ")
- source = t.get("source", "")
- suite_short = t["suite"].split(".")[-1]
+ # --- Per-Suite Summary (JSON only) ---
+ if suites:
+ lines.append("### Per-Suite Summary\n")
+ lines.append("| Suite | Category | Total | Pass | Fail "
+ "| Offload | Fallback |")
+ lines.append("|---|---|---|---|---|---|---|")
+ for s in suites:
+ name = s.get("suite", "").split(".")[-1]
+ cat = s.get("category", "")
+ tests = s.get("tests", [])
+ total = len(tests)
+ passed = failed = off = fb = 0
+ for t in tests:
+ st = t.get("status")
+ if st == "PASS":
+ passed += 1
+ elif st == "FAIL":
+ failed += 1
+ for r in t.get("records", []):
+ ol = r.get("offload")
+ if ol == "OFFLOAD":
+ off += 1
+ elif ol == "FALLBACK":
+ fb += 1
+ lines.append(f"| {name} | {cat} | {total} | {passed} "
+ f"| {failed} | {off} | {fb} |")
+ lines.append("")
+
+ # --- Failure Cause Analysis (JSON only) ---
+ json_failures = [f for f in summary["failures"] if f.get("source") == "json"]
+ xml_failures = [f for f in summary["failures"] if f.get("source") == "xml"]
+
+ if json_failures:
+ cause_counts = defaultdict(int)
+ cause_details = defaultdict(list)
+ cause_by_failure = {}
+ for f in json_failures:
+ cause = classify_fail_cause(f.get("message", ""))
+ cause_counts[cause] += 1
+ cause_details[cause].append(f)
+ cause_by_failure[id(f)] = cause
+
+ lines.append(f"### Failure Cause Analysis "
+ f"({len(json_failures)} failures from JSON)\n")
+ cause_desc = {
+ "NO_EXCEPTION": "Velox did not throw expected ANSI exception",
+ "WRONG_EXCEPTION": "Exception wrapped as SparkException",
+ "MSG_MISMATCH": "Error message text mismatch",
+ "OTHER": "Result mismatch or eval exception",
+ }
+ lines.append("| Cause | Count | Description |")
+ lines.append("|---|---|---|")
+ for cause in ["NO_EXCEPTION", "WRONG_EXCEPTION",
+ "MSG_MISMATCH", "OTHER"]:
+ cnt = cause_counts.get(cause, 0)
+ if cnt > 0:
+ lines.append(f"| {cause} | {cnt} "
+ f"| {cause_desc.get(cause, '')} |")
+ lines.append("")
+
+ # --- WRONG_EXCEPTION Details ---
+ wrong_exc = cause_details.get("WRONG_EXCEPTION", [])
+ if wrong_exc:
+ lines.append("### WRONG_EXCEPTION Details\n")
+ lines.append("| Suite | Test | Expected | Got |")
+ lines.append("|---|---|---|---|")
+ for f in wrong_exc:
+ exp, got = _extract_expected_got(f.get("message", ""))
+ suite_short = f["suite"].split(".")[-1]
+ lines.append(
+ f"| {suite_short} | {f['test']} "
+ f"| {exp or '?'} | {got or '?'} |")
+ lines.append("")
+
+ # --- Failed Tests: JSON ---
+ if json_failures:
+ lines.append(f"### Failed Tests — Expression Suites "
+ f"(JSON, {len(json_failures)} failures)\n")
+ lines.append("| Suite | Test | Cause | Message |")
+ lines.append("|---|---|---|---|")
+ for f in json_failures[:50]:
+ msg = _extract_short_message(f.get("message", ""))
+ msg = msg.replace("|", "\\|")
+ cause = cause_by_failure[id(f)]
+ suite_short = f["suite"].split(".")[-1]
+ lines.append(
+ f"| {suite_short} | {f['test']} | {cause} | {msg} |")
+ if len(json_failures) > 50:
+ lines.append(
+ f"\n*...and {len(json_failures) - 50} more*\n")
+ lines.append("")
+
+ # --- Failed Tests: XML ---
+ if xml_failures:
+ lines.append(f"### Failed Tests — Integration Suites "
+ f"(XML, {len(xml_failures)} failures)\n")
+ lines.append("| Suite | Test | Job | Message |")
+ lines.append("|---|---|---|---|")
+ for f in xml_failures[:30]:
+ msg = (f.get("message") or "")[:150]
+ msg = msg.replace("|", "\\|").replace("\n", " ")
+ suite_short = f["suite"].split(".")[-1]
+ job = f.get("job", "")
lines.append(
- f"| {suite_short} | {t['test']} "
- f"| {source} | {t['color']} {t['label']} | {msg} |")
- if len(summary["failures"]) > 50:
+ f"| {suite_short} | {f['test']} | {job} | {msg} |")
+ if len(xml_failures) > 30:
lines.append(
- f"\n*...and {len(summary['failures']) - 50} more failures*\n")
+ f"\n*...and {len(xml_failures) - 30} more*\n")
lines.append("")
return "\n".join(lines)
@@ -445,10 +596,10 @@ def format_matrix(categories):
matrix = _build_cast_matrix(entries, suites)
_format_cast_tables(lines, matrix, suites)
elif cat == "arithmetic":
- matrix = _build_arithmetic_matrix(entries, suites)
+ matrix = _build_keyed_matrix(entries, suites, "operator")
_format_generic_table(lines, matrix, suites, "Operator")
else:
- matrix = _build_mechanism_b_matrix(entries, suites)
+ matrix = _build_keyed_matrix(entries, suites, "expr")
_format_generic_table(lines, matrix, suites, "Expression")
lines.append("")
@@ -574,9 +725,10 @@ def _format_generic_table(lines, matrix, suites, key_label):
lines.append("")
-def format_full(summary, json_tests, categories):
- """Format full report: summary + matrix in <details>."""
- parts = [format_summary(summary, json_tests)]
+def format_full(summary, json_tests, categories, suites=None,
+ ai_content=None, ai_model=None):
+ """Format full report: summary + matrix in <details> + optional AI analysis."""
+ parts = [format_summary(summary, json_tests, suites)]
matrix_md = format_matrix(categories)
parts.append("<details>")
parts.append(
@@ -584,6 +736,13 @@ def format_full(summary, json_tests, categories):
f"({len(categories)} categories)</summary>\n")
parts.append(matrix_md)
parts.append("</details>")
+ if ai_content:
+ parts.append("")
+ parts.append("<details>")
+ parts.append("<summary>🤖 AI Deep Analysis</summary>\n")
+ parts.append(ai_content)
+ parts.append(f"\n---\n*Generated by {ai_model}*")
+ parts.append("</details>")
return "\n".join(parts)
@@ -604,6 +763,75 @@ def format_json_output(summary, json_tests, xml_tests, categories):
return json.dumps(output, indent=2, ensure_ascii=False)
+# ---------------------------------------------------------------------------
+# AI analysis via Copilot CLI
+# ---------------------------------------------------------------------------
+
+def _strip_copilot_stats(text):
+ lines = text.strip().split("\n")
+ content_lines = []
+ skip_block = False
+ for line in lines:
+ if line.startswith(("Changes ", "Requests ", "Tokens ")):
+ break
+ if line.startswith("● "):
+ skip_block = True
+ continue
+ if skip_block:
+ if line.startswith(" │") or line.startswith(" └"):
+ continue
+ skip_block = False
+ content_lines.append(line)
+ return "\n".join(content_lines).strip()
+
+
+def call_copilot_analysis(json_output, model=None):
+ """Call Copilot CLI for deep analysis with fallback chain.
+
+ Returns (content, model_used) or (None, None) on failure.
+ """
+ models_to_try = []
+ if model:
+ models_to_try.append(model)
+ models_to_try.extend(["claude-sonnet-4", "auto"])
+
+ prompt = ANALYSIS_PROMPT_TEMPLATE.format(json_data=json_output)
+
+ for m in models_to_try:
+ try:
+ print(f"Calling Copilot CLI with model={m}...", file=sys.stderr)
+ result = subprocess.run(
+ ["copilot", "-p", prompt,
+ "--model", m,
+ "--output-format", "text",
+ "--add-dir", ".",
+ "--allow-all-paths"],
+ capture_output=True, text=True, timeout=300,
+ )
+ if result.returncode == 0 and result.stdout.strip():
+ content = _strip_copilot_stats(result.stdout)
+ if content:
+ print(f"AI analysis completed with model={m}",
+ file=sys.stderr)
+ return content, m
+ print(f"Warning: copilot --model {m} returned empty or failed "
+ f"(rc={result.returncode})", file=sys.stderr)
+ if result.stderr:
+ print(f" stderr: {result.stderr[:200]}", file=sys.stderr)
+ except subprocess.TimeoutExpired:
+ print(f"Warning: copilot --model {m} timed out", file=sys.stderr)
+ except FileNotFoundError:
+ print("Warning: copilot CLI not found, skipping AI analysis",
+ file=sys.stderr)
+ return None, None
+ except Exception as e:
+ print(f"Warning: copilot --model {m} failed: {e}",
+ file=sys.stderr)
+
+ print("Warning: all AI models failed, skipping analysis", file=sys.stderr)
+ return None, None
+
+
# ---------------------------------------------------------------------------
# Output targets
# ---------------------------------------------------------------------------
@@ -646,6 +874,10 @@ def main():
parser.add_argument("--pr-comment", action="store_true")
parser.add_argument("--job-summary", action="store_true")
parser.add_argument("--output-file", help="Write output to file")
+ parser.add_argument("--ai-analysis", action="store_true",
+ help="Call Copilot CLI for AI deep analysis")
+ parser.add_argument("--ai-model", default="",
+ help="AI model for Copilot CLI (default: claude-sonnet-4)")
args = parser.parse_args()
# Load data
@@ -660,11 +892,19 @@ def main():
# Format output
if args.mode == "summary":
- report = format_summary(summary, json_tests)
+ report = format_summary(summary, json_tests, suites)
elif args.mode == "matrix":
report = format_matrix(categories)
elif args.mode == "full":
- report = format_full(summary, json_tests, categories)
+ ai_content, ai_model = None, None
+ if args.ai_analysis:
+ json_output = format_json_output(
+ summary, json_tests, xml_tests, categories)
+ model = args.ai_model or os.environ.get("AI_MODEL", "")
+ ai_content, ai_model = call_copilot_analysis(
+ json_output, model or None)
+ report = format_full(summary, json_tests, categories, suites,
+ ai_content=ai_content, ai_model=ai_model)
elif args.mode == "json":
report = format_json_output(summary, json_tests, xml_tests, categories)
diff --git a/.github/workflows/velox_backend_ansi.yml b/.github/workflows/velox_backend_ansi.yml
index ec9413087c..80cddb5f04 100644
--- a/.github/workflows/velox_backend_ansi.yml
+++ b/.github/workflows/velox_backend_ansi.yml
@@ -55,7 +55,15 @@ jobs:
pr_number: ${{ steps.pr-info.outputs.pr_number }}
pr_sha: ${{ steps.pr-info.outputs.pr_sha }}
pr_ref: ${{ steps.pr-info.outputs.pr_ref }}
+ ai_model: ${{ steps.parse-args.outputs.ai_model }}
steps:
+ - name: Parse comment args
+ id: parse-args
+ env:
+ COMMENT: ${{ github.event.comment.body || '' }}
+ run: |
+ AI_MODEL=$(echo "$COMMENT" | grep -oP '(?<=--model\s)\S+' || echo "")
+ echo "ai_model=${AI_MODEL}" >> $GITHUB_OUTPUT
- name: Get PR info
id: pr-info
env:
@@ -490,10 +498,12 @@ jobs:
path: ./ansi-offload/
- name: Install dependencies
run: pip3 install requests
+ - name: Install Copilot CLI
+ run: curl -fsSL https://gh.io/copilot-install | bash
- name: Analyze and report
env:
GH_TOKEN: ${{ github.token }}
- AI_MODEL: ${{ vars.AI_MODEL || 'gpt-4o' }}
+ AI_MODEL: ${{ needs.check-comment.outputs.ai_model }}
PR_NUMBER: ${{ needs.check-comment.outputs.pr_number }}
TRIGGERED_BY: ${{ github.event.comment.user.login || github.actor }}
RUN_ID: ${{ github.run_id }}
@@ -502,6 +512,8 @@ jobs:
--json-dir ./ansi-offload/ \
--report-dir ./test-reports/ \
--mode full \
+ --ai-analysis \
+ --ai-model "${AI_MODEL}" \
--pr-comment
analyze-only:
@@ -564,10 +576,12 @@ jobs:
find ./test-reports ./test-logs -type f | head -50
- name: Install dependencies
run: pip3 install requests
+ - name: Install Copilot CLI
+ run: curl -fsSL https://gh.io/copilot-install | bash
- name: Analyze and report
env:
GH_TOKEN: ${{ github.token }}
- AI_MODEL: ${{ vars.AI_MODEL || 'gpt-4o' }}
+ AI_MODEL: ${{ needs.check-comment.outputs.ai_model }}
PR_NUMBER: ${{ needs.check-comment.outputs.pr_number }}
TRIGGERED_BY: ${{ github.event.comment.user.login || github.actor }}
RUN_ID: ${{ github.run_id }}
@@ -578,4 +592,6 @@ jobs:
--json-dir ./ansi-offload/ \
--report-dir ./test-reports/ \
--mode full \
+ --ai-analysis \
+ --ai-model "${AI_MODEL}" \
--pr-comment
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
(gluten) 07/10: [GLUTEN-10134][VL] Replace Copilot CLI with GitHub Models API for CI AI analysis
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
baibaichen pushed a commit to branch feature/ansi-baseline-workflow
in repository https://gitbox.apache.org/repos/asf/gluten.git
commit 03f8ad9a6386ac57cb8d1a83fbffcd081cf60e57
Author: Chang chen <ch...@apache.org>
AuthorDate: Tue Apr 21 01:01:13 2026 +0800
[GLUTEN-10134][VL] Replace Copilot CLI with GitHub Models API for CI AI analysis
Copilot CLI requires user-level auth unavailable in CI. Switch to GitHub
Models API (models.inference.ai.azure.com) which works with GITHUB_TOKEN.
Default model: gpt-4.1 with fallback to gpt-4o.
Co-Authored-By: Claude Opus 4 <no...@anthropic.com>
---
.github/scripts/analyze-ansi.py | 77 ++++++++++++++------------------
.github/workflows/velox_backend_ansi.yml | 4 --
2 files changed, 33 insertions(+), 48 deletions(-)
diff --git a/.github/scripts/analyze-ansi.py b/.github/scripts/analyze-ansi.py
index 97fa1c62d5..92266a964a 100644
--- a/.github/scripts/analyze-ansi.py
+++ b/.github/scripts/analyze-ansi.py
@@ -767,68 +767,57 @@ def format_json_output(summary, json_tests, xml_tests, categories):
# AI analysis via Copilot CLI
# ---------------------------------------------------------------------------
-def _strip_copilot_stats(text):
- lines = text.strip().split("\n")
- content_lines = []
- skip_block = False
- for line in lines:
- if line.startswith(("Changes ", "Requests ", "Tokens ")):
- break
- if line.startswith("● "):
- skip_block = True
- continue
- if skip_block:
- if line.startswith(" │") or line.startswith(" └"):
- continue
- skip_block = False
- content_lines.append(line)
- return "\n".join(content_lines).strip()
+GITHUB_MODELS_API = "https://models.inference.ai.azure.com/chat/completions"
-def call_copilot_analysis(json_output, model=None):
- """Call Copilot CLI for deep analysis with fallback chain.
+def call_ai_analysis(json_output, model=None):
+ """Call GitHub Models API for deep analysis with fallback chain.
Returns (content, model_used) or (None, None) on failure.
"""
+ import requests
+
+ token = os.environ.get("GITHUB_TOKEN") or os.environ.get("GH_TOKEN")
+ if not token:
+ print("Warning: no GITHUB_TOKEN/GH_TOKEN, skipping AI analysis",
+ file=sys.stderr)
+ return None, None
+
models_to_try = []
if model:
models_to_try.append(model)
- models_to_try.extend(["claude-sonnet-4", "auto"])
+ models_to_try.extend(["gpt-4.1", "gpt-4o"])
prompt = ANALYSIS_PROMPT_TEMPLATE.format(json_data=json_output)
+ headers = {
+ "Authorization": f"Bearer {token}",
+ "Content-Type": "application/json",
+ }
for m in models_to_try:
try:
- print(f"Calling Copilot CLI with model={m}...", file=sys.stderr)
- result = subprocess.run(
- ["copilot", "-p", prompt,
- "--model", m,
- "--output-format", "text",
- "--add-dir", ".",
- "--allow-all-paths"],
- capture_output=True, text=True, timeout=300,
+ print(f"Calling GitHub Models API with model={m}...",
+ file=sys.stderr)
+ resp = requests.post(
+ GITHUB_MODELS_API,
+ headers=headers,
+ json={
+ "model": m,
+ "messages": [{"role": "user", "content": prompt}],
+ },
+ timeout=300,
)
- if result.returncode == 0 and result.stdout.strip():
- content = _strip_copilot_stats(result.stdout)
+ if resp.status_code == 200:
+ data = resp.json()
+ content = data["choices"][0]["message"]["content"].strip()
if content:
print(f"AI analysis completed with model={m}",
file=sys.stderr)
return content, m
- print(f"Warning: copilot --model {m} returned empty or failed "
- f"(rc={result.returncode})", file=sys.stderr)
- if result.stderr:
- print(f" stderr: {result.stderr[:500]}", file=sys.stderr)
- if result.stdout:
- print(f" stdout: {result.stdout[:200]}", file=sys.stderr)
- except subprocess.TimeoutExpired:
- print(f"Warning: copilot --model {m} timed out", file=sys.stderr)
- except FileNotFoundError:
- print("Warning: copilot CLI not found, skipping AI analysis",
- file=sys.stderr)
- return None, None
+ print(f"Warning: model {m} returned status {resp.status_code}: "
+ f"{resp.text[:300]}", file=sys.stderr)
except Exception as e:
- print(f"Warning: copilot --model {m} failed: {e}",
- file=sys.stderr)
+ print(f"Warning: model {m} failed: {e}", file=sys.stderr)
print("Warning: all AI models failed, skipping analysis", file=sys.stderr)
return None, None
@@ -903,7 +892,7 @@ def main():
json_output = format_json_output(
summary, json_tests, xml_tests, categories)
model = args.ai_model or os.environ.get("AI_MODEL", "")
- ai_content, ai_model = call_copilot_analysis(
+ ai_content, ai_model = call_ai_analysis(
json_output, model or None)
report = format_full(summary, json_tests, categories, suites,
ai_content=ai_content, ai_model=ai_model)
diff --git a/.github/workflows/velox_backend_ansi.yml b/.github/workflows/velox_backend_ansi.yml
index 4409977c5c..627dd5aa13 100644
--- a/.github/workflows/velox_backend_ansi.yml
+++ b/.github/workflows/velox_backend_ansi.yml
@@ -501,8 +501,6 @@ jobs:
path: ./ansi-offload/
- name: Install dependencies
run: pip3 install requests
- - name: Install Copilot CLI
- run: curl -fsSL https://gh.io/copilot-install | bash
- name: Analyze and report
env:
GITHUB_TOKEN: ${{ github.token }}
@@ -586,8 +584,6 @@ jobs:
find ./test-reports ./test-logs -type f | head -50
- name: Install dependencies
run: pip3 install requests
- - name: Install Copilot CLI
- run: curl -fsSL https://gh.io/copilot-install | bash
- name: Analyze and report
env:
GITHUB_TOKEN: ${{ github.token }}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
(gluten) 01/10: [GLUTEN-10134][VL] Fix recursive glob for JSON offload data in analyze script
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
baibaichen pushed a commit to branch feature/ansi-baseline-workflow
in repository https://gitbox.apache.org/repos/asf/gluten.git
commit 3a97685e027b9cc1814ee02177747fc42d283677
Author: Chang chen <ch...@apache.org>
AuthorDate: Mon Apr 20 22:00:59 2026 +0800
[GLUTEN-10134][VL] Fix recursive glob for JSON offload data in analyze script
Upload preserves directory structure, so downloaded JSON files are nested
under gluten-ut/spark4x/target/ansi-offload/. Use recursive glob to find them.
Co-Authored-By: Claude Opus 4 <no...@anthropic.com>
---
.github/scripts/analyze-ansi.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/scripts/analyze-ansi.py b/.github/scripts/analyze-ansi.py
index c91993d9ad..394338d688 100644
--- a/.github/scripts/analyze-ansi.py
+++ b/.github/scripts/analyze-ansi.py
@@ -71,7 +71,7 @@ def load_json_data(json_dir):
suites = []
if not json_dir or not os.path.isdir(json_dir):
return suites
- for path in sorted(glob.glob(os.path.join(json_dir, "*.json"))):
+ for path in sorted(glob.glob(os.path.join(json_dir, "**/*.json"), recursive=True)):
with open(path) as f:
try:
data = json.load(f)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
(gluten) 06/10: [GLUTEN-10134][VL] Fix jq expression for finding workflow runs with artifacts
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
baibaichen pushed a commit to branch feature/ansi-baseline-workflow
in repository https://gitbox.apache.org/repos/asf/gluten.git
commit f39de9f50764b5bf3934d33c787df62651c22b24
Author: Chang chen <ch...@apache.org>
AuthorDate: Tue Apr 21 00:54:00 2026 +0800
[GLUTEN-10134][VL] Fix jq expression for finding workflow runs with artifacts
Co-Authored-By: Claude Opus 4 <no...@anthropic.com>
---
.github/workflows/velox_backend_ansi.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/velox_backend_ansi.yml b/.github/workflows/velox_backend_ansi.yml
index 5b0fb95fa9..4409977c5c 100644
--- a/.github/workflows/velox_backend_ansi.yml
+++ b/.github/workflows/velox_backend_ansi.yml
@@ -541,7 +541,7 @@ jobs:
PR_BRANCH="${{ needs.check-comment.outputs.pr_ref }}"
echo "Looking for latest ANSI run with artifacts on branch=${PR_BRANCH}..."
CANDIDATE_IDS=$(gh api "repos/${REPO}/actions/workflows/${WORKFLOW}/runs?branch=${PR_BRANCH}&per_page=15" \
- --jq "[.workflow_runs[] | select(.id != ${{ github.run_id }})].id | .[]")
+ --jq '.workflow_runs[] | select(.id != ${{ github.run_id }}) | .id')
RUN_ID=""
for cid in $CANDIDATE_IDS; do
HAS_OFFLOAD=$(gh api "repos/${REPO}/actions/runs/${cid}/artifacts" \
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
(gluten) 09/10: [GLUTEN-10134][VL] Compact AI context to fit GitHub Models 16K token limit
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
baibaichen pushed a commit to branch feature/ansi-baseline-workflow
in repository https://gitbox.apache.org/repos/asf/gluten.git
commit d5af4441cbb1b3c4618abc0b54112bcbfbdd6904
Author: Chang chen <ch...@apache.org>
AuthorDate: Tue Apr 21 01:08:22 2026 +0800
[GLUTEN-10134][VL] Compact AI context to fit GitHub Models 16K token limit
Co-Authored-By: Claude Opus 4 <no...@anthropic.com>
---
.github/scripts/analyze-ansi.py | 41 +++++++++++++++++++++++++++++++++++++----
1 file changed, 37 insertions(+), 4 deletions(-)
diff --git a/.github/scripts/analyze-ansi.py b/.github/scripts/analyze-ansi.py
index 92266a964a..48612018d9 100644
--- a/.github/scripts/analyze-ansi.py
+++ b/.github/scripts/analyze-ansi.py
@@ -764,12 +764,46 @@ def format_json_output(summary, json_tests, xml_tests, categories):
# ---------------------------------------------------------------------------
-# AI analysis via Copilot CLI
+# AI analysis via GitHub Models API
# ---------------------------------------------------------------------------
GITHUB_MODELS_API = "https://models.inference.ai.azure.com/chat/completions"
+def _build_ai_context(summary, categories):
+ """Build a compact JSON context for AI analysis (fits within 16K token limit)."""
+ compact_failures = []
+ for f in summary["failures"][:100]:
+ cause = classify_fail_cause(f.get("message", ""))
+ short_msg = _extract_short_message(f.get("message", ""))
+ compact_failures.append({
+ "suite": f["suite"].split(".")[-1],
+ "test": f["test"],
+ "source": f.get("source", ""),
+ "cause": cause,
+ "message": short_msg[:120],
+ })
+
+ compact_cats = {}
+ for cat, data in categories.items():
+ compact_cats[cat] = {
+ "tests_pass": data["tests_pass"],
+ "tests_fail": data["tests_fail"],
+ "suites": sorted(data["suites"]),
+ }
+
+ output = {
+ "total": summary["total"],
+ "json_test_count": summary["json_test_count"],
+ "xml_test_count": summary["xml_test_count"],
+ "by_color": summary["by_color"],
+ "failure_count": len(summary["failures"]),
+ "failures": compact_failures,
+ "categories": compact_cats,
+ }
+ return json.dumps(output, indent=2, ensure_ascii=False)
+
+
def call_ai_analysis(json_output, model=None):
"""Call GitHub Models API for deep analysis with fallback chain.
@@ -889,11 +923,10 @@ def main():
elif args.mode == "full":
ai_content, ai_model = None, None
if args.ai_analysis:
- json_output = format_json_output(
- summary, json_tests, xml_tests, categories)
+ ai_context = _build_ai_context(summary, categories)
model = args.ai_model or os.environ.get("AI_MODEL", "")
ai_content, ai_model = call_ai_analysis(
- json_output, model or None)
+ ai_context, model or None)
report = format_full(summary, json_tests, categories, suites,
ai_content=ai_content, ai_model=ai_model)
elif args.mode == "json":
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
(gluten) 05/10: [GLUTEN-10134][VL] Fix analyze-only: find run with actual artifacts instead of latest run
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
baibaichen pushed a commit to branch feature/ansi-baseline-workflow
in repository https://gitbox.apache.org/repos/asf/gluten.git
commit 957a870b6f7fdd38a6452f82169e46415fb4d9aa
Author: Chang chen <ch...@apache.org>
AuthorDate: Tue Apr 21 00:51:05 2026 +0800
[GLUTEN-10134][VL] Fix analyze-only: find run with actual artifacts instead of latest run
Co-Authored-By: Claude Opus 4 <no...@anthropic.com>
---
.github/workflows/velox_backend_ansi.yml | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/.github/workflows/velox_backend_ansi.yml b/.github/workflows/velox_backend_ansi.yml
index 599f912fb3..5b0fb95fa9 100644
--- a/.github/workflows/velox_backend_ansi.yml
+++ b/.github/workflows/velox_backend_ansi.yml
@@ -531,28 +531,31 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ needs.check-comment.outputs.pr_sha }}
- - name: Find latest ANSI workflow run
+ - name: Find latest ANSI workflow run with artifacts
id: find-run
env:
GH_TOKEN: ${{ github.token }}
run: |
- PR_SHA="${{ needs.check-comment.outputs.pr_sha }}"
REPO="${{ github.repository }}"
WORKFLOW="velox_backend_ansi.yml"
- echo "Looking for latest ANSI run for SHA=${PR_SHA}..."
- RUN_ID=$(gh api "repos/${REPO}/actions/workflows/${WORKFLOW}/runs?head_sha=${PR_SHA}&per_page=5" \
- --jq '[.workflow_runs[] | select(.id != ${{ github.run_id }})][0].id')
- if [[ -z "$RUN_ID" || "$RUN_ID" == "null" ]]; then
- echo "No previous ANSI run found for this PR SHA, trying branch..."
- PR_BRANCH="${{ needs.check-comment.outputs.pr_ref }}"
- RUN_ID=$(gh api "repos/${REPO}/actions/workflows/${WORKFLOW}/runs?branch=${PR_BRANCH}&per_page=10" \
- --jq '[.workflow_runs[] | select(.id != ${{ github.run_id }})][0].id')
- fi
- if [[ -z "$RUN_ID" || "$RUN_ID" == "null" ]]; then
- echo "::error::No previous ANSI workflow run found for PR"
+ PR_BRANCH="${{ needs.check-comment.outputs.pr_ref }}"
+ echo "Looking for latest ANSI run with artifacts on branch=${PR_BRANCH}..."
+ CANDIDATE_IDS=$(gh api "repos/${REPO}/actions/workflows/${WORKFLOW}/runs?branch=${PR_BRANCH}&per_page=15" \
+ --jq "[.workflow_runs[] | select(.id != ${{ github.run_id }})].id | .[]")
+ RUN_ID=""
+ for cid in $CANDIDATE_IDS; do
+ HAS_OFFLOAD=$(gh api "repos/${REPO}/actions/runs/${cid}/artifacts" \
+ --jq '[.artifacts[] | select(.name | startswith("ansi-offload-"))] | length')
+ if [[ "$HAS_OFFLOAD" -gt 0 ]]; then
+ RUN_ID=$cid
+ echo "Found run ${RUN_ID} with ${HAS_OFFLOAD} offload artifacts"
+ break
+ fi
+ done
+ if [[ -z "$RUN_ID" ]]; then
+ echo "::error::No previous ANSI workflow run with artifacts found"
exit 1
fi
- echo "Found run: ${RUN_ID}"
echo "run_id=${RUN_ID}" >> $GITHUB_OUTPUT
- name: Download artifacts from previous run
env:
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
(gluten) 04/10: [GLUTEN-10134][VL] Remove invalid copilot_requests permission from workflow
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
baibaichen pushed a commit to branch feature/ansi-baseline-workflow
in repository https://gitbox.apache.org/repos/asf/gluten.git
commit 8126c03bc1b57b2a368dc756d05bef2de7a2ed09
Author: Chang chen <ch...@apache.org>
AuthorDate: Tue Apr 21 00:44:42 2026 +0800
[GLUTEN-10134][VL] Remove invalid copilot_requests permission from workflow
Co-Authored-By: Claude Opus 4 <no...@anthropic.com>
---
.github/workflows/velox_backend_ansi.yml | 2 --
1 file changed, 2 deletions(-)
diff --git a/.github/workflows/velox_backend_ansi.yml b/.github/workflows/velox_backend_ansi.yml
index 97d6a5cb5d..599f912fb3 100644
--- a/.github/workflows/velox_backend_ansi.yml
+++ b/.github/workflows/velox_backend_ansi.yml
@@ -479,7 +479,6 @@ jobs:
permissions:
contents: read
pull-requests: write
- copilot_requests: write
steps:
- uses: actions/checkout@v4
with:
@@ -528,7 +527,6 @@ jobs:
permissions:
contents: read
pull-requests: write
- copilot_requests: write
steps:
- uses: actions/checkout@v4
with:
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
(gluten) 10/10: [GLUTEN-10134][VL] Restructure report: JSON-only overview, XML failed suite summary
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
baibaichen pushed a commit to branch feature/ansi-baseline-workflow
in repository https://gitbox.apache.org/repos/asf/gluten.git
commit 94904ab5d9255542e87bafda5acd4daa95d219c8
Author: Chang chen <ch...@apache.org>
AuthorDate: Tue Apr 21 01:33:39 2026 +0800
[GLUTEN-10134][VL] Restructure report: JSON-only overview, XML failed suite summary
Overview three-color stats now only count JSON expression tests (not XML).
XML section shows failed suite summary (suite name + failure count),
excluding suites already present in JSON data.
Co-Authored-By: Claude Opus 4 <no...@anthropic.com>
---
.github/scripts/analyze-ansi.py | 64 ++++++++++++++++++++++-------------------
1 file changed, 35 insertions(+), 29 deletions(-)
diff --git a/.github/scripts/analyze-ansi.py b/.github/scripts/analyze-ansi.py
index 48612018d9..1d284e2545 100644
--- a/.github/scripts/analyze-ansi.py
+++ b/.github/scripts/analyze-ansi.py
@@ -434,24 +434,25 @@ def _worse(a, b):
def format_summary(summary, json_tests, suites=None):
"""Format test-level summary as markdown."""
lines = ["## ANSI Mode Test Analysis Report\n"]
- lines.append(f"**Total tests: {summary['total']}** "
- f"(JSON: {summary['json_test_count']}, "
- f"XML: {summary['xml_test_count']})\n")
+ json_total = summary["json_test_count"]
+ xml_total = summary["xml_test_count"]
+ lines.append(f"**JSON tests: {json_total}** | "
+ f"**XML suites: {xml_total} tests**\n")
- # --- Overview with percentage ---
- lines.append("### Overview\n")
+ # --- Overview: JSON-only three-color stats ---
+ lines.append("### Overview (JSON Expression Tests)\n")
lines.append("| Classification | Count | % |")
lines.append("|---|---|---|")
- for label in ["Passed+Offload", "Failed+Offload", "Passed+Fallback",
- "Failed+Fallback", "Failed", "Passed (no data)",
- "Failed (no data)", "Skipped"]:
+ json_labels = ["Passed+Offload", "Failed+Offload", "Passed+Fallback",
+ "Failed+Fallback", "Failed"]
+ color_map = {"Passed+Offload": "🟢", "Failed+Offload": "🟡",
+ "Passed+Fallback": "🔴", "Failed+Fallback": "🔴",
+ "Failed": "🟡"}
+ for label in json_labels:
count = summary["by_color"].get(label, 0)
if count > 0:
- color = {"Passed+Offload": "🟢", "Failed+Offload": "🟡",
- "Passed+Fallback": "🔴", "Failed+Fallback": "🔴",
- "Failed": "🟡", "Passed (no data)": "⚪",
- "Failed (no data)": "🟡", "Skipped": "⚪"}.get(label, "")
- pct = count * 100 / summary["total"] if summary["total"] else 0
+ color = color_map.get(label, "")
+ pct = count * 100 / json_total if json_total else 0
lines.append(f"| {color} {label} | {count} | {pct:.1f}% |")
lines.append("")
@@ -547,23 +548,28 @@ def format_summary(summary, json_tests, suites=None):
f"\n*...and {len(json_failures) - 50} more*\n")
lines.append("")
- # --- Failed Tests: XML ---
+ # --- XML: failed suite summary (exclude suites already in JSON) ---
if xml_failures:
- lines.append(f"### Failed Tests — Integration Suites "
- f"(XML, {len(xml_failures)} failures)\n")
- lines.append("| Suite | Test | Job | Message |")
- lines.append("|---|---|---|---|")
- for f in xml_failures[:30]:
- msg = (f.get("message") or "")[:150]
- msg = msg.replace("|", "\\|").replace("\n", " ")
- suite_short = f["suite"].split(".")[-1]
- job = f.get("job", "")
- lines.append(
- f"| {suite_short} | {f['test']} | {job} | {msg} |")
- if len(xml_failures) > 30:
- lines.append(
- f"\n*...and {len(xml_failures) - 30} more*\n")
- lines.append("")
+ json_suite_names = set()
+ if suites:
+ for s in suites:
+ json_suite_names.add(s.get("suite", ""))
+ json_suite_names.add(s.get("suite", "").split(".")[-1])
+ xml_suite_counts = defaultdict(int)
+ for f in xml_failures:
+ suite = f["suite"]
+ short = suite.split(".")[-1]
+ if suite not in json_suite_names and short not in json_suite_names:
+ xml_suite_counts[short] += 1
+ if xml_suite_counts:
+ lines.append(f"### Failed XML Suites "
+ f"(not in JSON, {sum(xml_suite_counts.values())} failures)\n")
+ lines.append("| Suite | Failures |")
+ lines.append("|---|---|")
+ for suite, cnt in sorted(xml_suite_counts.items(),
+ key=lambda x: -x[1]):
+ lines.append(f"| {suite} | {cnt} |")
+ lines.append("")
return "\n".join(lines)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
(gluten) 03/10: [GLUTEN-10134][VL] Fix Copilot CLI auth in CI: add copilot_requests permission and GITHUB_TOKEN
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
baibaichen pushed a commit to branch feature/ansi-baseline-workflow
in repository https://gitbox.apache.org/repos/asf/gluten.git
commit b4321ea211445ed055c930f55cd1f46686d1fa78
Author: Chang chen <ch...@apache.org>
AuthorDate: Tue Apr 21 00:42:17 2026 +0800
[GLUTEN-10134][VL] Fix Copilot CLI auth in CI: add copilot_requests permission and GITHUB_TOKEN
Co-Authored-By: Claude Opus 4 <no...@anthropic.com>
---
.github/scripts/analyze-ansi.py | 4 +++-
.github/workflows/velox_backend_ansi.yml | 10 ++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.github/scripts/analyze-ansi.py b/.github/scripts/analyze-ansi.py
index 5f93f42d07..97fa1c62d5 100644
--- a/.github/scripts/analyze-ansi.py
+++ b/.github/scripts/analyze-ansi.py
@@ -817,7 +817,9 @@ def call_copilot_analysis(json_output, model=None):
print(f"Warning: copilot --model {m} returned empty or failed "
f"(rc={result.returncode})", file=sys.stderr)
if result.stderr:
- print(f" stderr: {result.stderr[:200]}", file=sys.stderr)
+ print(f" stderr: {result.stderr[:500]}", file=sys.stderr)
+ if result.stdout:
+ print(f" stdout: {result.stdout[:200]}", file=sys.stderr)
except subprocess.TimeoutExpired:
print(f"Warning: copilot --model {m} timed out", file=sys.stderr)
except FileNotFoundError:
diff --git a/.github/workflows/velox_backend_ansi.yml b/.github/workflows/velox_backend_ansi.yml
index 80cddb5f04..97d6a5cb5d 100644
--- a/.github/workflows/velox_backend_ansi.yml
+++ b/.github/workflows/velox_backend_ansi.yml
@@ -476,6 +476,10 @@ jobs:
- spark-test-spark-ut-ansi-spark40
if: always() && needs.check-comment.result == 'success' && inputs.mode != 'analyze-only'
runs-on: ubuntu-22.04
+ permissions:
+ contents: read
+ pull-requests: write
+ copilot_requests: write
steps:
- uses: actions/checkout@v4
with:
@@ -502,6 +506,7 @@ jobs:
run: curl -fsSL https://gh.io/copilot-install | bash
- name: Analyze and report
env:
+ GITHUB_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ github.token }}
AI_MODEL: ${{ needs.check-comment.outputs.ai_model }}
PR_NUMBER: ${{ needs.check-comment.outputs.pr_number }}
@@ -520,6 +525,10 @@ jobs:
needs: check-comment
if: inputs.mode == 'analyze-only'
runs-on: ubuntu-22.04
+ permissions:
+ contents: read
+ pull-requests: write
+ copilot_requests: write
steps:
- uses: actions/checkout@v4
with:
@@ -580,6 +589,7 @@ jobs:
run: curl -fsSL https://gh.io/copilot-install | bash
- name: Analyze and report
env:
+ GITHUB_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ github.token }}
AI_MODEL: ${{ needs.check-comment.outputs.ai_model }}
PR_NUMBER: ${{ needs.check-comment.outputs.pr_number }}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
(gluten) 08/10: [GLUTEN-10134][VL] Add models:read permission for GitHub Models API access
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
baibaichen pushed a commit to branch feature/ansi-baseline-workflow
in repository https://gitbox.apache.org/repos/asf/gluten.git
commit 38e7944700b86117b62d0236400d444c9418658b
Author: Chang chen <ch...@apache.org>
AuthorDate: Tue Apr 21 01:04:52 2026 +0800
[GLUTEN-10134][VL] Add models:read permission for GitHub Models API access
Co-Authored-By: Claude Opus 4 <no...@anthropic.com>
---
.github/workflows/velox_backend_ansi.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/workflows/velox_backend_ansi.yml b/.github/workflows/velox_backend_ansi.yml
index 627dd5aa13..5d077b648c 100644
--- a/.github/workflows/velox_backend_ansi.yml
+++ b/.github/workflows/velox_backend_ansi.yml
@@ -479,6 +479,7 @@ jobs:
permissions:
contents: read
pull-requests: write
+ models: read
steps:
- uses: actions/checkout@v4
with:
@@ -525,6 +526,7 @@ jobs:
permissions:
contents: read
pull-requests: write
+ models: read
steps:
- uses: actions/checkout@v4
with:
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org