Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Don't trigger a sync twice on creation/deletion for GitHub #6614
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
Don't trigger a sync twice on creation/deletion for GitHub #6614
Changes from 6 commits
a809340
878bb09
526bff8
d16d714
b8e4f30
92bef20
be5495f
891dbf4
ac34fb9
a95c90c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good comment 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't follow this code 😢
We are already handling GITHUB_PUSH in the previous if with
deleted or created
(line 382), why don't we just remove the GITHUB_PUSH from thiselif
(line 389) instead? That seems to do the same without extra code.Like this on line 389:
That way, we are only syncing versions on CREATE and DELETE, but not on regular PUSH.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what we want is:
GITHUB_PUSH and (created or deleted)
-> sync versionsGITHUB_CREATE or GITHUB_DELETE
-> sync versionsIf this is correct, I do see this logic easier to understand than our current implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are triggering a build in that case, and we check for
not (deleted or created)
We want to listen to PUSH events for sync, but only trigger a sync if the webhook isn't subscribed to creation/deletion events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub will send two events when a branch/tag is created/deleted (if the webhook is listening to creation/deletion events), that's why we need to discard the push event in that case.
That will still need to check if the webhook isn't subscribed to creation/deletion. Otherwise it'll trigger two syncs.
This will trigger a second sync for users that have webhooks listening to creation/deletion events.