Repository navigation
🐛 fix: only fetch public projects and merge requests - #105
Merged
jeanphi-baconnais merged 2 commits intoNov 3, 2026
Merged
jeanphi-baconnais merged 2 commits into
jeanphi-baconnais merged 2 commits into
Conversation
# Conflicts: # src/main/java/fr/zenika/opensource/stats/services/GitLabServices.java
jeanphi-baconnais
force-pushed
the
fix/fetch-only-public-projects-and-mrs
branch
from
November 3, 2026 08:56
795a05e to
3a0d39d
Compare
jeanphi-baconnais
marked this pull request as ready for review
November 3, 2026 12:44
github-actions Bot
pushed a commit
that referenced
this pull request
Nov 3, 2026
# [v1.12.1](v1.12.0...v1.12.1) (2026-11-03) ## 🐛 Bug Fixes - [`fd5628c`](fd5628c) fix: only fetch public projects and merge requests (#105) (Issues: [`#105`](#105))
|
🎉 This PR is included in version 1.12.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
📝 Description
Ensure that only public projects and merge requests (MRs) from public projects are fetched and counted from GitLab and GitHub.
Previously, when a private access token (
gitlab.token) was configured in the environment, the GitLab API returned all accessible projects and MRs, including private ones (such asarbre-gen), skewing member statistics and personal project listings.🚀 Main Changes
1. GitLab Merge Requests
GitLabClient&GitLabServices): Removed theAuthorizationheader param fromgitLabClient.getMergeRequests. QueryingGET /api/v4/merge_requests?scope=all&author_id=...without authentication guarantees that GitLab returns strictly public MRs, excluding any private projects/MRs accessible via the personal access token.2. Projects Visibility Filtering
@QueryParam("visibility") String visibilitytogitLabClient.getProjectsForAnUserset to"public"to filter server-side.Project): AddedisPrivate(@JsonProperty("private")) and a helper methodisPublic()that returnsfalseifprivate == trueor ifvisibilityisprivate/internal.GitLabServices&GitHubServices): Appliedproject.isPublic()filtering on personal and organization projects.3. Personal Projects Synchronization
WorkflowRessources: UpdatedsavePersonalProjects()to delete and save GitLab personal projects alongside GitHub personal projects.4. Testing & Tooling
GitLabProjectTest&GitHubProjectTest): Added tests asserting that private projects are identified and rejected byisPublic().GitLabServicesTest: Added tests verifying that private/forked projects are filtered out and that MR counts query without authorization headers.mock-maker-subclassinsrc/test/resources/mockito-extensionsto ensure Mockito test compatibility with Java 25.🧪 Verification & Testing
mvn test: all 51 tests passed successfully.arbre-gen) and private MRs are excluded from counts.