From f3d1c2cda74f3f76b6052c6bb357933fc03fc7f2 Mon Sep 17 00:00:00 2001 From: Argo Date: Fri, 27 Jan 2023 00:36:26 -0800 Subject: [PATCH] chore: update comment label action and repro document (#399) * chore: fix can not assign assignee on issue * chore: update checkout action version * chore: update action branch * chore: update action and jobs name * chore: update action add null check * doc: add repro document * chore: update comment issue action --- .github/workflows/auto_assign_issue.yml | 11 +++-- .github/workflows/auto_comment_issue.yml | 12 ++---- .../workflows/auto_pull_request_checks.yml | 7 ++-- .github/workflows/build.yml | 5 +-- .github/workflows/docker.yml | 2 +- .github/workflows/pack.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/sync_from_issue.yml | 42 ++++++++++--------- docs/repro.md | 26 ++++++++++++ 10 files changed, 66 insertions(+), 45 deletions(-) create mode 100644 docs/repro.md diff --git a/.github/workflows/auto_assign_issue.yml b/.github/workflows/auto_assign_issue.yml index 5a172fa91..0ba0e7491 100644 --- a/.github/workflows/auto_assign_issue.yml +++ b/.github/workflows/auto_assign_issue.yml @@ -1,4 +1,4 @@ -name: Auto Assign Issue(bot) +name: auto assign issue(bot) on: issues: @@ -6,22 +6,21 @@ on: jobs: assign_assignee: - name: Assign Assignees + name: assign assignees runs-on: ubuntu-latest steps: - uses: actions/github-script@v6 with: script: | - console.log(context) github.rest.issues.update({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number, - assignees: [context.repo.owner] + assignees: [context.actor] }) assign_label: - name: Assign Label + name: assign label runs-on: ubuntu-latest steps: - uses: github/issue-labeler@v2.5 @@ -33,7 +32,7 @@ jobs: include-title: 1 assign_miletone: - name: Assign Milestone + name: assign milestone runs-on: ubuntu-latest steps: - uses: actions/github-script@v6 diff --git a/.github/workflows/auto_comment_issue.yml b/.github/workflows/auto_comment_issue.yml index 48449867b..6f4f8cb54 100644 --- a/.github/workflows/auto_comment_issue.yml +++ b/.github/workflows/auto_comment_issue.yml @@ -1,4 +1,4 @@ -name: Auto Comment on Issue(bot) +name: auto comment on issue(bot) on: issues: @@ -6,20 +6,16 @@ on: jobs: comment: - name: Comment Issue + name: comment issue runs-on: ubuntu-latest steps: - uses: actions/github-script@v6 with: script: | - const issue = await github.rest.issues.get({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo - }) + const content = `@${context.payload.issue.user.login}. Thank you for filing this issue. In order for us to investigate this issue, please provide [a minimalistic repro project](https://github.com/dotnetcore/bootstrapblazor/blob/main/docs/repro.md) that illustrates the problem.` github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: '👋 Thanks for reporting! @' + issue.data.user.login + ' Please provide your code. If it is already provided, please ignore this message.' + body: content }) diff --git a/.github/workflows/auto_pull_request_checks.yml b/.github/workflows/auto_pull_request_checks.yml index a0e274029..9375894c1 100644 --- a/.github/workflows/auto_pull_request_checks.yml +++ b/.github/workflows/auto_pull_request_checks.yml @@ -1,19 +1,18 @@ -name: Auto PR Test(bot) +name: auto PR test(bot) on: pull_request: branches: - master - main - - dev jobs: run_test: - name: Run UnitTest + name: run test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup .NET 7.0 uses: actions/setup-dotnet@v1 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7ef2bc4c2..39fb5bb49 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,16 +3,15 @@ name: Build Project on: push: branches: + - master - main - - dev - - dev-table jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup .NET Core 7 uses: actions/setup-dotnet@v1 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 93f895a07..491fde74a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Login to Docker Hub uses: docker/login-action@v1 with: diff --git a/.github/workflows/pack.yml b/.github/workflows/pack.yml index 29901e162..7580fecc6 100644 --- a/.github/workflows/pack.yml +++ b/.github/workflows/pack.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup .NET Core 7 uses: actions/setup-dotnet@v1 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 62fd713eb..1cbbab333 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup .NET Core 7 uses: actions/setup-dotnet@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae2708295..6399cbf92 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup .NET Core 7 uses: actions/setup-dotnet@v1 diff --git a/.github/workflows/sync_from_issue.yml b/.github/workflows/sync_from_issue.yml index 3c1e74ea0..2b7409d11 100644 --- a/.github/workflows/sync_from_issue.yml +++ b/.github/workflows/sync_from_issue.yml @@ -1,4 +1,4 @@ -name: Sync Issue to PR(bot) +name: sync issue to PR(bot) on: pull_request: @@ -6,7 +6,7 @@ on: jobs: sync_assignees: - name: Sync Assignees + name: sync assignees runs-on: ubuntu-latest steps: - uses: actions/github-script@v6 @@ -15,7 +15,7 @@ jobs: const body = context.payload.pull_request.body const matches = body.match(/#(\d+)/) if (!matches || matches.length <= 1) { - console.log('This PR has no related issue!') + console.log('this PR has no related issue!') } else { const related_issue_number = matches[1] @@ -24,8 +24,8 @@ jobs: repo: context.repo.repo, issue_number: related_issue_number }) - if(issue.data.length == 0) { - console.log(`There no labels on issue \#${related_issue_number}`) + if (issue.data.length == 0 || issue.data.assignees.length == 0) { + console.log(`there no assignees on issue \#${related_issue_number}`) } else { const assignees = issue.data.assignees.map(v => v.login) @@ -35,11 +35,12 @@ jobs: issue_number: context.issue.number, assignees: assignees }) - console.log('Sync assignees', assignees) + console.log('sync assignees', assignees) } } + sync_labels: - name: Sync Labels + name: sync labels runs-on: ubuntu-latest steps: - uses: actions/github-script@v6 @@ -48,7 +49,7 @@ jobs: const body = context.payload.pull_request.body const matches = body.match(/#(\d+)/) if (!matches || matches.length <= 1) { - console.log('This PR has no related issue!') + console.log('this PR has no related issue!') } else { const related_issue_number = matches[1] @@ -58,7 +59,7 @@ jobs: issue_number: related_issue_number }) if(labels.data.length == 0) { - console.log(`There no labels on issue #${related_issue_number}`) + console.log(`there no labels on issue #${related_issue_number}`) } else { const issue_labels = labels.data.map(v => v.name) @@ -68,11 +69,12 @@ jobs: issue_number: context.issue.number, labels: issue_labels }) - console.log('Sync labels', issue_labels) + console.log('sync labels', issue_labels) } } + sync_milestone: - name: Sync Milestone + name: sync milestone runs-on: ubuntu-latest steps: - uses: actions/github-script@v6 @@ -81,7 +83,7 @@ jobs: const body = context.payload.pull_request.body const matches = body.match(/#(\d+)/) if (!matches || matches.length <= 1) { - console.log('This PR has no related issue!') + console.log('this PR has no related issue!') } else { const related_issue_number = matches[1] @@ -90,17 +92,17 @@ jobs: repo: context.repo.repo, issue_number: related_issue_number }) - if(issue.data.length == 0) { - console.log(`There no labels on issue \#${related_issue_number}`) + if (issue.data.length == 0 || issue.data.milestone == null) { + console.log(`there no milestone on issue \#${related_issue_number}`) } else { const milestone = issue.data.milestone await github.rest.issues.update({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - milestone: milestone.number + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + milestone: milestone.number }) - console.log(`Sync milestone ${milestone.title}`) + console.log(`sync milestone ${milestone.title}`) } - } \ No newline at end of file + } diff --git a/docs/repro.md b/docs/repro.md new file mode 100644 index 000000000..8bc4f7da2 --- /dev/null +++ b/docs/repro.md @@ -0,0 +1,26 @@ +# Bug Report Reproduction Guide + +When customers plan to report an issue with BootstrapBlazor, we will most likely ask them to provide a so called `minimal reproduction project (repro)`. +This serves two purposes: +- It helps issue reporters validate their assumptions by trying to recreate the behavior in a new project. +- It helps eliminate ambiguity and speeds up investigations. We may also be able to provide workarounds in certain scenarios. + +This document describes what a minimal repro project is, and why it's important to us. + +## What is a minimal repro project? +A repro (or a reproduction) is a project, which can be used to reproduce the reported behavior with minimal effort from a product team, which has the minimum code required to demonstrate the concerning behavior. + +There are two ways you can provide a minimal repro project. The first and simpler option is to use some type of public web-hosted REPL-based environment which supports ASP.NET Core. The other option is to provide a project hosted in GitHub as described below: +- Create a new project, based on one of the Blazor Server/WebAssembly project templates. + - **Please use the `Empty*` project templates** if they're available for that project type. +- Add the minimum amount of code necessary to reproduce the behavior you are reporting on this newly created project. +- Make sure you **do not** add any dependencies that are irrelevant to the behavior. +- Host the project as a **public** repository on GitHub. +- Make sure you haven't included any binaries in your project (this is usually about the `bin` and `obj` folders in your project) + Note: that this step is important and we won't be able to open zip attachments in your issues. + Zip files are potential attack vectors that we try to avoid at all cost. + +## Important considerations +- **Never** include any sensitive information in your reproduction project. +- **Never** include any code that is not intended to be public in a repro. +- **Do not** reference any external services or data sources. \ No newline at end of file