Skip to content

Commit 53f5aeb

Browse files
authored
Release (#1985)
* fix: docs dead links (#1984) * fix: docs dead links * fix: add /en prefix to english docs * feat: upgrade chrome extension to manifest v3 and react to v18 - Upgrade manifest version from v2 to v3 with updated permissions format - Migrate background scripts to service worker - Update content_security_policy and web_accessible_resources format - Replace browser_action with action - Upgrade react and react-dom from v16 to v18 in g-devtool - Update devtool UI to support React 18 createRoot API - Maintain backward compatibility with legacy versions - Update minimum chrome version requirement to 88 * feat: add GitHub workflow for bug report reproduction check - Add new GitHub Actions workflow 'bug-report-reproduction-check' - Automatically analyze new bug reports for reproduction steps - Use Mistral AI to check for complete reproduction information - Add friendly comment when reproduction details are missing - Only trigger for issues labeled as 'bug' - Add necessary permissions for issues and models access * fix(workflow): correct indentation in bug report reproduction workflow Fix the YAML indentation for the github-script action to properly format the comment response in the bug report workflow. * feat(workflow): add weekly issue summary automation - Add GitHub Actions workflow for generating weekly issue summaries - Include prompt template for issue summarization using gh-models - Schedule to run every Monday at 09:00 * feat(workflow): add monthly issue metrics automation - Add GitHub Actions workflow to generate monthly issue metrics reports - Schedule to run on the 1st day of each month - Use github/issue-metrics to track issue statistics - Automatically create an issue with the metrics report This will help track and visualize issue metrics over time.
1 parent 6369e6e commit 53f5aeb

201 files changed

Lines changed: 1705 additions & 6106 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Bug Report Reproduction Check
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
permissions:
8+
contents: read
9+
issues: write
10+
models: read
11+
12+
jobs:
13+
reproduction-steps-check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Fetch Issue
17+
id: issue
18+
uses: actions/github-script@v7
19+
with:
20+
script: |
21+
const issue = await github.rest.issues.get({
22+
owner: context.repo.owner,
23+
repo: context.repo.repo,
24+
issue_number: context.issue.number
25+
})
26+
core.setOutput('title', issue.data.title)
27+
core.setOutput('body', issue.data.body)
28+
29+
- name: Analyze Issue For Reproduction
30+
if: contains(join(github.event.issue.labels.*.name, ','), 'bug')
31+
id: analyze-issue
32+
uses: actions/ai-inference@v1
33+
with:
34+
model: mistral-ai/ministral-3b
35+
system-prompt: |
36+
Given a bug report title and text for an application, return 'pass' if there is enough information to reliably reproduce the issue, meaning the report clearly describes the steps to reproduce the problem, specifies the expected and actual behavior, and includes environment details such as browser and operating system; if any of these elements are missing or unclear, return a brief description of what is missing in a friendly response to the author instead of 'pass'. Consider the following title and body:
37+
prompt: |
38+
Title: ${{ steps.issue.outputs.title }}
39+
Body: ${{ steps.issue.outputs.body }}
40+
41+
- name: Comment On Issue
42+
if: contains(join(github.event.issue.labels.*.name, ','), 'bug') && steps.analyze-issue.outputs.response != 'pass'
43+
uses: actions/github-script@v7
44+
env:
45+
AI_RESPONSE: steps.analyze-issue.outputs.response
46+
with:
47+
script: |
48+
await github.rest.issues.createComment({
49+
owner: context.repo.owner,
50+
repo: context.repo.repo,
51+
issue_number: context.issue.number,
52+
body: process.env.AI_RESPONSE
53+
})
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Monthly issue metrics
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '3 2 1 * *'
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
name: issue metrics
14+
runs-on: ubuntu-latest
15+
permissions:
16+
issues: write
17+
pull-requests: read
18+
steps:
19+
- name: Get dates for last month
20+
shell: bash
21+
run: |
22+
# Calculate the first day of the previous month
23+
first_day=$(date -d "last month" +%Y-%m-01)
24+
25+
# Calculate the last day of the previous month
26+
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
27+
28+
#Set an environment variable with the date range
29+
echo "$first_day..$last_day"
30+
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
31+
32+
- name: Run issue-metrics tool
33+
uses: github/issue-metrics@v3
34+
env:
35+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
SEARCH_QUERY: 'repo:owner/repo is:issue created:${{ env.last_month }} -reason:"not planned"'
37+
38+
- name: Create issue
39+
uses: peter-evans/create-issue-from-file@v5
40+
with:
41+
title: Monthly issue metrics report
42+
token: ${{ secrets.GITHUB_TOKEN }}
43+
content-filepath: ./issue_metrics.md
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Weekly Issue Summary
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 9 * * 1'
7+
8+
permissions:
9+
issues: write
10+
contents: read
11+
models: read
12+
13+
jobs:
14+
create_weekly_summary:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Install gh-models extension
21+
run: gh extension install https://github.com/github/gh-models
22+
env:
23+
GH_TOKEN: ${{ github.token }}
24+
25+
- name: Get issues from the past week
26+
id: get_issues
27+
run: |-
28+
LAST_WEEK=$(date -d "7 days ago" +"%Y-%m-%d")
29+
gh search issues "created:>$LAST_WEEK" --state=open --json title,body,url --repo ${{ github.repository }} > issues.json
30+
31+
- name: Generate summary using gh models
32+
id: summary
33+
run: |
34+
summary=$(cat issues.json | gh models run --file prompts/issue-summary.prompt.yml)
35+
echo "summary_output<<EOF" >> $GITHUB_OUTPUT
36+
echo "$summary" >> $GITHUB_OUTPUT
37+
echo "EOF" >> $GITHUB_OUTPUT
38+
39+
- name: Create issue with summary
40+
if: steps.summary.outputs.summary_output
41+
run: |
42+
gh issue create \
43+
--title "Weekly Issue Summary - $(date +%F)" \
44+
--body "$summary_output"
45+
env:
46+
summary_output: ${{ steps.summary.outputs.summary_output }}

packages/g-devtool/README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
> A devtool for @antv/g in chrome, it's still WIP, you can load it in unpack way;
44
5+
## Update Notice
6+
7+
This extension has been updated to Manifest V3 to maintain compatibility with modern versions of Chrome. If you were previously using the Manifest V2 version, please reload the extension after updating.
8+
59
## Quick Start
610

711
### Import unpacked plugin
@@ -50,22 +54,13 @@ window.__g_instances__.push(canvas);
5054
#### In S2
5155

5256
```javascript
57+
// init window hook
5358
window.__g_instances__ = [];
5459

55-
// in native
56-
var canvas = spreadSheet.container;
60+
var canvas = s2.getCanvas();
5761

5862
window.__g_instances__.push(canvas);
5963

60-
// in S2 react
61-
<SpreadSheet
62-
{...blablabla}
63-
getSpreadSheet={(sp) => {
64-
window.__g_instances__ = [sp.container];
65-
}}
66-
/>;
67-
```
68-
6964
### Using devtool
7065

7166
After these steps, the tab 'AntV G' should show in devtools' tab, select it and choose a canvas
@@ -85,3 +80,4 @@ After these steps, the tab 'AntV G' should show in devtools' tab, select it and
8580
### Using select element directly in canvas
8681
8782
![image](https://user-images.githubusercontent.com/15213473/150082485-46b5c750-de64-42f7-882b-a3ff4db95826.png)
83+
```

packages/g-devtool/devtools/manifest.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@
33
"description": "devtool for g canvas",
44
"version": "0.3.0",
55
"devtools_page": "g_devtools.html",
6-
"minimum_chrome_version": "49",
7-
"manifest_version": 2,
8-
"permissions": ["file:///*", "http://*/*", "https://*/*"],
6+
"minimum_chrome_version": "88",
7+
"manifest_version": 3,
8+
"permissions": ["scripting"],
9+
"host_permissions": ["file:///*", "http://*/*", "https://*/*"],
910
"icons": {
1011
"16": "icons/16.png",
1112
"32": "icons/32.png",
1213
"48": "icons/48.png",
1314
"128": "icons/128.png"
1415
},
15-
16-
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
17-
"web_accessible_resources": ["main.html", "panel.html", "script/backend.js"],
18-
"browser_action": {}
16+
"content_security_policy": {
17+
"extension_pages": "script-src 'self'; object-src 'self'"
18+
},
19+
"web_accessible_resources": [
20+
{
21+
"resources": ["main.html", "panel.html", "script/backend.js"],
22+
"matches": ["<all_urls>"]
23+
}
24+
],
25+
"action": {}
1926
}

packages/g-devtool/devtools/panel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!doctype html>
22
<html style="display: flex">
33
<head>
4-
<meta charset="utf8">
4+
<meta charset="utf-8">
55
<style>
66
html {
77
display: flex;

packages/g-devtool/devtools/script/background.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
chrome.runtime.onMessage.addListener((req, sender) => {
22
if (req.isAntVG && sender && sender.tab) {
33
if (req.disabled) {
4-
chrome.browserAction.setIcon({
4+
chrome.action.setIcon({
55
tabId: sender.tab.id,
66
path: 'icons/48-disabled.png'
77
})
88
} else {
9-
chrome.browserAction.setIcon({
9+
chrome.action.setIcon({
1010
tabId: sender.tab.id,
1111
path: {
1212
"16": "icons/16.png",

0 commit comments

Comments
 (0)