Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

84 changes: 84 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Bug report
Comment thread
vidorteg marked this conversation as resolved.
description: Report a problem with Microsoft Edge Tools for VS Code
title: "[Bug] "
labels:
- bug
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to report a problem.

Before submitting, search existing issues to avoid creating a duplicate and review the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).

- type: input
id: operating-system
attributes:
label: Operating system
description: Include the operating system name and version.
placeholder: Windows 11 24H2
validations:
required: true

- type: input
id: extension-version
attributes:
label: Extension version
description: Find this by selecting Microsoft Edge Tools in the VS Code Extensions view.
placeholder: 2.1.11
validations:
required: true

- type: input
id: vscode-version
attributes:
label: Visual Studio Code version
description: Find this under Help > About.
placeholder: 1.136.0
validations:
required: true

- type: textarea
id: bug-description
attributes:
label: Bug description
description: Clearly describe what went wrong.
placeholder: Describe the problem and when it occurs.
validations:
required: true

- type: textarea
id: steps-to-reproduce
attributes:
label: Steps to reproduce
description: Provide the smallest sequence of steps that reproduces the problem.
placeholder: |
1. Open ...
2. Select ...
3. Observe ...
validations:
required: true

- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: Describe what you expected to happen.
validations:
required: true

- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add logs, screenshots, or other relevant details. Remove sensitive information first.

- type: checkboxes
id: checks
attributes:
label: Submission checks
options:
- label: I searched existing issues and did not find a duplicate.
required: true
- label: I have provided enough information for someone else to reproduce or investigate the problem.
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
24 changes: 0 additions & 24 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Feature request
Comment thread
vidorteg marked this conversation as resolved.
description: Suggest an improvement to Microsoft Edge Tools for VS Code
title: "[Feature] "
labels:
- enhancement
body:
- type: markdown
attributes:
value: |
Thanks for suggesting an improvement.

Before submitting, search existing issues to avoid creating a duplicate and review the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).

- type: textarea
id: problem
attributes:
label: Problem
description: Describe the developer problem or limitation this request would address.
placeholder: I am unable to ... because ...
validations:
required: true

- type: textarea
id: proposed-solution
attributes:
label: Proposed solution
description: Describe the behavior or experience you would like.
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: Describe any workarounds or alternative solutions you have tried.

- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add screenshots, examples, or other relevant details.

- type: checkboxes
id: checks
attributes:
label: Submission checks
options:
- label: I searched existing issues and did not find a duplicate.
required: true
- label: This request is specifically about Microsoft Edge Tools for VS Code.
required: true
128 changes: 128 additions & 0 deletions .github/workflows/validate-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Validate issue submission

on:
issues:
types:
- opened

permissions:
contents: read
issues: write

jobs:
validate:
if: >-
contains(github.event.issue.labels.*.name, 'bug') ||
contains(github.event.issue.labels.*.name, 'enhancement')
runs-on: ubuntu-latest
steps:
- name: Close clearly incomplete submissions
uses: actions/github-script@v9
with:
script: |
const association = context.payload.issue.author_association;
if (['OWNER', 'MEMBER', 'COLLABORATOR'].includes(association)) {
return;
}

const issue = context.payload.issue;
const labelNames = issue.labels.map(label =>
typeof label === 'string' ? label : label.name
);
const isBug = labelNames.includes('bug');
const requiredSections = isBug
? [
'Operating system',
'Extension version',
'Visual Studio Code version',
'Bug description',
'Steps to reproduce',
'Expected behavior',
]
: ['Problem', 'Proposed solution'];

const sections = new Map();
let currentSection;
for (const line of (issue.body || '').split(/\r?\n/)) {
const heading = line.match(/^###\s+(.+?)\s*$/);
if (heading) {
currentSection = heading[1];
sections.set(currentSection, []);
} else if (currentSection) {
sections.get(currentSection).push(line);
}
}

const values = requiredSections.map(section => {
const lines = sections.get(section);
return lines ? lines.join('\n').trim() : undefined;
});
const junkValues = new Set([
'',
'-',
'.',
'n/a',
'na',
'none',
'no',
'test',
'testing',
'todo',
'_no response_',
]);
const isJunk = value => {
if (value === undefined) {
return true;
}

const normalized = value.toLowerCase().trim();
return junkValues.has(normalized) ||
normalized.length < 3 ||
/^([^\p{L}\p{N}])\1*$/u.test(normalized) ||
/^([\p{L}\p{N}])\1{2,}$/u.test(normalized);
};

const missingCount = values.filter(value => value === undefined).length;
const junkCount = values.filter(isJunk).length;

// Be deliberately conservative: close only malformed form submissions
// or submissions with multiple unmistakably meaningless answers.
const invalid = missingCount > 0 || junkCount >= 2;
if (!invalid) {
return;
}

const labels = [...new Set([...labelNames, 'invalid'])];
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
state: 'closed',
state_reason: 'not_planned',
labels,
});

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: [
'Closing this as it does not contain enough information to investigate.',
'',
'If this is a genuine request for Microsoft Edge Tools for VS Code, please open a new issue and complete all required fields with meaningful details.',
'',
...(isBug
? [
'- Your operating system, VS Code version, and extension version',
'- A clear description of the bug',
'- Steps to reproduce',
'- Expected behavior',
]
Comment thread
Copilot marked this conversation as resolved.
: [
'- The developer problem or limitation',
'- The behavior or solution you are proposing',
]),
'',
'Thanks!',
].join('\n'),
});
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -615,11 +615,11 @@
},
{
"view": "vscode-edge-devtools-view.help-links",
"contents": "[Report a Bug](https://github.com/microsoft/vscode-edge-devtools/issues/new?template=bug_report.md)"
"contents": "[Report a Bug](https://github.com/microsoft/vscode-edge-devtools/issues/new?template=bug_report.yml)"
},
{
"view": "vscode-edge-devtools-view.help-links",
"contents": "[Request a Feature](https://github.com/microsoft/vscode-edge-devtools/issues/new?template=feature_request.md)"
"contents": "[Request a Feature](https://github.com/microsoft/vscode-edge-devtools/issues/new?template=feature_request.yml)"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion src/devtoolsPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ export class DevToolsPanel {
<li>Check your network connection</li>
<li>Close and re-launch the DevTools</li>
</ol>
<p>If this problem continues, please <a target="_blank" href="https://github.com/microsoft/vscode-edge-devtools/issues/new?template=bug_report.md">file an issue.</a></p>
<p>If this problem continues, please <a target="_blank" href="https://github.com/microsoft/vscode-edge-devtools/issues/new?template=bug_report.yml">file an issue.</a></p>
</div>
</body>
</html>
Expand Down
Loading