You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "aFlyBird0 (via GitHub)" <gi...@apache.org> on 2023/03/07 15:42:15 UTC

[GitHub] [incubator-devlake] aFlyBird0 opened a new pull request, #4607: feat: sync image tags to helm chart

aFlyBird0 opened a new pull request, #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607

   ### ⚠️ Pre Checklist
   
   > Please complete _ALL_ items in this checklist, and remove before submitting
   
   - [x] I have read through the [Contributing Documentation](https://devlake.apache.org/community/).
   - [x] I have added relevant tests.
   - [x] I have added relevant documentation.
   - [x] I will add labels to the PR, such as `pr-type/bug-fix`, `pr-type/feature-development`, etc.
   
   <!--
   Thanks for submitting a pull request!
   
   We appreciate you spending the time to work on these changes.
   Please fill out as many sections below as possible.
   -->
   
   ### Summary
   
   Sync devlake helm chart(by creating pull request) when a new tag is pushed.
   
   ### Does this close any open issues?
   
   None.
   
   This PR is generated by the actions of my [fork repo](https://github.com/aFlyBird0/incubator-devlake/actions/runs/4355738566): https://github.com/apache/incubator-devlake-helm-chart/pull/83
   
   ### Screenshots
   
   <img width="999" alt="image" src="https://user-images.githubusercontent.com/36830265/223470583-e742b1c8-678d-4f59-88b9-2494993a8cda.png">
   
   <img width="1188" alt="image" src="https://user-images.githubusercontent.com/36830265/223470716-06799e33-786c-485a-9a42-41a0497dc29a.png">
   
   
   ### Other Information
   
   **Note: The maintainer of devlake must do things below to set up the actions**
   
   1. Prepare a GitHub Account(such as a bot account) and fork `incubator-devlake-helm-chart` repo
   2. Apply a GitHub Personal Access Token with `repo` scope, and set it to `GH_PAT` in secrets of `incubator-devlake`
   3. Update configurations in `.github/workflows/sync-helm.yml` if you want.
   


-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] aFlyBird0 closed pull request #4607: ci: sync image tags to helm chart

Posted by "aFlyBird0 (via GitHub)" <gi...@apache.org>.
aFlyBird0 closed pull request #4607: ci: sync image tags to helm chart
URL: https://github.com/apache/incubator-devlake/pull/4607


-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] aFlyBird0 commented on pull request #4607: ci: sync image tags to helm chart

Posted by "aFlyBird0 (via GitHub)" <gi...@apache.org>.
aFlyBird0 commented on PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#issuecomment-1467260965

   > > Some new ideas about this solution, this action finally want's to create PR in repo ``
   > > > @matrixji @aFlyBird0 I found some related information from https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
   > > > According to the document, the `GITHUB_TOKEN` is generated by the Github App and restricted to the **installed** repo only, in other words, it can't be used to fork and create pr for another repo.
   > > 
   > > 
   > > Maybe the simple way is just to create an action in `incubator-devlake-helm-chart` itself for creating PR promoting the image versions. And this action is triggered by an Issue raised in `incubator-devlake-helm-chart` (we could add an issue template for changing image tags)
   > > A PoC for this idea: The Issue create from the template form: [matrixji/repo-merge-example-bar#1](https://github.com/matrixji/repo-merge-example-bar/issues/1) The related PR is triggered by the above issue: [matrixji/repo-merge-example-bar#2](https://github.com/matrixji/repo-merge-example-bar/pull/2)
   > 
   > The issue have to be created manually, is that correct?
   
   Yes, see https://github.com/matrixji/repo-merge-example-bar/issues/new/choose @klesh 


-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] matrixji commented on a diff in pull request #4607: feat: sync image tags to helm chart

Posted by "matrixji (via GitHub)" <gi...@apache.org>.
matrixji commented on code in PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#discussion_r1128393516


##########
.github/workflows/sync-helm.yml:
##########
@@ -0,0 +1,66 @@
+#
+# 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: sync-helm
+on:
+  push:
+    tags-ignore:
+      - '*test*'
+
+env:
+  HELM_CHART_REPO: incubator-devlake-helm-chart
+  TAG: ${{ github.ref_name }}
+  FORK_REPO: aFlyBird0/incubator-devlake-helm-chart

Review Comment:
   This for test purpose, finally I think we could using `incubator-devlake-helm-chart` as FORK_REPO also.



-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] klesh commented on a diff in pull request #4607: ci: sync image tags to helm chart

Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh commented on code in PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#discussion_r1133542163


##########
.github/workflows/sync-helm.yml:
##########
@@ -0,0 +1,66 @@
+#
+# 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: sync-helm
+on:
+  push:
+    tags-ignore:
+      - '*test*'
+
+env:
+  HELM_CHART_REPO: incubator-devlake-helm-chart
+  TAG: ${{ github.ref_name }}
+  FORK_REPO: aFlyBird0/incubator-devlake-helm-chart
+
+jobs:
+  sync-helm-images:
+    if: (github.repository == 'apache/incubator-devlake')
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Helm Chart
+        uses: actions/checkout@v3
+        with:
+          path: ${{ env.HELM_CHART_REPO }}
+          repository: apache/${{ env.HELM_CHART_REPO }}
+      - name: Update Helm Chart Image Tag
+        run: |
+          versionWithoutV=$(echo ${{ env.TAG }} | sed 's/^v//')
+          sed -i "s/imageTag: .*/imageTag: ${{ env.TAG }}/g" ${{ env.HELM_CHART_REPO }}/charts/devlake/values.yaml
+          sed -i "s/version: .*/version: ${versionWithoutV}/g" ${{ env.HELM_CHART_REPO }}/charts/devlake/Chart.yaml
+          sed -i "s/appVersion: .*/appVersion: ${{ env.TAG }}/g" ${{ env.HELM_CHART_REPO }}/charts/devlake/Chart.yaml
+      - name: Create Pull Request
+        # reference: https://github.com/peter-evans/create-pull-request
+        uses: peter-evans/create-pull-request@v4

Review Comment:
   The actions we can use are limited, 3rd party actions would not work according to https://infra.apache.org/github-actions-secrets.html
    🥲



-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] matrixji commented on pull request #4607: ci: sync image tags to helm chart

Posted by "matrixji (via GitHub)" <gi...@apache.org>.
matrixji commented on PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#issuecomment-1467303080

   > @matrixji I think your solution is well established (even have set the form in the issue template) how about I just close this PR after others agree and you submit a new PR to the helm repository?
   > 
   > I've had a great time discussing with you the last few days and have learned a lot, thanks!
   
   I agree with closing this PR,  I'll try to raise a new PR to the helm repo. 
   Great thanks for your contribution, I've learned a lot from this topic also, like when worth 100% automation and how to deal with dependencies /independence between repos.
   
   


-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] matrixji commented on pull request #4607: ci: sync image tags to helm chart

Posted by "matrixji (via GitHub)" <gi...@apache.org>.
matrixji commented on PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#issuecomment-1459619424

   > > Great Job.
   > > Two more comments:
   > > 
   > > 1. Suggest adding this stage as the last stage in build.yml, as we need to ensure the images are pushed success, then trigger the helm chart promote version.
   > > 2. Previously, only actions from verified creators are allowed in this repo.
   > 
   > Thank you for you careful review! @matrixji
   > 
   > For the second suggestion, I want to use the way above to sovle it:
   > 
   > Using`git submodule` to download actions to `.workflows/actions` in `apache/incubator-devalke`, like the solutions in helm chart:
   > 
   > https://github.com/apache/incubator-devlake-helm-chart/tree/main/.github/actions
   > 
   > <img alt="image" width="370" src="https://user-images.githubusercontent.com/36830265/223626378-69caea4e-7e07-4b33-a04d-4e18966141ad.png">
   > 
   > Is it allowed?
   
   IMO, this it's acceptable, @warren830 could also help comment on that?


-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] warren830 commented on pull request #4607: ci: sync image tags to helm chart

Posted by "warren830 (via GitHub)" <gi...@apache.org>.
warren830 commented on PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#issuecomment-1465428538

   > 
   
   From my perspective, creating a github bot to submit pr, and manually approving it by us is better?


-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] matrixji commented on pull request #4607: ci: sync image tags to helm chart

Posted by "matrixji (via GitHub)" <gi...@apache.org>.
matrixji commented on PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#issuecomment-1465988842

   Some new ideas about this solution, this action finally want's to create PR in repo ``
   
   > @matrixji @aFlyBird0 I found some related information from https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
   > 
   > According to the document, the `GITHUB_TOKEN` is generated by the Github App and restricted to the **installed** repo only, in other words, it can't be used to fork and create pr for another repo.
   
   Maybe the simple way is just to create an action in `incubator-devlake-helm-chart` itself for creating PR promoting the image versions. And this action is triggered by an Issue raised in  `incubator-devlake-helm-chart` (we could add an issue template for changing image tags)


-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] aFlyBird0 commented on a diff in pull request #4607: ci: sync image tags to helm chart

Posted by "aFlyBird0 (via GitHub)" <gi...@apache.org>.
aFlyBird0 commented on code in PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#discussion_r1128985417


##########
.github/workflows/sync-helm.yml:
##########
@@ -0,0 +1,66 @@
+#
+# 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: sync-helm
+on:
+  push:
+    tags-ignore:
+      - '*test*'
+
+env:
+  HELM_CHART_REPO: incubator-devlake-helm-chart
+  TAG: ${{ github.ref_name }}
+  FORK_REPO: aFlyBird0/incubator-devlake-helm-chart

Review Comment:
   Do you mean `apache/incubator-devlake-helm-chart`?
   
   Now, the workflow is: push commits to a fork repo(like `aFlyBird0/incubator-devlake-helm-chart`) in a new branch, and create a PR to `apache/incubator-devlake-helm-chart`. So the `GH_PAT` only need the permission of `aFlyBird0` rather than `apache`. ①
   
   We can push commits `apache/incubator-devlake-helm-chart` in a new branch, and create a PR. But in this way, the `GH_PAT` need write permission to `apache/incubator-devlake-helm-chart` ②
   
   So devlake team prefer the second one?



-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] matrixji commented on a diff in pull request #4607: feat: sync image tags to helm chart

Posted by "matrixji (via GitHub)" <gi...@apache.org>.
matrixji commented on code in PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#discussion_r1128381147


##########
.github/workflows/sync-helm.yml:
##########
@@ -0,0 +1,66 @@
+#
+# 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: sync-helm
+on:
+  push:
+    tags-ignore:
+      - '*test*'
+
+env:
+  HELM_CHART_REPO: incubator-devlake-helm-chart
+  TAG: ${{ github.ref_name }}
+  FORK_REPO: aFlyBird0/incubator-devlake-helm-chart
+
+jobs:
+  sync-helm-images:
+    if: (github.repository == 'apache/incubator-devlake')
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Helm Chart
+        uses: actions/checkout@v3
+        with:
+          path: ${{ env.HELM_CHART_REPO }}
+          repository: apache/${{ env.HELM_CHART_REPO }}
+      - name: Update Helm Chart Image Tag
+        run: |
+          versionWithoutV=$(echo ${{ env.TAG }} | sed 's/^v//')
+          sed -i "s/imageTag: .*/imageTag: ${{ env.TAG }}/g" ${{ env.HELM_CHART_REPO }}/charts/devlake/values.yaml
+          sed -i "s/version: .*/version: ${versionWithoutV}/g" ${{ env.HELM_CHART_REPO }}/charts/devlake/Chart.yaml
+          sed -i "s/appVersion: .*/appVersion: ${{ env.TAG }}/g" ${{ env.HELM_CHART_REPO }}/charts/devlake/Chart.yaml
+      - name: Create Pull Request
+        # reference: https://github.com/peter-evans/create-pull-request
+        uses: peter-evans/create-pull-request@v4
+        with:
+          # this GitHub Personal Access Token should have 'repo' scope to the forked repo
+          # or any other way in this link:
+          # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
+          token: ${{ secrets.GH_PAT }}
+          path: ${{ env.HELM_CHART_REPO }}
+          branch: sync-helm-images
+          branch-suffix: timestamp
+          title: "feat: sync image tags(auto by bot)"

Review Comment:
   Not very sure, personally prefer using "ci:" as a category.



-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] matrixji commented on a diff in pull request #4607: ci: sync image tags to helm chart

Posted by "matrixji (via GitHub)" <gi...@apache.org>.
matrixji commented on code in PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#discussion_r1133417361


##########
.github/workflows/sync-helm.yml:
##########
@@ -0,0 +1,66 @@
+#
+# 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: sync-helm
+on:
+  push:
+    tags-ignore:
+      - '*test*'
+
+env:
+  HELM_CHART_REPO: incubator-devlake-helm-chart
+  TAG: ${{ github.ref_name }}
+  FORK_REPO: aFlyBird0/incubator-devlake-helm-chart

Review Comment:
   Yes, you're right, that requires tokens for the forked repo. And still, keeping your personal token in repo `apache/incubator-devlake` is not a good practice from the security point of view also.
   And I also do some tests with the original repo as the forked repo, but it seems failed, https://github.com/matrixji/repo-merge-example-foo/actions/runs/4361999005.
   I'll try to have more investigation on it. let's keep moving on it.



-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] aFlyBird0 commented on pull request #4607: ci: sync image tags to helm chart

Posted by "aFlyBird0 (via GitHub)" <gi...@apache.org>.
aFlyBird0 commented on PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#issuecomment-1466039852

   > Some new ideas about this solution, this action finally want's to create PR in repo ``
   > 
   > > @matrixji @aFlyBird0 I found some related information from https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
   > > According to the document, the `GITHUB_TOKEN` is generated by the Github App and restricted to the **installed** repo only, in other words, it can't be used to fork and create pr for another repo.
   > 
   > Maybe the simple way is just to create an action in `incubator-devlake-helm-chart` itself for creating PR promoting the image versions. And this action is triggered by an Issue raised in `incubator-devlake-helm-chart` (we could add an issue template for changing image tags)
   > 
   > A PoC for this idea: The Issue create from the template form: [matrixji/repo-merge-example-bar#1](https://github.com/matrixji/repo-merge-example-bar/issues/1) The related PR is triggered by the above issue: [matrixji/repo-merge-example-bar#2](https://github.com/matrixji/repo-merge-example-bar/pull/2)
   
   I think it's a good idea!  🚀 @matrixji 


-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] aFlyBird0 commented on pull request #4607: ci: sync image tags to helm chart

Posted by "aFlyBird0 (via GitHub)" <gi...@apache.org>.
aFlyBird0 commented on PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#issuecomment-1467260637

   > matrixji/repo-merge-example-bar#1
   
   Yes, see https://github.com/matrixji/repo-merge-example-bar/issues/new/choose


-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] aFlyBird0 commented on a diff in pull request #4607: feat: sync image tags to helm chart

Posted by "aFlyBird0 (via GitHub)" <gi...@apache.org>.
aFlyBird0 commented on code in PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#discussion_r1128979443


##########
.github/workflows/sync-helm.yml:
##########
@@ -0,0 +1,66 @@
+#
+# 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: sync-helm
+on:
+  push:
+    tags-ignore:
+      - '*test*'
+
+env:
+  HELM_CHART_REPO: incubator-devlake-helm-chart
+  TAG: ${{ github.ref_name }}
+  FORK_REPO: aFlyBird0/incubator-devlake-helm-chart
+
+jobs:
+  sync-helm-images:
+    if: (github.repository == 'apache/incubator-devlake')
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Helm Chart
+        uses: actions/checkout@v3
+        with:
+          path: ${{ env.HELM_CHART_REPO }}
+          repository: apache/${{ env.HELM_CHART_REPO }}
+      - name: Update Helm Chart Image Tag
+        run: |
+          versionWithoutV=$(echo ${{ env.TAG }} | sed 's/^v//')
+          sed -i "s/imageTag: .*/imageTag: ${{ env.TAG }}/g" ${{ env.HELM_CHART_REPO }}/charts/devlake/values.yaml
+          sed -i "s/version: .*/version: ${versionWithoutV}/g" ${{ env.HELM_CHART_REPO }}/charts/devlake/Chart.yaml
+          sed -i "s/appVersion: .*/appVersion: ${{ env.TAG }}/g" ${{ env.HELM_CHART_REPO }}/charts/devlake/Chart.yaml
+      - name: Create Pull Request
+        # reference: https://github.com/peter-evans/create-pull-request
+        uses: peter-evans/create-pull-request@v4
+        with:
+          # this GitHub Personal Access Token should have 'repo' scope to the forked repo
+          # or any other way in this link:
+          # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
+          token: ${{ secrets.GH_PAT }}
+          path: ${{ env.HELM_CHART_REPO }}
+          branch: sync-helm-images
+          branch-suffix: timestamp
+          title: "feat: sync image tags(auto by bot)"

Review Comment:
   Yes, `ci` is better



-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] aFlyBird0 commented on pull request #4607: ci: sync image tags to helm chart

Posted by "aFlyBird0 (via GitHub)" <gi...@apache.org>.
aFlyBird0 commented on PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#issuecomment-1459533037

   > Great Job.
   > 
   > Two more comments:
   > 
   > 1. Suggest adding this stage as the last stage in build.yml, as we need to ensure the images are pushed success, then trigger the helm chart promote version.
   > 2. Previously, only actions from verified creators are allowed in this repo.
   
   Thank you for you careful review! @matrixji 
   
   For the second suggestion, I want to use the way above to sovle it:
   
    Using`git submodule` to download actions to `.workflows/actions` in `apache/incubator-devalke`, like the solutions in helm chart: 
   
   https://github.com/apache/incubator-devlake-helm-chart/tree/main/.github/actions
   
   <img width="370" alt="image" src="https://user-images.githubusercontent.com/36830265/223626378-69caea4e-7e07-4b33-a04d-4e18966141ad.png">
   
   Is it allowed?
   


-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] klesh commented on pull request #4607: ci: sync image tags to helm chart

Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh commented on PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#issuecomment-1467218699

   > Some new ideas about this solution, this action finally want's to create PR in repo ``
   > 
   > > @matrixji @aFlyBird0 I found some related information from https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
   > > According to the document, the `GITHUB_TOKEN` is generated by the Github App and restricted to the **installed** repo only, in other words, it can't be used to fork and create pr for another repo.
   > 
   > Maybe the simple way is just to create an action in `incubator-devlake-helm-chart` itself for creating PR promoting the image versions. And this action is triggered by an Issue raised in `incubator-devlake-helm-chart` (we could add an issue template for changing image tags)
   > 
   > A PoC for this idea: The Issue create from the template form: [matrixji/repo-merge-example-bar#1](https://github.com/matrixji/repo-merge-example-bar/issues/1) The related PR is triggered by the above issue: [matrixji/repo-merge-example-bar#2](https://github.com/matrixji/repo-merge-example-bar/pull/2)
   
   The issue have to be created manually, is that correct?


-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] aFlyBird0 commented on pull request #4607: ci: sync image tags to helm chart

Posted by "aFlyBird0 (via GitHub)" <gi...@apache.org>.
aFlyBird0 commented on PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#issuecomment-1467272549

   @matrixji I think your solution is well established (even have set the form in the issue template) how about I just close this PR after others agree and you submit a new PR to the helm repository?
   
   I've had a great time discussing with you the last few days and have learned a lot, thanks!


-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] aFlyBird0 commented on a diff in pull request #4607: ci: sync image tags to helm chart

Posted by "aFlyBird0 (via GitHub)" <gi...@apache.org>.
aFlyBird0 commented on code in PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#discussion_r1128985417


##########
.github/workflows/sync-helm.yml:
##########
@@ -0,0 +1,66 @@
+#
+# 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: sync-helm
+on:
+  push:
+    tags-ignore:
+      - '*test*'
+
+env:
+  HELM_CHART_REPO: incubator-devlake-helm-chart
+  TAG: ${{ github.ref_name }}
+  FORK_REPO: aFlyBird0/incubator-devlake-helm-chart

Review Comment:
   Do you mean `apache/incubator-devlake-helm-chart`?
   
   Now, the workflow is: push commits to a fork repo(like `aFlyBird0/incubator-devlake-helm-chart`) in a new branch, and create a PR to `apache/incubator-devlake-helm-chart`. So the `GH_PAT` only need the permission of `aFlyBird0` rather than `apache`. ①
   
   We can push commits `apache/incubator-devlake-helm-chart` in a new branch, and create a PR. But in this way, the `GH_PAT` need write permission to `apache/incubator-devlake-helm-chart` ②
   
   So devlake team prefer the second one?
   
   
   (Because I only have PAT of my account now, so I use `aFlyBIrd0/incubator-devlake-helm-chart` as a temp fork repo. You can use other accounts such as `devlake-bot/incubator-devlake-helm-chart`. I will edit the commits after the secret is set.)



-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] matrixji commented on a diff in pull request #4607: feat: sync image tags to helm chart

Posted by "matrixji (via GitHub)" <gi...@apache.org>.
matrixji commented on code in PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#discussion_r1128393516


##########
.github/workflows/sync-helm.yml:
##########
@@ -0,0 +1,66 @@
+#
+# 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: sync-helm
+on:
+  push:
+    tags-ignore:
+      - '*test*'
+
+env:
+  HELM_CHART_REPO: incubator-devlake-helm-chart
+  TAG: ${{ github.ref_name }}
+  FORK_REPO: aFlyBird0/incubator-devlake-helm-chart

Review Comment:
   This is for test purposes, finally, I think we could use `incubator-devlake-helm-chart` as FORK_REPO also.



-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] matrixji commented on pull request #4607: feat: sync image tags to helm chart

Posted by "matrixji (via GitHub)" <gi...@apache.org>.
matrixji commented on PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#issuecomment-1458667571

   Two more comments:
   1. Suggest adding this stage as the last stage in build.yml, as we need to ensure the images are pushed success, then trigger the helm chart promote version.
   2. Previously, only actions from verified creators are allowed in this repo.


-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] warren830 commented on pull request #4607: ci: sync image tags to helm chart

Posted by "warren830 (via GitHub)" <gi...@apache.org>.
warren830 commented on PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#issuecomment-1465429679

   > > > Great Job.
   > > > Two more comments:
   > > > 
   > > > 1. Suggest adding this stage as the last stage in build.yml, as we need to ensure the images are pushed success, then trigger the helm chart promote version.
   > > > 2. Previously, only actions from verified creators are allowed in this repo.
   > > 
   > > 
   > > Thank you for you careful review! @matrixji
   > > For the second suggestion, I want to use the way above to sovle it:
   > > Using`git submodule` to download actions to `.workflows/actions` in `apache/incubator-devalke`, like the solutions in helm chart:
   > > https://github.com/apache/incubator-devlake-helm-chart/tree/main/.github/actions
   > > <img alt="image" width="370" src="https://user-images.githubusercontent.com/36830265/223626378-69caea4e-7e07-4b33-a04d-4e18966141ad.png">
   > > Is it allowed?
   > 
   > IMO, this it's acceptable, @warren830 could also help comment on that?
   
   
   I'm not quite sure about the workflow of the second suggestion. Will this also submit a pr or promote automatically?
   From my perspective, creating a github bot to submit pr, and manually approving it by us is acceptable, but if the second proposal require less work, I think it'd be better.
   
   


-- 
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@devlake.apache.org

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


[GitHub] [incubator-devlake] klesh commented on pull request #4607: ci: sync image tags to helm chart

Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh commented on PR #4607:
URL: https://github.com/apache/incubator-devlake/pull/4607#issuecomment-1465706943

   @matrixji @aFlyBird0 I found some related information from https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
   
   According to the document, the `GITHUB_TOKEN` is generated by the Github App and restricted to the **installed** repo only, in other words, it can't be used to fork and create pr for another repo.
   


-- 
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@devlake.apache.org

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