Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): rework ci labels used to trigger workflows #17197

Merged
merged 2 commits into from
Jun 12, 2024
Merged

Conversation

kwannoel
Copy link
Contributor

@kwannoel kwannoel commented Jun 11, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Closes #17182.

Improvements:

  1. User has less tags to add now to trigger specific workflows. They no longer need to add labels for the dependent steps.
  2. The tags are more straightforward run-selected is clearer than skip-ci.

See the developer guide for more info, or the labels in this PR.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@fuyufjh
Copy link
Member

fuyufjh commented Jun 11, 2024

Thanks for work!

Does the ci/main-cron/run-selected tag seem to be redundant? (Also a bit counter-intuitive to me)

How about

  • ci/main-cron/run-all runs all main-cron tests
  • [ci/main-cron/foo, ci/main-cron/bar] runs foo and bar

@kwannoel kwannoel disabled auto-merge June 11, 2024 09:04
@kwannoel
Copy link
Contributor Author

Thanks for work!

Does the ci/main-cron/run-selected tag seem to be redundant? (Also a bit counter-intuitive to me)

How about

* `ci/main-cron/run-all` runs all `main-cron` tests

* [`ci/main-cron/foo`, `ci/main-cron/bar`] runs `foo` and `bar`

Just took a look at buildkite's conditional expression support. To support this, we need to check for ci/main-cron/run-* inside the PR label, in order to decide whether or not to run the main-cron steps.

But the conditional expression support is kind of limited. https://buildkite.com/docs/pipelines/conditionals#variable-and-syntax-reference.

It supports regex, but not for array, which is the type of the PR labels in buildkite. For array it only supports includes.

@kwannoel kwannoel force-pushed the kwannoel/always-run branch from 6314aa2 to c080a25 Compare June 11, 2024 14:31
Copy link
Contributor

@huangjw806 huangjw806 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kwannoel kwannoel added this pull request to the merge queue Jun 12, 2024
@fuyufjh
Copy link
Member

fuyufjh commented Jun 12, 2024

Just took a look at buildkite's conditional expression support. To support this, we need to check for ci/main-cron/run-* inside the PR label, in order to decide whether or not to run the main-cron steps.

But the conditional expression support is kind of limited. https://buildkite.com/docs/pipelines/conditionals#variable-and-syntax-reference.

It supports regex, but not for array, which is the type of the PR labels in buildkite. For array it only supports includes.

I mean, taking e2e-test-release as an example, it should be like

key: "e2e-test-release"
    command: "ci/scripts/cron-e2e-test.sh -p ci-release -m ci-3streaming-2serving-3fe"
    if: |
      build.pull_request.labels includes "ci/main-cron/run-all"
      || build.pull_request.labels includes "ci/run-e2e-test" 
      || build.env("CI_STEPS") =~ /(^|,)e2e-tests?(,|$$)/
    depends_on:

What do you think?

@kwannoel kwannoel removed this pull request from the merge queue due to a manual request Jun 12, 2024
@fuyufjh
Copy link
Member

fuyufjh commented Jun 12, 2024

Just get to know that there is another condition in pipeline's setting:

(build.pull_request.id != null && (build.pull_request.labels includes "ci/main-cron/run-all" || build.pull_request.labels includes "ci/main-cron/run-selected"))  || build.tag != null

Thus it seems inevitable to introduce a run-selected, because BuildKite doesn't allow to match a value in Array via regex.

@fuyufjh fuyufjh added this pull request to the merge queue Jun 12, 2024
Merged via the queue into main with commit cf28b76 Jun 12, 2024
30 of 31 checks passed
@fuyufjh fuyufjh deleted the kwannoel/always-run branch June 12, 2024 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rework ci labels
3 participants