Skip to content

Commit

Permalink
chore(ci): fix a few logic bugs and more strict comment parsing (vect…
Browse files Browse the repository at this point in the history
…ordotdev#17502)

- Made integration comment parsing more strict to not run on unintended
comments
- Fix logic concurrency group logic issues for comment triggers on k8s
and regression workflows.
- Use the merge queue's head sha for concurrency cancellation check,
this is more correct and enables us to use the concurrency features of
the merge queue
  • Loading branch information
neuronull authored May 29, 2023
1 parent 98c54ad commit bf372fd
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 61 deletions.
72 changes: 34 additions & 38 deletions .github/workflows/integration-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ env:
CI: true
PROFILE: debug

concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.id }}
cancel-in-progress: true

jobs:
prep-pr:
name: (PR comment) Signal pending to PR
Expand Down Expand Up @@ -81,73 +77,73 @@ jobs:
matrix:
run:
- test_name: 'amqp'
if: ${{ contains(github.event.comment.body, 'amqp') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-amqp') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'appsignal'
if: ${{ contains(github.event.comment.body, 'appsignal') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-appsignal') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'aws'
if: ${{ contains(github.event.comment.body, 'aws') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-aws') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'axiom'
if: ${{ contains(github.event.comment.body, 'axiom') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-axiom') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'azure'
if: ${{ contains(github.event.comment.body, 'azure') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-azure') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'clickhouse'
if: ${{ contains(github.event.comment.body, 'clickhouse') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-clickhouse') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'databend'
if: ${{ contains(github.event.comment.body, 'databend') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-databend') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'datadog-agent'
if: ${{ contains(github.event.comment.body, 'datadog') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-datadog') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'datadog-logs'
if: ${{ contains(github.event.comment.body, 'datadog') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-datadog') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'datadog-metrics'
if: ${{ contains(github.event.comment.body, 'datadog') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-datadog') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'datadog-traces'
if: ${{ contains(github.event.comment.body, 'datadog') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-datadog') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'dnstap'
if: ${{ contains(github.event.comment.body, 'dnstap') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-dnstap') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'docker-logs'
if: ${{ contains(github.event.comment.body, 'docker-logs') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-docker-logs') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'elasticsearch'
if: ${{ contains(github.event.comment.body, 'elasticsearch') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-elasticsearch') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'eventstoredb'
if: ${{ contains(github.event.comment.body, 'eventstoredb') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-eventstoredb') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'fluent'
if: ${{ contains(github.event.comment.body, 'fluent') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-fluent') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'gcp'
if: ${{ contains(github.event.comment.body, 'gcp') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-gcp') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'humio'
if: ${{ contains(github.event.comment.body, 'humio') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-humio') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'http-client'
if: ${{ contains(github.event.comment.body, 'http-client') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-http-client') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'influxdb'
if: ${{ contains(github.event.comment.body, 'influxdb') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-influxdb') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'kafka'
if: ${{ contains(github.event.comment.body, 'kafka') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-kafka') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'logstash'
if: ${{ contains(github.event.comment.body, 'logstash') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-logstash') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'loki'
if: ${{ contains(github.event.comment.body, 'loki') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-loki') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'mongodb'
if: ${{ contains(github.event.comment.body, 'mongodb') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-mongodb') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'nats'
if: ${{ contains(github.event.comment.body, 'nats') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-nats') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'nginx'
if: ${{ contains(github.event.comment.body, 'nginx') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-nginx') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'opentelemetry'
if: ${{ contains(github.event.comment.body, 'opentelemetry') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-opentelemetry') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'postgres'
if: ${{ contains(github.event.comment.body, 'postgres') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-postgres') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'prometheus'
if: ${{ contains(github.event.comment.body, 'prometheus') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-prometheus') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'pulsar'
if: ${{ contains(github.event.comment.body, 'pulsar') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-pulsar') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'redis'
if: ${{ contains(github.event.comment.body, 'redis') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-redis') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'shutdown'
if: ${{ contains(github.event.comment.body, 'shutdown') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-shutdown') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'splunk'
if: ${{ contains(github.event.comment.body, 'splunk') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-splunk') || contains(github.event.comment.body, '/ci-run-all') }}
- test_name: 'webhdfs'
if: ${{ contains(github.event.comment.body, 'webhdfs') || contains(github.event.comment.body, 'all') }}
if: ${{ contains(github.event.comment.body, '/ci-run-integration-webhdfs') || contains(github.event.comment.body, '/ci-run-all') }}

update-pr-status:
name: Signal result to PR
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

concurrency:
# `github.event.number` exists for pull requests, otherwise fall back to SHA for merge queue
group: ${{ github.workflow }}-${{ github.event.number || github.event.merge_group.base_sha }}
group: ${{ github.workflow }}-${{ github.event.number || github.event.merge_group.head_sha }}
cancel-in-progress: true

env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/k8s_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ on:
- cron: '0 0 * * 2-6'

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.event.issue.id || github.event.merge_group.base_sha || github.event.schedule || github.sha }}
group: ${{ github.workflow }}-${{ github.event.number || github.event.comment.html_url || github.event.merge_group.head_sha || github.event.schedule || github.sha }}

cancel-in-progress: true

Expand Down
20 changes: 1 addition & 19 deletions .github/workflows/master_merge_queue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:

concurrency:
# `github.event.number` exists for pull requests, otherwise fall back to SHA for merge queue
group: ${{ github.workflow }}-${{ github.event.number || github.event.merge_group.base_sha }}
group: ${{ github.workflow }}-${{ github.event.number || github.event.merge_group.head_sha }}
cancel-in-progress: true

env:
Expand Down Expand Up @@ -106,24 +106,6 @@ jobs:
needs: changes
secrets: inherit

# TODO: in a followup PR, run the regression workflow here, as a single reusable workflow.
#
# NOTE: This design of passing in the pr-number to the Regression workflow requires that the merge queue
# be configured contain a maximum of one PR per execution. This is so that the regression report generated
# by the workflow can be posted as a comment to the PR.
# At a later time, we may want to revisit this in order to allow multiple PRs to be included in a merge
# queue execution. At such time, the logic of uploading of the report will need to change to account for
# multiple PRs.
# regression:
# if: needs.changes.outputs.source == 'true'
# uses: ./.github/workflows/regression.yml
# with:
# pr_number: ${{ needs.changes.outputs.pr-number }}
# base_sha: ${{ github.event.merge_group.base_sha }}
# head_sha: ${{ github.event.merge_group.head_sha }}
# needs: changes
# secrets: inherit

master-merge-queue-check:
name: Master Merge Queue Suite
# Always run this so that pull_request triggers are marked as success.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.id || github.event.merge_group.base_sha || github.sha }}
group: ${{ github.workflow }}-${{ github.event.merge_group.head_sha || github.sha }}
cancel-in-progress: true

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

concurrency:
# `github.event.number` exists for pull requests, otherwise fall back to SHA for merge queue
group: ${{ github.workflow }}-${{ github.event.number || github.event.merge_group.base_sha }}
group: ${{ github.workflow }}-${{ github.event.number || github.event.merge_group.head_sha }}
cancel-in-progress: true

env:
Expand Down

0 comments on commit bf372fd

Please sign in to comment.