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

Better filtering of GitHub webooks by autodeployment server #2312

Closed
humphd opened this issue Sep 23, 2021 · 0 comments · Fixed by #2316
Closed

Better filtering of GitHub webooks by autodeployment server #2312

humphd opened this issue Sep 23, 2021 · 0 comments · Fixed by #2316
Assignees
Labels
area: autodeployment Anything related to auto deployment type: enhancement New feature or request
Milestone

Comments

@humphd
Copy link
Contributor

humphd commented Sep 23, 2021

From #2308 (review), we notice that there are more webhooks coming in from GitHub than we thought, and we need to do a better job of filtering these. For example, when we merge a PR from dependabot, there are two push actions happening: one to master and another to the branch in question.

We don't currently do any filtering on branch or tag name. However, the following information is available to us:

  • ref: The git ref resource. Could be a branch name (e.g., refs/heads/master) or a tag (v1.0.2)
  • ref_type: The type of Git ref object created in the repository. Can be either branch or tag.
  • master_branch: The name of the repository's default branch (usually main or in our case currently, master).

So I guess pseudo logic would be:

if((ref_type === 'branch' && ref === `refs/heads/${master_branch}`) || ref_type === 'tag') {
  build()
}

Probably the place to do this is requestFilter() here

function requestFilter(name, buildType, action) {
.

@humphd humphd added type: enhancement New feature or request area: autodeployment Anything related to auto deployment labels Sep 23, 2021
@manekenpix manekenpix self-assigned this Sep 25, 2021
@manekenpix manekenpix added this to the 2.1.5 Release milestone Sep 25, 2021
manekenpix added a commit that referenced this issue Oct 2, 2021
Close #2312: Better filtering of GitHub webooks by autodeployment server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: autodeployment Anything related to auto deployment type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants