diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 75cd9ceab450d..7077c0bbf64da 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,94 +1,127 @@ name: šŸ› Bug Report description: File a bug report title: "[šŸ› Bug]: " -labels: [ I-defect, needs-triaging ] +labels: [ I-defect, A-needs-triaging ] body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this bug report! - type: textarea - id: what-happened + id: description attributes: - label: What happened? - description: | - Describe clearly and concisely the bug including instructions showing how to reproduce it. + label: Description placeholder: | - Please add as many details as possible to avoid assumptions from our side. How do you - trigger this bug? What did you expect to happen? Please walk us through it step by step. - Notes: - If the issue is with Google Chrome consider logging an issue with ChromeDriver instead: - https://bugs.chromium.org/p/chromedriver - If the issue is with Firefox GeckoDriver (aka Marionette) consider logging an issue with - Mozilla: https://bugzilla.mozilla.org/buglist.cgi?product=Testing&component=Marionette - If the issue is with Microsoft Edge consider logging an issue with Microsoft instead: - https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/ - If the issue is with Safari, only Safari 10+ is supported. Please log any Safari issue - with Apple: https://bugreport.apple.com/ + Include details like: + - What you were trying to do + - What you expected to happen + - What actually happened + - Any relevant context or configuration + - Stacktrace or error message if applicable validations: required: true - type: textarea - id: repro-command + id: reproduction attributes: - label: How can we reproduce the issue? - description: | - Share with a code snippet or a GitHub repo to reproduce the issue. + label: Reproducible Code placeholder: | - Please share the code script to reproduce the issue. If more than one file is needed, - create a GitHub repository and share the link. - This will be automatically formatted into code, so no need for backticks. - Be sure to include an SSCCE (Short, Self Contained, Correct - [compilable] example) http://sscce.org/ - Issues without a reproduction script are likely to stall and eventually be closed. + (This section renders as code, no need for backticks) + + * We can't fix an issue we can't reproduce. + * If more than one file is needed, create a new GitHub repository and link it here. + * Reproduction should be SSCCE: Short, Self Contained, Correct (Compilable), Example. render: shell validations: required: true - type: textarea id: logs attributes: - label: Relevant log output - description: | - Please copy and paste any relevant log output. - Ideally, turn on more detailed logging: https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/ - This will be automatically formatted, so no need for backticks. - render: shell - validations: - required: true + label: Debugging Logs + placeholder: | + Note: the stack trace should be in the explanation section above + Instructions for enabling logging can be found in the link below + render: logs + - type: markdown + id: link + attributes: + value: | + **Read our [logging documentation](https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/)** +   + + ## Help us Address Your Issue Faster! - type: input - id: operating-system + id: selenium-version attributes: - label: Operating System - description: What host operating system are you using to run Selenium? - placeholder: Windows 10? macOS BigSur? Ubuntu? + label: What version of Selenium are you currently using? + description: Important! The latest released version of Selenium is 4.30 and we can't fix old versions. + placeholder: e.g., 4.17.0 validations: required: true - - type: input - id: selenium-version + - type: checkboxes + id: prerequisites + attributes: + label: The following statements are true + options: + - label: This applies to the most recent version of Selenium (we can't fix old versions) + required: true + - label: This hasn't already been reported (I searched and didn't find it) + required: true + - label: All information necessary to reproduce the issue has been provided above + required: true + - type: dropdown + id: regression attributes: - label: Selenium version - description: What programming language release version of Selenium? - placeholder: Java 4.0.0? Ruby 4.0.3? (please use the full version number). + label: Did this work for you before? + options: + - Not sure, this is my first time trying it + - Yes this is a regression validations: required: true - type: input - id: browser-versions + id: last-good + attributes: + label: If yes, what version of Selenium did it work with? + placeholder: "e.g., 4.8.0" + validations: + required: false + - type: dropdown + id: operating-system attributes: - label: What are the browser(s) and version(s) where you see this issue? - description: What browser and versions are you using? - placeholder: Example - Chrome 90, Firefox 88, etc. + label: Operating System + options: + - "--" + - Windows + - macOS + - Linux (specify in the description) validations: required: true - - type: input - id: browser-driver-versions + - type: dropdown + id: bindings attributes: - label: What are the browser driver(s) and version(s) where you see this issue? - description: What browser driver(s) are you using? - placeholder: Example - ChromeDriver 94.0.4606.61, GeckoDriver 0.30.0, etc. + label: Selenium Language Binding + options: + - "--" + - Java + - Python + - C#/.NET + - JavaScript/Node.js + - Ruby validations: required: true - - type: input - id: selenium-grid-version + - type: dropdown + id: browsers + attributes: + label: Which browsers are you experiencing the issue with? + multiple: true + options: + - Chrome + - Firefox + - Edge + - Safari + - IE + - Other (please specify in the description) + - type: dropdown + id: grid attributes: label: Are you using Selenium Grid? - description: What version of Selenium Grid are you using? - placeholder: Example - 4.0.0 + options: + - "No" + - "Yes" + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/feature_proposal.yml b/.github/ISSUE_TEMPLATE/feature_proposal.yml index 04a8a21d7b541..e2005f52d2539 100644 --- a/.github/ISSUE_TEMPLATE/feature_proposal.yml +++ b/.github/ISSUE_TEMPLATE/feature_proposal.yml @@ -1,31 +1,53 @@ name: šŸš€ Feature Proposal -description: Propose a feature +description: Suggest a new feature or improvement to Selenium title: "[šŸš€ Feature]: " -labels: [ I-enhancement, needs-triaging ] +labels: [ I-enhancement, A-needs-triaging ] body: - - type: markdown - attributes: - value: | - Thanks for taking the time to propose a feature! - type: textarea - id: feature-description + id: description attributes: - label: Feature and motivation - description: | - Describe clearly and concisely the feature you are proposing, what is the motivation - behind it. + label: Description placeholder: | - Help us to understand your proposal by adding as many details as possible, we will look into - it and give you feedback as soon as possible. + What would you like Selenium to support or do differently? + Please include: + - The problem this would solve + - How you expect the feature would work + - Any relevant context or use cases + - Links to related issues, discussions, or external tools (if applicable) validations: required: true + - type: textarea - id: feature-example + id: alternatives attributes: - label: Usage example - description: | - How would you use this feature? + label: Have you considered any alternatives or workarounds? placeholder: | - A clear example showing how this feature is useful for you and the Selenium community. + If you've tried other ways to solve this problem, describe them here. + If not, you can leave this blank. validations: - required: true + required: false + + - type: dropdown + id: bindings + attributes: + label: Does this apply to specific language bindings? + multiple: true + options: + - Java + - Python + - C#/.NET + - JavaScript/Node.js + - Ruby + + - type: dropdown + id: components + attributes: + label: What part(s) of Selenium does this relate to? + multiple: true + options: + - Atoms + - Build (CI or Bazel) + - DevTools (CDP or BiDi) + - Documentation + - Grid + - Selenium Manager diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 9ec945b47328e..9fa86b9c5fe64 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,26 +1,24 @@ -**Thanks for contributing to Selenium!** -**A PR well described will help maintainers to quickly review and merge it** + + -Before submitting your PR, please check our [contributing](https://github.com/SeleniumHQ/selenium/blob/trunk/CONTRIBUTING.md) guidelines. -Avoid large PRs, help reviewers by making them as simple and short as possible. +### šŸ”— Related Issues + + - +### šŸ’„ What does this PR do? + -### Motivation and Context - +### šŸ”§ Implementation Notes + + -### Types of changes - -- [ ] Bug fix (non-breaking change which fixes an issue) -- [ ] New feature (non-breaking change which adds functionality) -- [ ] Breaking change (fix or feature that would cause existing functionality to change) +### šŸ’” Additional Considerations + + -### Checklist - - -- [ ] I have read the [contributing](https://github.com/SeleniumHQ/selenium/blob/trunk/CONTRIBUTING.md) document. -- [ ] My change requires a change to the documentation. -- [ ] I have updated the documentation accordingly. -- [ ] I have added tests to cover my changes. -- [ ] All new and existing tests passed. - +### šŸ”„ Types of changes + +- Cleanup (formatting, renaming) +- Bug fix (backwards compatible) +- New feature (non-breaking change which adds functionality *and tests!*) +- Breaking change (fix or feature that would cause existing functionality to change) diff --git a/.github/issue-labeler-config.yml b/.github/issue-labeler-config.yml new file mode 100644 index 0000000000000..4fc070272e611 --- /dev/null +++ b/.github/issue-labeler-config.yml @@ -0,0 +1,61 @@ +policy: + - section: + - id: [operating-system] + label: + - name: OS-windows + keys: [ Windows ] + - name: OS-mac + keys: [ macOS ] + - name: OS-linux + keys: [ Linux (specify in the description) ] + + - id: [bindings] + label: + - name: C-java + keys: [ Java ] + - name: C-py + keys: [ Python ] + - name: C-dotnet + keys: [ C#/.NET ] + - name: C-rb + keys: [ Ruby ] + - name: C-nodejs + keys: [ JavaScript/Node.js ] + + - id: [regression] + label: + - name: I-regression + keys: [ Yes this is a regression ] + + - id: [components] + label: + - name: B-grid + keys: [ Grid ] + - name: B-docs + keys: [ Documentation ] + - name: B-devtools + keys: [ DevTools (CDP or BiDi) ] + - name: B-manager + keys: [ Selenium Manager ] + - name: B-build + keys: [ Build (CI or Bazel) ] + - name: B-atoms + keys: [ Atoms ] + + - id: [browsers] + label: + - name: D-chrome + keys: [ Chrome ] + - name: D-firefox + keys: [ Firefox ] + - name: D-safari + keys: [ Safari ] + - name: D-edge + keys: [ Edge ] + - name: D-IE + keys: [ IE ] + + - id: [grid] + label: + - name: B-grid + keys: [ "Yes" ] diff --git a/.github/workflows/issue-labeler.yml b/.github/workflows/issue-labeler.yml new file mode 100644 index 0000000000000..4e2db61dc2756 --- /dev/null +++ b/.github/workflows/issue-labeler.yml @@ -0,0 +1,183 @@ +name: Issue Form Labeler +on: + issues: + types: [ opened ] + +jobs: + label-issues: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - uses: actions/checkout@v3 + + - name: Parse bug report form + id: bug-parser + uses: stefanbuck/github-issue-parser@v3 + with: + template-path: .github/ISSUE_TEMPLATE/bug-report.yml + continue-on-error: true + + - name: Parse feature proposal form + id: feature-parser + uses: stefanbuck/github-issue-parser@v3 + with: + template-path: .github/ISSUE_TEMPLATE/feature_proposal.yml + continue-on-error: true + + - name: Apply labels from bug report + uses: redhat-plumbers-in-action/advanced-issue-labeler@v3 + with: + issue-form: ${{ steps.bug-parser.outputs.jsonString }} + token: ${{ secrets.GITHUB_TOKEN }} + config-path: .github/issue-labeler-config.yml + continue-on-error: true + + - name: Apply labels from feature proposal + uses: redhat-plumbers-in-action/advanced-issue-labeler@v3 + with: + issue-form: ${{ steps.feature-parser.outputs.jsonString }} + token: ${{ secrets.GITHUB_TOKEN }} + config-path: .github/issue-labeler-config.yml + continue-on-error: true + + - name: Clean up labeled sections + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const issueNumber = context.issue.number; + const originalBody = context.payload.issue.body; + const owner = context.repo.owner; + const repo = context.repo.repo; + + const headingsToRemove = [ + '### What version of Selenium are you currently using?', + '### The following statements are true', + '### Did this work for you before?', + '### If yes, what version of Selenium did it work with?', + '### Operating System', + '### Selenium Language Binding', + '### Which browsers are you experiencing the issue with?', + '### Are you using Selenium Grid?', + '### Does this apply to specific language bindings?', + '### What part(s) of Selenium does this relate to?' + ]; + + const form = JSON.parse(process.env.FORM_JSON || '{}'); + const lastGood = form?.["last-good"]?.trim(); + + // Conditionally remove Debugging Logs + const logs = form?.logs?.trim(); + const isLogsEmpty = !logs || logs === '```logs\n\n```' || logs === '```logs```'; + + if (isLogsEmpty) { + headingsToRemove.push('### Debugging Logs'); + } + + const lines = originalBody.split(/\r?\n/); + const cleanedLines = []; + + let skip = false; + for (let i = 0; i < lines.length; i++) { + const line = lines[i]; + const trimmed = line.trim(); + + if (headingsToRemove.includes(trimmed)) { + skip = true; + continue; + } + + if (skip) { + if (trimmed.startsWith('###')) { + skip = false; + i--; // Reprocess this heading + } + continue; + } + + cleanedLines.push(line); + } + + let finalBody = cleanedLines.join('\n').trim(); + + if (lastGood) { + finalBody += `\n\n---\nā„¹ļø **Last known working version:** \`${lastGood}\``; + } + + await github.rest.issues.update({ + owner, + repo, + issue_number: issueNumber, + body: finalBody + }); + env: + FORM_JSON: ${{ steps.bug-parser.outputs.jsonString }} + + - name: Get latest Selenium version + id: get-version + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { data: latestRelease } = await github.rest.repos.getLatestRelease({ + owner: 'SeleniumHQ', + repo: 'selenium' + }); + + const latestTag = latestRelease.tag_name; + const versionMatch = latestTag.match(/[vV]?(?:selenium-)?(\d+\.\d+(?:\.\d+)?)/); + + if (!versionMatch) { + core.setFailed(`Couldn't parse version from tag: ${latestTag}`); + return; + } + + const fullVersion = versionMatch[1]; + const [major, minor] = fullVersion.split('.'); + const latestVersion = `${major}.${minor}`; + + console.log(`Latest version: ${latestVersion}`); + core.setOutput('version', latestVersion); + + - name: Compare user version + id: version-check + uses: actions/github-script@v6 + with: + script: | + const form = JSON.parse(process.env.FORM_JSON || '{}'); + const userVersion = form?.["selenium-version"]?.trim() || ""; + const latest = process.env.LATEST_VERSION; + + const [umaj, umin] = userVersion.split('.').map(n => parseInt(n, 10)); + const [lmaj, lmin] = latest.split('.').map(n => parseInt(n, 10)); + + const isOutdated = umaj < lmaj || (umaj === lmaj && umin < lmin); + + core.setOutput("user-version", userVersion); + core.setOutput("latest-version", latest); + core.setOutput("is-outdated", isOutdated); + env: + FORM_JSON: ${{ steps.bug-parser.outputs.jsonString }} + LATEST_VERSION: ${{ steps.get-version.outputs.version }} + + - name: Comment if version is outdated + id: comment-version + if: steps.version-check.outputs.is-outdated == 'true' + uses: peter-evans/create-or-update-comment@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + āš ļø You reported using Selenium version `${{ steps.version-check.outputs.user-version }}`, but the latest release is `${{ steps.version-check.outputs.latest-version }}`. + + Please verify that this issue still occurs with the latest version. If it no longer applies, you can close this issue or update your comment. + + *This issue will be marked "awaiting answer" and may be closed automatically if no response is received.* + + - name: Add label + if: steps.version-check.outputs.is-outdated == 'true' + uses: actions-ecosystem/action-add-labels@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + labels: J-awaiting answer diff --git a/Rakefile b/Rakefile index 102227eee78de..5317c2f856bd2 100644 --- a/Rakefile +++ b/Rakefile @@ -1205,7 +1205,17 @@ namespace :all do Rake::Task['dotnet:version'].invoke(version) Rake::Task['rust:version'].invoke(version) - Rake::Task['all:changelogs'] unless version == 'nightly' + unless version == 'nightly' + Rake::Task['all:changelogs'] + + major_minor = arguments[:version][/^\d+\.\d+/] + file = '.github/ISSUE_TEMPLATE/bug-report.yml' + old_version_pattern = /The latest released version of Selenium is (\d+\.\d+)/ + + text = File.read(file).gsub(old_version_pattern, "The latest released version of Selenium is #{major_minor}") + File.write(file, text) + @git.add(file) + end end desc 'Update all changelogs'