Skip to content

Conversation

@lorenzo-cavazzi
Copy link
Member

@lorenzo-cavazzi lorenzo-cavazzi commented Nov 6, 2025

Implements the solution for this ShapeUp pitch https://www.notion.so/renku/Make-users-aware-of-need-to-connect-git-integrations-for-code-repositories-27e0df2efafc8087844ac62252ee423e

The PR includes the following changes:

  • Auto-generate the code for the (new) "repository" APIs
  • Show better feedback for the code repositories' status
  • Show a blocking modal on session start whenever repos are unavailable (all users) or when integrations might add push permissions (project owners/editors)

There will be a follow-up to let users connect in-place instead of redirecting to the Integrations page.

Screenshot_20251121_142828 image image

/deploy renku-data-services=eikek/build/integration-improvements renku=build/code-integrations extra-values=enableInternalGitlab=false

@RenkuBot
Copy link
Contributor

RenkuBot commented Nov 6, 2025

You can access the deployment of this PR at https://renku-ci-ui-3900.dev.renku.ch

@lorenzo-cavazzi lorenzo-cavazzi force-pushed the lorenzo/code-intergations branch 2 times, most recently from e46de6b to b29be88 Compare November 11, 2025 10:52
@lorenzo-cavazzi lorenzo-cavazzi force-pushed the lorenzo/code-intergations branch from 3d912ed to 410a2e3 Compare November 19, 2025 15:33
* Generate repository APIs code automatically
* Show better feedback on code repositories' status
* Block session start for unavailable or unaccessible repos
@lorenzo-cavazzi lorenzo-cavazzi force-pushed the lorenzo/code-intergations branch from c114938 to 18f84b8 Compare November 21, 2025 13:51
@lorenzo-cavazzi lorenzo-cavazzi marked this pull request as ready for review November 21, 2025 14:07
@lorenzo-cavazzi lorenzo-cavazzi requested a review from a team as a code owner November 21, 2025 14:07
@leafty
Copy link
Member

leafty commented Nov 24, 2025

Note: labelling as "do-not-merge" until the backend has been reviewed and merged.

Comment on lines +462 to +465
export function RepositoryPermissionsBadge({
hasWriteAccess,
repositoryUrl,
}: RepositoryPermissionsProps) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of recomputing the conditions twice (badgeColor and badgeText), compute the condition once and based on the result assign the color and the text. The logic in this component is written twice which means it will be very easy to make a mistake when updating the logic.

<h3>Repository</h3>
<p>
URL:{" "}
<a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use an existing external link component here?

<a
target="_blank"
rel="noreferrer noopener"
href="mailto:[email protected]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The email needs to be taken from helm values. We need to stop hard-coding [email protected] in our UI code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also update the generate-api and update-api targets.


export function getRepositoryName(repositoryURL: string): string {
const canonicalUrlStr = `${repositoryURL.replace(/.git$/i, "")}`;
const canonicalUrlStr = `${repositoryURL.replace(/(?:\.git|\/)$/i, "")}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const canonicalUrlStr = `${repositoryURL.replace(/(?:\.git|\/)$/i, "")}`;
const canonicalUrlStr = `${repositoryURL.replace(/[/]$/, "").replace(/[.]git$/i, "")}`;

This correctly handles repo.git, repo.git/ and repo/.

url: string;
};

const withResponseRewrite = repositoriesGeneratedApi.injectEndpoints({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad practice: do not tamper with API responses, only perform simple data manipulations in the API code.

You can use shouldInterrupt() when it is needed and where it is needed after getting the API data.

Comment on lines +80 to +90
const interruptAlways = !!(
!repositoryData?.metadata?.pull_permission &&
!(repositoryData?.connection?.status === "connected")
);
const interruptOwner = !!(
(!repositoryData?.metadata?.pull_permission &&
!(repositoryData?.connection?.status === "connected")) ||
(repositoryData?.metadata?.pull_permission &&
!repositoryData?.metadata?.push_permission &&
!(repositoryData?.connection?.status === "connected"))
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to do this, you can have a hasProjectWritePermission in the arguments and return only the needed data.

Copy link
Member

@leafty leafty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to post this recording: the offcanvas get triggered when clicking the for label or selecting the input:

Screen.Recording.2025-11-26.at.09.32.44.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants