Skip to content

fix: gitea connectivity#1025

Open
merll wants to merge 22 commits into
mainfrom
APL-1925
Open

fix: gitea connectivity#1025
merll wants to merge 22 commits into
mainfrom
APL-1925

Conversation

@merll

@merll merll commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

This PR includes the following fixes and improvements:

  • fixes retrieval of branches and connectivity tests for the self-hosted Gitea instance
  • fixes retrieval of workload catalog where on self-hosted Gitea instance
  • token authentication without username is supported for third-party repositories
  • SSH authentication has been fixed by setting a required option on the Git client
  • error handling of connectivity tests is improved, reporting the error back to the client (not exposed in Console yet)

The refactored code merges the logic of creating a Git client, making it easier in the future to attach and maintain functionality. The chart retrieval could still use refactoring to support SSH in the future.

Note that SSH code repositories are currently not supported, as the OpenAPI validation rejects them.

# Conflicts:
#	src/otomi-stack.test.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors Git repository connectivity/branch retrieval by centralizing authentication and Git client creation (including support for token-only HTTPS auth), and improves connectivity-test error reporting back to API clients.

Changes:

  • Introduces getAuthenticatedGitClient() to normalize repo URLs and apply SSH/HTTPS auth based on team secrets or internal Gitea credentials.
  • Refactors branch listing and connectivity testing to use the shared auth/client logic and to propagate/return errors more consistently.
  • Updates tests and OpenAPI schema to include an optional message in TestRepoConnect responses.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/utils/codeRepoUtils.ts Adds unified authenticated Git client creation and refactors ref extraction.
src/utils/codeRepoUtils.test.ts Updates unit tests to cover the new auth/client behavior and new error propagation.
src/otomi-stack.ts Switches branch retrieval and connectivity tests to the new shared Git client/auth flow and returns failure messages.
src/otomi-stack.test.ts Adds tests for getRepoBranches() and getTestRepoConnect() using the new helpers and cleanup behavior.
src/openapi/testrepoconnect.yaml Extends response schema with a message field for failure details.
src/git/connect.ts Updates getAuthenticatedUrl() typing and supports token-only auth (no username) by embedding token as the URL “username”.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/utils/codeRepoUtils.ts Outdated
Comment thread src/utils/codeRepoUtils.ts
Comment thread src/utils/codeRepoUtils.ts Outdated
Comment thread src/otomi-stack.ts Outdated
Comment thread src/otomi-stack.ts Outdated
Comment thread src/otomi-stack.ts Outdated
Comment thread src/otomi-stack.ts Outdated
Comment thread src/utils/codeRepoUtils.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Comment thread src/utils/workloadUtils.test.ts
Comment thread src/utils/workloadUtils.test.ts Outdated
Comment thread src/utils/workloadUtils.test.ts Outdated
Comment thread src/otomi-stack.ts
Comment thread src/utils/codeRepoUtils.test.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants