Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ follows [Semantic Versioning](https://semver.org/).

## [Unreleased]

### Added (Source profile data — `feature/145-source-profile`, #145)
- `GET .../integrations/{connectionId}/jira/projects` returns each project's `description` and `GET .../code/github/repositories` each repository's `language`, so the create-project wizard can fill the project's profile from the chosen sources.

### Changed (Jira sites — `feature/143-jira-multi-site`, #143)
- An organization can connect several Jira sites, like GitHub accounts. The same site twice (by its normalized URL) is still refused with `409 INTEGRATION_ALREADY_CONNECTED`; disconnecting one site leaves the others. Tenant migration `V20261012133000` replaces the unique index per organization and provider with one per organization, provider and site. A project's single push target is unchanged.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ record Installation(long id, String accountLogin, String accountType, @Nullable
}

record AppRepository(String owner, String name, String defaultBranch, String htmlUrl, boolean isPrivate,
@Nullable String description, @Nullable Instant pushedAt) {
@Nullable String description, @Nullable Instant pushedAt,
@Nullable String language) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ public List<AppRepository> repositories(long installationId) {
repo.path("html_url").asString(props.webUrl + "/" + owner + "/" + name),
repo.path("private").asBoolean(false),
text(repo.path("description")),
instant(repo.path("pushed_at"))));
instant(repo.path("pushed_at")),
text(repo.path("language"))));
}
if (items.size() < PAGE_SIZE) break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public record GitHubRepositoryResponse(
@JsonProperty("private") @Schema(name = "private") boolean isPrivate,
@Schema(nullable = true) @Nullable String description,
@Schema(nullable = true) @Nullable Instant pushedAt,
@Schema(description = "Main language GitHub reports for it", example = "Java", nullable = true)
@Nullable String language,
@Schema(description = "Whether the project already reads it") boolean connected
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public static GitHubRepositoryResponse toResponse(AvailableRepository available)
var repo = available.repository();
return new GitHubRepositoryResponse(available.installationId(), repo.owner(), repo.name(),
repo.owner() + "/" + repo.name(), repo.defaultBranch(), repo.htmlUrl(), repo.isPrivate(),
repo.description(), repo.pushedAt(), available.connected());
repo.description(), repo.pushedAt(), repo.language(), available.connected());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static ProviderCredentials oauth(String siteUrl, String cloudId, String a
}

/** A remote project ({key,name}). */
record RemoteProject(String key, String name) {}
record RemoteProject(String key, String name, @Nullable String description) {}

/** A remote issue type ({id,name}). */
record RemoteIssueType(String id, String name) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.kntro.reqsai.gateway.infrastructure.jira;

import org.jspecify.annotations.Nullable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down Expand Up @@ -97,7 +98,7 @@ public String verify(JiraApiContext ctx) {
/** GET /project/search → visible projects. */
public List<JiraProject> listProjects(JiraApiContext ctx) {
ProjectSearch search = exchange(() -> restClient.get()
.uri(ctx.apiBase() + "/project/search?maxResults=100")
.uri(ctx.apiBase() + "/project/search?expand=description&maxResults=100")
.header("Authorization", ctx.authHeader())
.accept(MediaType.APPLICATION_JSON)
.retrieve()
Expand Down Expand Up @@ -358,7 +359,7 @@ private <T> T exchange(java.util.function.Supplier<T> call, String op) {
private record Myself(String displayName) {}

@JsonIgnoreProperties(ignoreUnknown = true)
public record JiraProject(String key, String name) {}
public record JiraProject(String key, String name, @Nullable String description) {}

@JsonIgnoreProperties(ignoreUnknown = true)
private record ProjectSearch(List<JiraProject> values) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public String verify(ProviderCredentials c) {
@Override
public List<RemoteProject> listProjects(ProviderCredentials c) {
return jira.listProjects(contextFor(c)).stream()
.map(p -> new RemoteProject(p.key(), p.name()))
.map(p -> new RemoteProject(p.key(), p.name(), p.description()))
.toList();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.kntro.reqsai.gateway.interfaces.rest.dto.response;

import io.swagger.v3.oas.annotations.media.Schema;
import org.jspecify.annotations.Nullable;

/** A selectable Jira project. */
@Schema(description = "A Jira project visible to the connection")
public record JiraProjectResponse(String key, String name) {}
public record JiraProjectResponse(String key, String name, @Nullable String description) {}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static ConnectionTestResponse toResponse(ConnectionTestResult r) {
}

public static JiraProjectResponse toResponse(RemoteProject p) {
return new JiraProjectResponse(p.key(), p.name());
return new JiraProjectResponse(p.key(), p.name(), p.description());
}

public static JiraIssueTypeResponse toResponse(RemoteIssueType t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public String verify(JiraApiContext ctx) {
@Override
public List<JiraProject> listProjects(JiraApiContext ctx) {
apiBases.add(ctx.apiBase());
return List.of(new JiraProject("PAY", "Payments"));
return List.of(new JiraProject("PAY", "Payments", "Pagos y cobros"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public String verify(ProviderCredentials credentials) {

@Override
public List<RemoteProject> listProjects(ProviderCredentials credentials) {
return List.of(new RemoteProject("PAY", "Payments"));
return List.of(new RemoteProject("PAY", "Payments", "Pagos y cobros"));
}

@Override
Expand Down
Loading