Skip to content

Visual Studio Code, rebuilt in Rust

Rust

ci: add issue templates with release options kept current (#79)

Artur Rokfead29ff4964
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 00000000000..051bfa87d60
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,66 @@
+name: Bug Report
+description: Create a report to help us improve
+labels: ["bug", "needs-triage"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Please fill out the sections below to help everyone identify and fix the bug.
+ - type: textarea
+ id: description
+ attributes:
+ label: Describe your issue
+ placeholder: When I click here this happens
+ validations:
+ required: true
+ - type: textarea
+ id: steps
+ attributes:
+ label: Steps to reproduce
+ placeholder: |
+ 1. Open folder X
+ 2. Click here
+ 3. Click there
+ validations:
+ required: true
+ - type: textarea
+ id: expected
+ attributes:
+ label: What was the expected result?
+ placeholder: What VS Code 1.148.0 does here
+ - type: textarea
+ id: screenshots
+ attributes:
+ label: Put here any screenshots or videos (optional)
+ - type: dropdown
+ id: app_version
+ attributes:
+ label: Application version
+ description: Pick the release shown in Help > About.
+ options:
+ # release-options:start
+ - "1.148.0.1-insider - latest"
+ - "1.148.0-insider"
+ - "1.147.0-insider"
+ # release-options:end
+ - Other / not listed
+ validations:
+ required: true
+ - type: input
+ id: other_app_version
+ attributes:
+ label: Other application version (optional)
+ description: Complete this only when you selected "Other / not listed".
+ placeholder: 1.148.0-insider
+ - type: input
+ id: os_version
+ attributes:
+ label: Operating system (name + version)
+ description: Include platform and version.
+ placeholder: macOS 26.5.1, Windows 11 24H2, Ubuntu 24.04
+ validations:
+ required: true
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for reporting this issue! We will get back to you as soon as possible.
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 00000000000..3ba13e0cec6
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1 @@
+blank_issues_enabled: false
diff --git a/.github/ISSUE_TEMPLATE/new_feature.yml b/.github/ISSUE_TEMPLATE/new_feature.yml
new file mode 100644
index 00000000000..ab8aa022c45
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/new_feature.yml
@@ -0,0 +1,36 @@
+name: New Feature
+description: Suggest a new feature or enhancement
+labels: ["feat", "needs-triage"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thank you for suggesting a new feature. Please provide enough detail so we can evaluate and prioritize it.
+ - type: input
+ id: summary
+ attributes:
+ label: Short summary
+ placeholder: One-line summary of the feature
+ validations:
+ required: true
+ - type: textarea
+ id: motivation
+ attributes:
+ label: Why is this needed?
+ placeholder: Describe the problem, who it affects, and the user benefit
+ validations:
+ required: true
+ - type: textarea
+ id: proposed_solution
+ attributes:
+ label: Proposed solution / behaviour
+ placeholder: Describe how it should work (interaction, defaults, edge cases)
+ - type: input
+ id: related_issues
+ attributes:
+ label: Related issues or PRs (optional)
+ placeholder: "#123, #456"
+ - type: textarea
+ id: mockups
+ attributes:
+ label: Mockups / screenshots / notes (optional)
diff --git a/.github/workflows/update-issue-release-options.yml b/.github/workflows/update-issue-release-options.yml
new file mode 100644
index 00000000000..33034c03855
--- /dev/null
+++ b/.github/workflows/update-issue-release-options.yml
@@ -0,0 +1,70 @@
+name: update-issue-release-options
+
+on:
+ release:
+ types: [published]
+
+permissions:
+ contents: write
+
+jobs:
+ update-template:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
+ with:
+ persist-credentials: false
+ ref: ${{ github.event.repository.default_branch }}
+
+ - name: Update release options
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: |
+ gh api --paginate --slurp \
+ "/repos/${GITHUB_REPOSITORY}/releases?per_page=100" \
+ > "${RUNNER_TEMP}/releases.json"
+ python3 - "${RUNNER_TEMP}/releases.json" .github/ISSUE_TEMPLATE/bug_report.yml <<'PY'
+ import json
+ import sys
+ from pathlib import Path
+
+ releases_path, template_path = map(Path, sys.argv[1:])
+ pages = json.loads(releases_path.read_text())
+ # The "pre-release" tag is the update feed (port/notes.md "Update feed"), not a version.
+ releases = [
+ release for page in pages for release in page
+ if not release["draft"] and release["tag_name"].startswith("v")
+ ]
+ releases.sort(key=lambda release: release["published_at"] or "", reverse=True)
+
+ options = []
+ for index, release in enumerate(releases[:3]):
+ label = release["tag_name"].removeprefix("v")
+ if index == 0:
+ label += " - latest"
+ options.append(f" - {json.dumps(label)}")
+
+ template = template_path.read_text()
+ start = " # release-options:start"
+ end = " # release-options:end"
+ before, separator, rest = template.partition(start)
+ if not separator:
+ raise SystemExit("Missing release-options:start marker")
+ _, separator, after = rest.partition(end)
+ if not separator:
+ raise SystemExit("Missing release-options:end marker")
+ template_path.write_text(f"{before}{start}\n{'\n'.join(options)}\n{end}{after}")
+ PY
+
+ - name: Commit template update
+ env:
+ GH_TOKEN: ${{ github.token }}
+ DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
+ run: |
+ if git diff --quiet -- .github/ISSUE_TEMPLATE/bug_report.yml; then exit 0; fi
+ git config user.name "github-actions[bot]"
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
+ git add .github/ISSUE_TEMPLATE/bug_report.yml
+ git commit -m "chore: update issue release options"
+ git push "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" \
+ "HEAD:${DEFAULT_BRANCH}"