Fix -ignore-fork filtering for GitLab, Bitbucket, and Forgejo#210
Open
rdowavic wants to merge 1 commit intoamitsaha:masterfrom
Open
Fix -ignore-fork filtering for GitLab, Bitbucket, and Forgejo#210rdowavic wants to merge 1 commit intoamitsaha:masterfrom
rdowavic wants to merge 1 commit intoamitsaha:masterfrom
Conversation
6238a37 to
be60777
Compare
The ignoreFork flag was only implemented for GitHub. Add fork detection to the other three services: - GitLab: skip repos where ForkedFromProject is non-nil - Bitbucket: skip repos where Parent is non-nil - Forgejo: skip repos where Fork is true, threading ignoreFork into paginateForgejoRepositories Also pass ignoreFork from getRepositories to each service function.
be60777 to
044ff15
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
So when I implemented the ignore-fork check on the integration test script I found some unexpected results but I realised we didn't have fork filtering on gitlab, bitbucket, and forgejo so I added them. They were only small 2 line changes. I don't have the new test integration script in this branch but I tested it on the new one and now everything is passing.
ForkedFromProject != nilto skip forked repos when-ignore-forkis setParent != nilto skip forked repos when-ignore-forkis setignoreForkintopaginateForgejoRepositoriesand checkrepo.Forkto skip forked reposAll three now match the existing GitHub pattern (
github.go:38).Test plan
bash test/integration-test.sh github— all tests passbash test/integration-test.sh gitlab— all tests pass including fork filtering (Tests 5 & 6)bash test/integration-test.sh bitbucket— all tests pass including fork filtering (Tests 5 & 6)bash test/integration-test.sh forgejo— all tests pass including fork filtering (Tests 5 & 6)