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

Extend gitlab models by introducing graphql support #47

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
16b3312
feat: get signInActivity (only allowed if tenant has premium p1 or p2…
mjsprengers Oct 30, 2024
d4e5d3b
feat: add signInActivity to response if tenant has premium p1 or p2 l…
mjsprengers Oct 30, 2024
bb9af2d
feat: handle the case where Intune is not used / not licensed, return…
mjsprengers Oct 31, 2024
71ab332
feat: add organization datafetcher
mjsprengers Nov 4, 2024
f9d5f61
Merge pull request #1 from mjsprengers/graphservice-datafetchers
mjsprengers Nov 4, 2024
1ef3874
Revert "feat: add organization datafetcher"
mjsprengers Nov 7, 2024
7f04c50
Revert "feat: handle the case where Intune is not used / not licensed…
mjsprengers Nov 7, 2024
42cf40e
Revert "feat: add signInActivity to response if tenant has premium p1…
mjsprengers Nov 7, 2024
94c616a
Revert "feat: get signInActivity (only allowed if tenant has premium …
mjsprengers Nov 7, 2024
fe66bff
Merge branch 'Blazebit:main' into main
mjsprengers Nov 11, 2024
847c6f5
Merge branch 'Blazebit:main' into main
mjsprengers Nov 14, 2024
80d4248
Merge branch 'Blazebit:main' into main
mjsprengers Nov 27, 2024
8a2d48d
Merge branch 'Blazebit:main' into main
mjsprengers Dec 23, 2024
61ab53b
Merge branch 'Blazebit:main' into main
mjsprengers Jan 28, 2025
809f0a4
Merge branch 'Blazebit:main' into main
mjsprengers Feb 7, 2025
8ff1310
Merge branch 'Blazebit:main' into main
mjsprengers Feb 12, 2025
88c2712
feat: add jackson for graphql field data mapping
mjsprengers Feb 14, 2025
d950085
feat: add graphql integration
mjsprengers Feb 14, 2025
c7cc5bb
feat: add graphql integration
mjsprengers Feb 14, 2025
a699d44
feat: add add graphql pagination support
mjsprengers Feb 17, 2025
a306861
feat: use json mappers instead of jackson
mjsprengers Feb 17, 2025
e4cc664
feat: use component methods conventions
mjsprengers Feb 18, 2025
c69ab58
feat: add more fields and corresponding parsing
mjsprengers Feb 25, 2025
02b0c94
feat: add branchProtection field
mjsprengers Feb 25, 2025
b6a6c9a
feat: add gitlab paginated graphql support and retrieve security rela…
mjsprengers Feb 26, 2025
1c099e9
Add gitlabprojects
mjsprengers Feb 26, 2025
90bab88
Add user test
mjsprengers Feb 26, 2025
ed13417
Merge branch 'Blazebit:main' into main
mjsprengers Feb 27, 2025
3daf153
Merge branch 'refs/heads/main' into extend_gitlab_models
mjsprengers Feb 27, 2025
a710330
switch to jackson
mjsprengers Mar 2, 2025
573e271
fetch gitlab users based on project and group membership of the user …
mjsprengers Mar 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions connector/gitlab/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ dependencies {
api project(':blaze-query-core-api')
api project(':blaze-query-connector-base')
api libs.gitlab4j.api
api libs.jackson.annotations
api libs.jackson.databind
testImplementation project(':blaze-query-core-impl')
testImplementation libs.junit.jupiter
testImplementation libs.assertj.core
}

description = 'blaze-query-connector-gitlab'
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright Blazebit
*/
package com.blazebit.query.connector.gitlab;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
* @author Martijn Sprengers
* @since 1.0.4
*/
public record GitlabBranchRule(
String id,
String name,
Boolean isDefault,
Boolean isProtected,
Boolean allowForcePush,
Boolean codeOwnerApprovalRequired
) {
private static final ObjectMapper MAPPER = new ObjectMapper();

public static GitlabBranchRule fromJson(String jsonString) {
try {
JsonNode json = MAPPER.readTree(jsonString);
JsonNode branchProtection = json.path("branchProtection");

return new GitlabBranchRule(
json.get("id").asText(),
json.get("name").asText(),
json.path("isDefault").asBoolean(false),
json.path("isProtected").asBoolean(false),
branchProtection.path("allowForcePush").asBoolean(false),
branchProtection.path("codeOwnerApprovalRequired").asBoolean(false)
);
} catch (Exception e) {
throw new RuntimeException("Error parsing JSON for GitlabBranchRule", e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ public final class GitlabConnectorConfig {
*/
public static final DataFetcherConfig<GitLabApi> GITLAB_API = DataFetcherConfig.forPropertyName( "gitlabApi" );

/**
* Specifies the {@link GitlabGraphQlClient} to use for querying data.
*/
public static final DataFetcherConfig<GitlabGraphQlClient> GITLAB_GRAPHQL_CLIENT =
DataFetcherConfig.forPropertyName("gitlabGraphQLClient");

private GitlabConnectorConfig() {
}
}
Loading