Skip to content

Fix -ignore-fork filtering for GitLab, Bitbucket, and Forgejo#210

Open
rdowavic wants to merge 1 commit intoamitsaha:masterfrom
rdowavic:feat/fix-ignore-fork-filtering
Open

Fix -ignore-fork filtering for GitLab, Bitbucket, and Forgejo#210
rdowavic wants to merge 1 commit intoamitsaha:masterfrom
rdowavic:feat/fix-ignore-fork-filtering

Conversation

@rdowavic
Copy link

@rdowavic rdowavic commented Feb 26, 2026

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.

  • GitLab: Check ForkedFromProject != nil to skip forked repos when -ignore-fork is set
  • Bitbucket: Check Parent != nil to skip forked repos when -ignore-fork is set
  • Forgejo: Thread ignoreFork into paginateForgejoRepositories and check repo.Fork to skip forked repos

All three now match the existing GitHub pattern (github.go:38).

Test plan

  • bash test/integration-test.sh github — all tests pass
  • bash 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)

@rdowavic rdowavic force-pushed the feat/fix-ignore-fork-filtering branch from 6238a37 to be60777 Compare February 26, 2026 06:17
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.
@rdowavic rdowavic closed this Feb 26, 2026
@rdowavic rdowavic force-pushed the feat/fix-ignore-fork-filtering branch from be60777 to 044ff15 Compare February 26, 2026 06:25
@rdowavic rdowavic reopened this Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant