mirror of
https://github.com/vitejs/vite.git
synced 2026-10-28 08:25:27 +08:00
ci: remove warp oz (#23043)
This commit is contained in:
1 parent
a54f936c11
commit
d17d739eed
3 files changed
-247
No files matched your search
@@ -1,143 +0,0 @@
|
||||
name: Issue Template Check
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
evaluate-issue:
|
||||
if: "!github.event.issue.pull_request"
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
issues: read
|
||||
pull-requests: read
|
||||
outputs:
|
||||
agent_output: ${{ steps.agent.outputs.agent_output }}
|
||||
template_type: ${{ steps.detect.outputs.template_type }}
|
||||
skip: ${{ steps.detect.outputs.skip }}
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Detect issue type
|
||||
id: detect
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
||||
with:
|
||||
script: |
|
||||
const labels = context.payload.issue.labels.map(l => l.name);
|
||||
const issueType = context.payload.issue.type?.name;
|
||||
|
||||
if (issueType === 'Bug') {
|
||||
core.setOutput('template_type', 'bug_report');
|
||||
core.setOutput('skip', 'false');
|
||||
} else if (issueType === 'Feature') {
|
||||
core.setOutput('template_type', 'feature_request');
|
||||
core.setOutput('skip', 'false');
|
||||
} else if (labels.includes('documentation')) {
|
||||
core.setOutput('template_type', 'docs');
|
||||
core.setOutput('skip', 'false');
|
||||
} else {
|
||||
core.info('Issue was not created from a recognized template. Skipping.');
|
||||
core.setOutput('template_type', 'unknown');
|
||||
core.setOutput('skip', 'true');
|
||||
}
|
||||
|
||||
- uses: warpdotdev/oz-agent-action@ce1621abf6a8ed8afdd4e4cc994545ede8fe1c6f # v1
|
||||
if: steps.detect.outputs.skip == 'false'
|
||||
id: agent
|
||||
with:
|
||||
prompt: |
|
||||
You are an issue reviewer for the Vite project.
|
||||
|
||||
The issue template type detected is: ${{ steps.detect.outputs.template_type }}
|
||||
|
||||
Read the matching issue template from the checked-out repository at:
|
||||
.github/ISSUE_TEMPLATE/${{ steps.detect.outputs.template_type }}.yml
|
||||
|
||||
Then evaluate the following issue to determine if it faithfully follows that template.
|
||||
|
||||
Issue title: ${{ github.event.issue.title }}
|
||||
Issue body:
|
||||
${{ github.event.issue.body }}
|
||||
|
||||
Here is a summary of the required fields per template type:
|
||||
|
||||
**bug_report** required fields:
|
||||
1. Describe the bug (required) - A clear and concise description, not vague or just a generic error message
|
||||
2. Reproduction (required) - A valid link to a reproduction (vite.new or GitHub repo URL), not empty or plain text
|
||||
3. Steps to reproduce - Steps needed to reproduce (optional)
|
||||
4. System Info (required) - Output of the envinfo command, must look like actual system/envinfo output
|
||||
5. Used Package Manager (required) - One of: npm, yarn, pnpm, bun
|
||||
6. Logs - Optional error logs
|
||||
7. Validations (required) - All checkboxes must be checked
|
||||
|
||||
**feature_request** required fields:
|
||||
1. Description (required) - Clear and concise description of the problem and use cases
|
||||
2. Suggested solution (required) - A proposed implementation or approach. If it suggests a new option, check against "Think Before Adding Yet Another Option" in the CONTRIBUTING.md
|
||||
3. Alternative - Alternative solutions considered (optional)
|
||||
4. Additional context - Any other context (optional)
|
||||
5. Validations (required) - All checkboxes must be checked
|
||||
|
||||
**docs** required fields:
|
||||
1. Documentation is - Checkboxes indicating the issue type: Missing, Outdated, Confusing, Not sure (optional but at least one should be checked)
|
||||
2. Explain in Detail (required) - A clear description of the documentation issue
|
||||
3. Your Suggestion for Changes (required) - What should be changed
|
||||
4. Reproduction - Optional link via vite.new or GitHub repo
|
||||
5. Steps to reproduce - Optional reproduction steps
|
||||
|
||||
Evaluate the issue against the criteria for its detected template type. Focus on whether the required fields are present and substantive (not empty placeholders or placeholder text).
|
||||
|
||||
Respond with ONLY a JSON object (no markdown fencing) with these fields:
|
||||
- "template": the template type that was checked
|
||||
- "compliant": true/false
|
||||
- "missing": an array of strings describing what is missing or inadequate (empty array if compliant)
|
||||
- "comment": a polite, helpful comment to post if non-compliant, formatted in GitHub markdown. Address the user by their username @${{ github.event.issue.user.login }}. Ask them to update the issue with the missing information. Reference the specific template they should follow. Be concise.
|
||||
output_format: json
|
||||
warp_api_key: ${{ secrets.WARP_API_KEY }}
|
||||
profile: ${{ vars.WARP_AGENT_PROFILE || '' }}
|
||||
|
||||
post-results:
|
||||
needs: evaluate-issue
|
||||
if: needs.evaluate-issue.outputs.skip == 'false' && needs.evaluate-issue.outputs.agent_output
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
steps:
|
||||
- name: Write result to summary
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
||||
env:
|
||||
TEMPLATE_TYPE: ${{ needs.evaluate-issue.outputs.template_type }}
|
||||
AGENT_OUTPUT: ${{ needs.evaluate-issue.outputs.agent_output }}
|
||||
with:
|
||||
script: |
|
||||
const output = process.env.AGENT_OUTPUT;
|
||||
const templateType = process.env.TEMPLATE_TYPE;
|
||||
|
||||
try {
|
||||
// The agent outputs streaming JSON format with multiple lines
|
||||
// We need to extract the last line with type:"agent" and parse its text field
|
||||
const lines = output.trim().split('\n');
|
||||
let agentText = null;
|
||||
for (const line of lines) {
|
||||
try {
|
||||
const parsed = JSON.parse(line);
|
||||
if (parsed.type === 'agent' && parsed.text) {
|
||||
agentText = parsed.text;
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
if (agentText) {
|
||||
await core.summary
|
||||
.addHeading(`Issue Template Check (${templateType})`)
|
||||
.addCodeBlock(agentText, 'json')
|
||||
.write();
|
||||
} else {
|
||||
core.setFailed('No agent output found in response');
|
||||
}
|
||||
} catch (e) {
|
||||
core.setFailed(`Failed to write summary: ${e.message}`);
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
name: Pull Request Template Check
|
||||
|
||||
on:
|
||||
# zizmor: ignore[dangerous-triggers]
|
||||
# SAFETY: pull_request_target is used here because:
|
||||
# - The workflow does NOT check out PR code (actions/checkout checks out the base branch)
|
||||
# - Only PR metadata (title, body) from the event payload is read
|
||||
# - No PR-supplied code is executed
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
evaluate-pr:
|
||||
if: github.repository == 'vitejs/vite'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
issues: read
|
||||
pull-requests: read
|
||||
outputs:
|
||||
agent_output: ${{ steps.agent.outputs.agent_output }}
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- uses: warpdotdev/oz-agent-action@ce1621abf6a8ed8afdd4e4cc994545ede8fe1c6f # v1
|
||||
id: agent
|
||||
with:
|
||||
prompt: |
|
||||
You are a pull request reviewer for the Vite project.
|
||||
|
||||
Read the PR template from the checked-out repository at:
|
||||
.github/PULL_REQUEST_TEMPLATE.md
|
||||
|
||||
Then evaluate the following pull request to determine if it faithfully follows that template's guidelines.
|
||||
|
||||
PR title: ${{ github.event.pull_request.title }}
|
||||
PR body:
|
||||
${{ github.event.pull_request.body }}
|
||||
|
||||
Based on the PR template, check for the following:
|
||||
|
||||
1. **Description** (required) - A clear and concise description of what the PR solves
|
||||
2. **Issue reference** (required) - References to related issues (e.g. `fixes #123`)
|
||||
3. **Alternatives explored** (optional but encouraged) - Mention of other approaches considered
|
||||
4. **Acknowledgments** (required) - Evidence that the author has:
|
||||
- Read the Contributing Guidelines
|
||||
- Checked for duplicate PRs
|
||||
- Considered documentation updates
|
||||
- Included relevant tests (or explained why not)
|
||||
|
||||
Evaluate the PR against these criteria. Focus on whether the required information is present and substantive (not empty placeholders or placeholder text).
|
||||
|
||||
Respond with ONLY a JSON object (no markdown fencing) with these fields:
|
||||
- "compliant": true/false
|
||||
- "missing": an array of strings describing what is missing or inadequate (empty array if compliant)
|
||||
- "comment": a polite, helpful comment to post if non-compliant, formatted in GitHub markdown. Address the user by their username @${{ github.event.pull_request.user.login }}. Ask them to update the PR with the missing information. Reference the PR template they should follow. Be concise.
|
||||
output_format: json
|
||||
warp_api_key: ${{ secrets.WARP_API_KEY }}
|
||||
profile: ${{ vars.WARP_AGENT_PROFILE || '' }}
|
||||
|
||||
post-results:
|
||||
needs: evaluate-pr
|
||||
if: needs.evaluate-pr.outputs.agent_output
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Write result to summary
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
||||
env:
|
||||
AGENT_OUTPUT: ${{ needs.evaluate-pr.outputs.agent_output }}
|
||||
with:
|
||||
script: |
|
||||
const output = process.env.AGENT_OUTPUT;
|
||||
|
||||
try {
|
||||
// The agent outputs streaming JSON format with multiple lines
|
||||
// We need to extract the last line with type:"agent" and parse its text field
|
||||
const lines = output.trim().split('\n');
|
||||
let agentText = null;
|
||||
for (const line of lines) {
|
||||
try {
|
||||
const parsed = JSON.parse(line);
|
||||
if (parsed.type === 'agent' && parsed.text) {
|
||||
agentText = parsed.text;
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
if (agentText) {
|
||||
await core.summary
|
||||
.addHeading('Pull Request Template Check')
|
||||
.addCodeBlock(agentText, 'json')
|
||||
.write();
|
||||
} else {
|
||||
core.setFailed('No agent output found in response');
|
||||
}
|
||||
} catch (e) {
|
||||
core.setFailed(`Failed to write summary: ${e.message}`);
|
||||
}
|
||||
@@ -16,7 +16,6 @@
|
||||
<a href="https://npmjs.com/package/vite"><img src="https://img.shields.io/npm/v/vite.svg" alt="npm package"></a>
|
||||
<a href="https://nodejs.org/en/about/previous-releases"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatibility"></a>
|
||||
<a href="https://github.com/vitejs/vite/actions/workflows/ci.yml"><img src="https://github.com/vitejs/vite/actions/workflows/ci.yml/badge.svg?branch=main" alt="build status"></a>
|
||||
<a href="https://docs.warp.dev/support-and-community/community/open-source-partnership"><img src="https://img.shields.io/badge/Oz%20agents-triaging%20issues-white?logo=warp" alt="issue triage powered by Oz"></a>
|
||||
<a href="https://chat.vite.dev"><img src="https://img.shields.io/badge/chat-discord-blue?style=flat&logo=discord" alt="discord chat"></a>
|
||||
</p>
|
||||
<br/>
|
||||
|
||||
Reference in new issue
Block a user