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

feat(rulesets): add support for PR labeled events #1081

Merged
merged 19 commits into from
Apr 5, 2024
Merged

Conversation

wsan3
Copy link
Contributor

@wsan3 wsan3 commented Mar 13, 2024

Description

Request for Vela to process and create builds for pull request labeled and unlabeled webhooks.

Related

GitHub issue #913
GitHub ideas #768

1. Add API changes for updating repos to leverage label events
2. Process PR label events in scm package
3. Update compiler to use label value in its purging process
@wsan3 wsan3 added the feature Indicates a new feature label Mar 13, 2024
@wsan3 wsan3 requested a review from a team as a code owner March 13, 2024 16:56
compiler/native/compile.go Outdated Show resolved Hide resolved
compiler/native/compile.go Outdated Show resolved Hide resolved
database/repo/repo_test.go Show resolved Hide resolved
database/secret/secret_test.go Show resolved Hide resolved
compiler/native/compile.go Outdated Show resolved Hide resolved
scm/github/webhook.go Outdated Show resolved Hide resolved
scm/github/webhook.go Outdated Show resolved Hide resolved
compiler/native/compile.go Outdated Show resolved Hide resolved
scm/github/webhook.go Outdated Show resolved Hide resolved
scm/github/webhook.go Outdated Show resolved Hide resolved
database/repo/repo_test.go Show resolved Hide resolved
database/repo/repo_test.go Show resolved Hide resolved
database/secret/secret_test.go Show resolved Hide resolved
database/secret/secret_test.go Show resolved Hide resolved
@wsan3 wsan3 marked this pull request as draft March 25, 2024 17:56
@wsan3 wsan3 marked this pull request as ready for review March 26, 2024 18:43
compiler/native/compile.go Show resolved Hide resolved
compiler/native/compile.go Show resolved Hide resolved
compiler/native/compile.go Show resolved Hide resolved
scm/github/webhook.go Show resolved Hide resolved
scm/github/webhook.go Show resolved Hide resolved
compiler/native/compile.go Show resolved Hide resolved
scm/github/webhook.go Show resolved Hide resolved
scm/github/webhook.go Show resolved Hide resolved
queue/redis/redis_test.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 94.44444% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 61.94%. Comparing base (fb31ea5) to head (4e27971).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1081      +/-   ##
==========================================
+ Coverage   61.89%   61.94%   +0.05%     
==========================================
  Files         358      358              
  Lines       10885    10902      +17     
==========================================
+ Hits         6737     6753      +16     
- Misses       3662     3663       +1     
  Partials      486      486              
Files Coverage Δ
compiler/native/compile.go 71.63% <100.00%> (+0.10%) ⬆️
compiler/native/native.go 87.95% <100.00%> (+0.61%) ⬆️
scm/github/webhook.go 90.85% <100.00%> (+0.30%) ⬆️
api/build/compile_publish.go 0.00% <0.00%> (ø)

api/webhook/post.go Outdated Show resolved Hide resolved
api/webhook/post.go Show resolved Hide resolved
api/webhook/post.go Show resolved Hide resolved
Copy link
Contributor

@ecrupper ecrupper left a comment

Choose a reason for hiding this comment

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

Looks good. Requesting a couple extra tests. One for WithLabel(...) and one for processPREvent(...) that processes a PR payload of the labeled action type. Also it might be useful to make sure that other PR events populate the labels properly as well via a test

compiler/native/native.go Show resolved Hide resolved
scm/github/webhook.go Show resolved Hide resolved
Copy link
Contributor

@timhuynh94 timhuynh94 left a comment

Choose a reason for hiding this comment

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

LGTM

@wsan3 wsan3 merged commit e7917a8 into main Apr 5, 2024
14 of 16 checks passed
@wsan3 wsan3 deleted the feat/pr-labeled-action branch April 5, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Indicates a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants