You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/07/29 08:07:52 UTC

[GitHub] [pulsar] SignorMercurio opened a new pull request, #16865: [improve][workflow] Add a job in document bot to auto generate config docs

SignorMercurio opened a new pull request, #16865:
URL: https://github.com/apache/pulsar/pull/16865

   Fix #13453
   
   ### Motivation
   
   In #16627, we can now generate config docs by manually running a script after changing specific code files that contains annotations. This PR adds a job in the existing document bot to automate this step.
   
   ### Modifications
   
   A new job `doc-gen` is added in `ci-documentbot.yml` which will only trigger when there're new pushes to `master` updating the 4 code files that contains configuration annotations.
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   ### Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API: no
     - The schema: no
     - The default values of configurations: no
     - The wire protocol: no
     - The rest endpoints: no
     - The admin cli options: no
     - Anything that affects deployment: no
   
   ### Documentation
   
   Check the box below or label this PR directly.
   
   Need to update docs? 
   
   - [ ] `doc-required` 
   (Your PR needs to update docs and you will update later)
     
   - [x] `doc-not-needed` 
   (Please explain why)
   
   CI adjustment.
   
   - [ ] `doc` 
   (Your PR contains doc changes)
   
   - [ ] `doc-complete`
   (Docs have been already 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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] tisonkun commented on pull request #16865: [improve][workflow] Add a job in document bot to auto generate config docs

Posted by GitBox <gi...@apache.org>.
tisonkun commented on PR #16865:
URL: https://github.com/apache/pulsar/pull/16865#issuecomment-1208211588

   You may think of code style guards: if someone sends a patch violent checkstyle rules, we fail the CI and ask the contributor fix it. We don't let a bot to automatically push a commit there.
   
   While checkstyle doesn't provide autofix mechanism, switch to spotless can provide one. But every Apache project let the contributor to apply that automation instead of by a bot.
   
   You can replace code style with up-to-date config docs to understand the 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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] tisonkun commented on a diff in pull request #16865: [improve][workflow] Add a job in document bot to auto generate config docs

Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #16865:
URL: https://github.com/apache/pulsar/pull/16865#discussion_r940292338


##########
.github/workflows/doc-auto-gen.yml:
##########
@@ -0,0 +1,74 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: Documentation Generation
+
+on:
+  push:
+    branches:
+      - config-gen-workflow

Review Comment:
   We don't have such a branch and we don't create such a branch.



##########
.github/workflows/doc-auto-gen.yml:
##########
@@ -0,0 +1,74 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: Documentation Generation
+
+on:
+  push:
+    branches:
+      - config-gen-workflow
+    paths:
+      - pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
+      - pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
+      - pulsar-websocket/src/main/java/org/apache/pulsar/websocket/service/WebSocketProxyConfiguration.java
+      - pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConfiguration.java
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  docs-gen:
+    if: ${{ github.event_name == 'push' }}
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+      
+      - name: Tune Runner VM
+        uses: ./.github/actions/tune-runner-vm
+      
+      - name: Cache Maven dependencies
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/pulsar
+          key: ${{ runner.os }}-m2-dependencies-all-${{ hashFiles('**/pom.xml') }}
+          restore-keys: |
+            ${{ runner.os }}-m2-dependencies-all-
+      
+      - name: Set up JDK 17
+        uses: actions/setup-java@v2
+        with:
+          distribution: 'temurin'
+          java-version: 17
+      
+      - name: Build package
+        run: mvn -B clean install -DskipTests
+
+      - name: Generate config docs
+        run: site2/tools/generate-config-docs.sh
+      
+      - name: Commit changes
+        run: |
+          git config --global user.name 'pulsar-bot'
+          git config --global user.email 'pulsar-bot@users.noreply.github.com'
+          git commit -am "Auto update configuration docs"
+          git push

Review Comment:
   Without a GitHub token you cannot push such commit.



-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] SignorMercurio closed pull request #16865: [improve][workflow] Add a job in document bot to auto generate config docs

Posted by GitBox <gi...@apache.org>.
SignorMercurio closed pull request #16865: [improve][workflow] Add a job in document bot to auto generate config docs
URL: https://github.com/apache/pulsar/pull/16865


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] tisonkun commented on a diff in pull request #16865: [improve][workflow] Add a job in document bot to auto generate config docs

Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #16865:
URL: https://github.com/apache/pulsar/pull/16865#discussion_r940292338


##########
.github/workflows/doc-auto-gen.yml:
##########
@@ -0,0 +1,74 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: Documentation Generation
+
+on:
+  push:
+    branches:
+      - config-gen-workflow

Review Comment:
   We don't have such a branch.



-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] Anonymitaet commented on pull request #16865: [improve][workflow] Add a job in document bot to auto generate config docs

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

   @tisonkun thanks for your reminder! 
   
   We've discussed it and we're researching another way to implement it. 
   
   For example,  make [Pulsar configuration pages](https://pulsar.apache.org/docs/next/reference-configuration-broker) as independent pages (like https://pulsar.apache.org/tools/pulsar-admin/2.11.0-SNAPSHOT/) rather than `.md` files. In this way, we do not need to create such a workflow.


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] Anonymitaet commented on pull request #16865: [improve][workflow] Add a job in document bot to auto generate config docs

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

   @maxsxu @lhotari 
   could you please review this PR from the technical perspective? Thank you!


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] SignorMercurio commented on pull request #16865: [improve][workflow] Add a job in document bot to auto generate config docs

Posted by GitBox <gi...@apache.org>.
SignorMercurio commented on PR #16865:
URL: https://github.com/apache/pulsar/pull/16865#issuecomment-1208242975

   @tisonkun Understood. Actually a simple script to generate these docs are already added. Maybe we shouldn't add a workflow at all (since we need to check for the updates manually)?
   
   cc @Anonymitaet 


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] dave2wave commented on a diff in pull request #16865: [improve][workflow] Add a job in document bot to auto generate config docs

Posted by GitBox <gi...@apache.org>.
dave2wave commented on code in PR #16865:
URL: https://github.com/apache/pulsar/pull/16865#discussion_r940399155


##########
.github/workflows/doc-auto-gen.yml:
##########
@@ -0,0 +1,74 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: Documentation Generation
+
+on:
+  push:
+    branches:
+      - config-gen-workflow
+    paths:
+      - pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
+      - pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
+      - pulsar-websocket/src/main/java/org/apache/pulsar/websocket/service/WebSocketProxyConfiguration.java
+      - pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConfiguration.java
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  docs-gen:
+    if: ${{ github.event_name == 'push' }}
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+      
+      - name: Tune Runner VM
+        uses: ./.github/actions/tune-runner-vm
+      
+      - name: Cache Maven dependencies
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/pulsar
+          key: ${{ runner.os }}-m2-dependencies-all-${{ hashFiles('**/pom.xml') }}
+          restore-keys: |
+            ${{ runner.os }}-m2-dependencies-all-
+      
+      - name: Set up JDK 17
+        uses: actions/setup-java@v2
+        with:
+          distribution: 'temurin'
+          java-version: 17
+      
+      - name: Build package
+        run: mvn -B clean install -DskipTests
+
+      - name: Generate config docs
+        run: site2/tools/generate-config-docs.sh
+      
+      - name: Commit changes
+        run: |
+          git config --global user.name 'pulsar-bot'
+          git config --global user.email 'pulsar-bot@users.noreply.github.com'
+          git commit -am "Auto update configuration docs"
+          git push

Review Comment:
   @tisonkun is correct. If these changes are on the master or other protected branch then these are likely disallowed.



-- 
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: commits-unsubscribe@pulsar.apache.org

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