diff --git a/frontend b/frontend index 62359446..22dd7983 160000 --- a/frontend +++ b/frontend @@ -1 +1 @@ -Subproject commit 62359446f44e5554753f257064ccada85aad24c0 +Subproject commit 22dd7983775a38603572df778cceeba39b5d094d diff --git a/java-ecosystem/services/pipeline-agent/src/main/java/org/rostilos/codecrow/pipelineagent/gitlab/service/GitLabAiClientService.java b/java-ecosystem/services/pipeline-agent/src/main/java/org/rostilos/codecrow/pipelineagent/gitlab/service/GitLabAiClientService.java index bafa3499..b6747af9 100644 --- a/java-ecosystem/services/pipeline-agent/src/main/java/org/rostilos/codecrow/pipelineagent/gitlab/service/GitLabAiClientService.java +++ b/java-ecosystem/services/pipeline-agent/src/main/java/org/rostilos/codecrow/pipelineagent/gitlab/service/GitLabAiClientService.java @@ -295,7 +295,8 @@ private void addVcsCredentials(AiAnalysisRequestImpl.Builder builder, VcsConn if (connection.getConnectionType() == EVcsConnectionType.APPLICATION && connection.getAccessToken() != null) { String accessToken = tokenEncryptionService.decrypt(connection.getAccessToken()); builder.withAccessToken(accessToken); - } else if (connection.getConnectionType() == EVcsConnectionType.PERSONAL_TOKEN && + } else if ((connection.getConnectionType() == EVcsConnectionType.PERSONAL_TOKEN || + connection.getConnectionType() == EVcsConnectionType.REPOSITORY_TOKEN) && connection.getConfiguration() instanceof GitLabConfig config) { builder.withAccessToken(config.accessToken()); } else { diff --git a/java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/integration/service/VcsIntegrationService.java b/java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/integration/service/VcsIntegrationService.java index 7491cc2c..cd945e70 100644 --- a/java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/integration/service/VcsIntegrationService.java +++ b/java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/integration/service/VcsIntegrationService.java @@ -948,7 +948,22 @@ public RepoOnboardResponse onboardRepository(Long workspaceId, EVcsProvider prov boolean webhooksConfigured = false; if (request.isSetupWebhooks()) { try { - webhooksConfigured = setupWebhooks(client, externalWorkspaceId, repo.slug(), binding, project); + // For REPOSITORY_TOKEN connections, use the full repo path for webhook setup + String webhookWorkspaceId = externalWorkspaceId; + String webhookRepoSlug = repo.slug(); + if (connection.getConnectionType() == EVcsConnectionType.REPOSITORY_TOKEN + && connection.getRepositoryPath() != null + && !connection.getRepositoryPath().isBlank()) { + String repositoryPath = connection.getRepositoryPath(); + int lastSlash = repositoryPath.lastIndexOf('/'); + if (lastSlash > 0) { + webhookWorkspaceId = repositoryPath.substring(0, lastSlash); + webhookRepoSlug = repositoryPath.substring(lastSlash + 1); + } + log.debug("REPOSITORY_TOKEN webhook setup - using repositoryPath: {}, namespace: {}, slug: {}", + repositoryPath, webhookWorkspaceId, webhookRepoSlug); + } + webhooksConfigured = setupWebhooks(client, webhookWorkspaceId, webhookRepoSlug, binding, project); } catch (Exception e) { log.warn("Failed to setup webhooks for {}: {}", repo.fullName(), e.getMessage()); }