You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/06/09 13:34:20 UTC

[GitHub] [pulsar-test-infra] maxsxu opened a new pull request, #43: Implement a new documentation bot

maxsxu opened a new pull request, #43:
URL: https://github.com/apache/pulsar-test-infra/pull/43

   Master issue: https://github.com/apache/pulsar/issues/15797
   
   ## Motivation
   
   As discussed at https://lists.apache.org/thread/tz7x73lnkvcg3vqmb9r26s4p6md5sb8y
   
   ## Modification
   
   Created a new folder named `docbot`, which contains the implementation.
   
   **Supported Features**
   
   - Automatic labeling according to PR body when created or updated
   - Able to update PR body automatically when labels is manually selected
   - Configurable parameters including which labels want to watch, whether allow empty labels, etc
   
   
   **Directory Structure**
   This `docbot` is implemented by [Golang](https://go.dev/) with following directory structure:
   ```
   ├── pkg/logger/logger.go     // Contains a simple logger for logging in the actor details
   ├── README.md
   ├── action.yml              // The action configuration file
   ├── go.mod
   └── main.go                // The main logic is here
   ```
   
   > Note: The old folder `doc-label-check` will be removed after this PR merged.
   
   ## Validation
   @Anonymitaet has helped validate the required features on the [prototype repository](https://github.com/maxsxu/action-labeler).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-test-infra] maxsxu commented on a diff in pull request #43: Implement a new documentation bot

Posted by GitBox <gi...@apache.org>.
maxsxu commented on code in PR #43:
URL: https://github.com/apache/pulsar-test-infra/pull/43#discussion_r894191818


##########
docbot/action.yml:
##########
@@ -0,0 +1,12 @@
+name: 'Documentation Bot'
+description: 'Automatically label pull requests based on the checked task list'
+author: 'Max Xu'

Review Comment:
   Make sense, the author's email is added.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-test-infra] michaeljmarshall commented on a diff in pull request #43: Implement a new documentation bot

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on code in PR #43:
URL: https://github.com/apache/pulsar-test-infra/pull/43#discussion_r896211686


##########
docbot/README.md:
##########
@@ -0,0 +1,54 @@
+# Documentation Bot 
+
+Automatically label pull requests based on the checked task list.
+
+## Usage
+
+Create a workflow `.github/workflows/ci-docbot.yml` with below content:
+
+```yaml
+name: Documentation Bot
+
+on:
+  pull_request_target:
+    types:
+      - opened
+      - edited
+      - labeled
+      - unlabeled
+
+jobs:
+  label:
+    permissions:
+      pull-requests: write
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout action
+        uses: actions/checkout@v3
+        with:
+          repository: maxsxu/action-labeler

Review Comment:
   Did you meant to leave this reference to your personal github repo?



##########
docbot/README.md:
##########
@@ -0,0 +1,54 @@
+# Documentation Bot 
+
+Automatically label pull requests based on the checked task list.
+
+## Usage
+
+Create a workflow `.github/workflows/ci-docbot.yml` with below content:
+
+```yaml
+name: Documentation Bot
+
+on:
+  pull_request_target:
+    types:
+      - opened
+      - edited
+      - labeled
+      - unlabeled
+
+jobs:
+  label:
+    permissions:
+      pull-requests: write
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout action
+        uses: actions/checkout@v3
+        with:
+          repository: maxsxu/action-labeler
+          ref: master
+
+      - name: Set up Go
+        uses: actions/setup-go@v3
+        with:
+          go-version: 1.18
+
+      - name: Labeling
+        uses: maxsxu/action-labeler@master

Review Comment:
   Same comment.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-test-infra] Anonymitaet commented on a diff in pull request #43: Implement a new documentation bot

Posted by GitBox <gi...@apache.org>.
Anonymitaet commented on code in PR #43:
URL: https://github.com/apache/pulsar-test-infra/pull/43#discussion_r896457872


##########
docbot/README.md:
##########
@@ -0,0 +1,54 @@
+# Documentation Bot 
+
+Automatically label pull requests based on the checked task list.
+
+## Usage
+
+Create a workflow `.github/workflows/ci-docbot.yml` with below content:
+
+```yaml
+name: Documentation Bot
+
+on:
+  pull_request_target:
+    types:
+      - opened
+      - edited
+      - labeled
+      - unlabeled
+
+jobs:
+  label:
+    permissions:
+      pull-requests: write
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout action
+        uses: actions/checkout@v3
+        with:
+          repository: maxsxu/action-labeler

Review Comment:
   I guess so. Any concern on this?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-test-infra] Anonymitaet commented on pull request #43: Implement a new documentation bot

Posted by GitBox <gi...@apache.org>.
Anonymitaet commented on PR #43:
URL: https://github.com/apache/pulsar-test-infra/pull/43#issuecomment-1154806188

   > > @maxsxu thanks for your great contribution! We've tested and it works well. Approve from the non-technical side.
   > 
   > @Anonymitaet how was this tested? all jobs fail in apache/pulsar currently after merging [apache/pulsar#16027](https://github.com/apache/pulsar/pull/16027)
   
   @lhotari we've tested in the prototype repo https://github.com/maxsxu/action-labeler manually, like opening a PR and giving it different labels to watch how the bot run under different situations.
   
   @maxsxu has fixed the issues yesterday (you've merged the PR)
   
   Are there any other (automatic) tests we should do?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-test-infra] Anonymitaet commented on pull request #43: Implement a new documentation bot

Posted by GitBox <gi...@apache.org>.
Anonymitaet commented on PR #43:
URL: https://github.com/apache/pulsar-test-infra/pull/43#issuecomment-1155856450

   > I think we should remove this functionality. If the label is manually added, there is no need for the PR body to have the check box. The end goal is to have the right label on the PR, and if the label is already added, the bot doesn't need to do anything.
   
   @michaeljmarshall this functionality is useful and needed.
   
   1. Check box
     Contributors without committer privilege can label a PR only through a check box in a PR description. The check box is for their sake. 
   
   2. Bot
     Some contributors do not provide doc-related labels even if they get notifications from doc Bot and comments from writers.
   Failed doc label check is another way to remind them please show care to docs. A project is nothing if there are no docs.
   
   > Further, on this PR https://github.com/apache/pulsar/pull/16045, it appears that the bot updated my PR's body 3 times to add the same string (look in the PR body history).
   
   @maxsxu has fixed this bug in https://github.com/apache/pulsar/pull/16060


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-test-infra] Anonymitaet commented on a diff in pull request #43: Implement a new documentation bot

Posted by GitBox <gi...@apache.org>.
Anonymitaet commented on code in PR #43:
URL: https://github.com/apache/pulsar-test-infra/pull/43#discussion_r894080305


##########
docbot/action.yml:
##########
@@ -0,0 +1,12 @@
+name: 'Documentation Bot'
+description: 'Automatically label pull requests based on the checked task list'
+author: 'Max Xu'

Review Comment:
   how about adding your GitHub ID so that others can find you easily if they have any questions?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-test-infra] Anonymitaet commented on a diff in pull request #43: Implement a new documentation bot

Posted by GitBox <gi...@apache.org>.
Anonymitaet commented on code in PR #43:
URL: https://github.com/apache/pulsar-test-infra/pull/43#discussion_r897534187


##########
docbot/README.md:
##########
@@ -0,0 +1,54 @@
+# Documentation Bot 
+
+Automatically label pull requests based on the checked task list.
+
+## Usage
+
+Create a workflow `.github/workflows/ci-docbot.yml` with below content:
+
+```yaml
+name: Documentation Bot
+
+on:
+  pull_request_target:
+    types:
+      - opened
+      - edited
+      - labeled
+      - unlabeled
+
+jobs:
+  label:
+    permissions:
+      pull-requests: write
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout action
+        uses: actions/checkout@v3
+        with:
+          repository: maxsxu/action-labeler

Review Comment:
   Make sense! @maxsxu will update the readme.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-test-infra] michaeljmarshall commented on pull request #43: Implement a new documentation bot

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on PR #43:
URL: https://github.com/apache/pulsar-test-infra/pull/43#issuecomment-1155474369

   > Able to update PR body automatically when labels is manually selected
   
   I think we should remove this functionality. If the label is manually added, there is no need for the PR body to have the check box. The end goal is to have the right label on the PR, and if the label is already added, the bot doesn't need to do anything.
   
   Further, on this PR https://github.com/apache/pulsar/pull/16045, it appears that the bot updated my PR's body 3 times to add the same string (look in the PR body history).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-test-infra] Anonymitaet merged pull request #43: Implement a new documentation bot

Posted by GitBox <gi...@apache.org>.
Anonymitaet merged PR #43:
URL: https://github.com/apache/pulsar-test-infra/pull/43


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-test-infra] lhotari commented on pull request #43: Implement a new documentation bot

Posted by GitBox <gi...@apache.org>.
lhotari commented on PR #43:
URL: https://github.com/apache/pulsar-test-infra/pull/43#issuecomment-1153936978

   > @maxsxu thanks for your great contribution! We've tested and it works well. Approve from the non-technical side.
   
   @Anonymitaet how was this tested? all jobs fail in apache/pulsar currently after merging https://github.com/apache/pulsar/pull/16027


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-test-infra] michaeljmarshall commented on a diff in pull request #43: Implement a new documentation bot

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on code in PR #43:
URL: https://github.com/apache/pulsar-test-infra/pull/43#discussion_r897085790


##########
docbot/README.md:
##########
@@ -0,0 +1,54 @@
+# Documentation Bot 
+
+Automatically label pull requests based on the checked task list.
+
+## Usage
+
+Create a workflow `.github/workflows/ci-docbot.yml` with below content:
+
+```yaml
+name: Documentation Bot
+
+on:
+  pull_request_target:
+    types:
+      - opened
+      - edited
+      - labeled
+      - unlabeled
+
+jobs:
+  label:
+    permissions:
+      pull-requests: write
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout action
+        uses: actions/checkout@v3
+        with:
+          repository: maxsxu/action-labeler

Review Comment:
   My only concern is that the README is incorrect. We should fix it so that it documents how to use the action in this repository.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-test-infra] maxsxu commented on a diff in pull request #43: Implement a new documentation bot

Posted by GitBox <gi...@apache.org>.
maxsxu commented on code in PR #43:
URL: https://github.com/apache/pulsar-test-infra/pull/43#discussion_r899933601


##########
docbot/README.md:
##########
@@ -0,0 +1,54 @@
+# Documentation Bot 
+
+Automatically label pull requests based on the checked task list.
+
+## Usage
+
+Create a workflow `.github/workflows/ci-docbot.yml` with below content:
+
+```yaml
+name: Documentation Bot
+
+on:
+  pull_request_target:
+    types:
+      - opened
+      - edited
+      - labeled
+      - unlabeled
+
+jobs:
+  label:
+    permissions:
+      pull-requests: write
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout action
+        uses: actions/checkout@v3
+        with:
+          repository: maxsxu/action-labeler

Review Comment:
   Fixed in https://github.com/apache/pulsar-test-infra/pull/48



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org