volatilemolotov commented on code in PR #29010: URL: https://github.com/apache/beam/pull/29010#discussion_r1361193481
########## .github/workflows/beam_Metrics_Report.yml: ########## @@ -0,0 +1,115 @@ +# 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: Beam Metrics Report + +on: + # issue_comment: + # types: [created] + # schedule: + # - cron: '0 */23 * * *' + workflow_dispatch: + +# This allows a subsequently queued workflow run to interrupt previous runs +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.event.pull_request.head.label || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login}}' + cancel-in-progress: true + +env: + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }} + +#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event +permissions: + actions: write + pull-requests: read + checks: read + contents: read + deployments: read + id-token: none + issues: read + discussions: read + packages: read + pages: read + repository-projects: read + security-events: read + statuses: read + +jobs: + beam_Metrics_Report: + name: ${{matrix.job_name}} (${{matrix.job_phrase}}) + runs-on: [self-hosted, ubuntu-20.04, main] + timeout-minutes: 120 + strategy: + fail-fast: false + matrix: + job_name: [beam_Metrics_Report] + job_phrase: [Run Metrics Report] + if: | + github.event_name == 'schedule' || + github.event_name == 'workflow_dispatch' || + github.event.comment.body == 'Run Metrics Report' + steps: + - uses: actions/checkout@v3 + - name: Generate a token + id: generate_token + uses: actions/create-github-app-token@v1 + with: + app_id: ${{ secrets.GH_APP_ID }} + private_key: ${{ secrets.GH_APP_PRIVATE_KEY }} + - name: Setup repository + uses: ./.github/actions/setup-action + with: + comment_phrase: ${{ matrix.job_phrase }} + github_token: ${{ steps.generate_token.outputs.token }} + github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }}) + steps_context: ${{ toJson(steps) }} + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Run Metrics Report + uses: ./.github/actions/gradle-command-self-hosted-action + with: + gradle-command: :beam-test-jenkins:generateMetricsReport + arguments: --info -PinfluxDb=beam_test_metrics -PinfluxHost='10.128.0.96' -PinfluxPort=8086 + env: + INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }} + INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }} + - name: Archive Report + uses: actions/upload-artifact@v3 + with: + name: Metrics Report + path: ".test-infra/jenkins/metrics_report/beam-metrics_report.html" + - name: Generate Date + run: | + date=$(date -u +"%Y-%m-%d") + echo "date=$date" >> $GITHUB_ENV + - name: Send mail + uses: dawidd6/action-send-mail@v3 + with: + server_address: smtp.gmail.com + server_port: 465 + secure: true + username: ${{ secrets.ISSUE_REPORT_SENDER_EMAIL_ADDRESS }} + password: ${{ secrets.ISSUE_REPORT_SENDER_EMAIL_PASSWORD }} + subject: Beam Metrics Report ${{ env.date }} + to: [email protected] #[email protected] + cc: [email protected] Review Comment: We are specifying both to: and cc: in this case. This is temporary so that it can be tested once merged and action is approved (notice that only wokflow_dispatch trigger is enabled for now). After that there will be only to: dev@... -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
