-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add kilo for slack gitlab support #559
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
Merged
RSO
merged 6 commits into
Kilo-Org:main
from
dennismeister93:feat/add-kilo-for-slack-gitlab-support
Feb 27, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1df4247
feat: add kilo for slack gitlab support
dennismeister93 f03fa7b
chore: review findings
dennismeister93 7e04aa3
fix: make it work again after rebase
dennismeister93 a31b3e7
chore: remove not needed changes
dennismeister93 cf431b0
Revert unrelated changes
RSO 48825ca
Merge branch 'main' into feat/add-kilo-for-slack-gitlab-support
RSO File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| import { | ||
| formatGitLabRepositoriesForPrompt, | ||
| type GitLabRepositoryContext, | ||
| } from './gitlab-repository-context'; | ||
|
|
||
| describe('formatGitLabRepositoriesForPrompt', () => { | ||
| test('shows account, instance, and repository list when repos are available', () => { | ||
| const context: GitLabRepositoryContext = { | ||
| accountLogin: 'gitlab-user', | ||
| repositoryAccess: 'selected', | ||
| repositoriesSyncedAt: '2024-01-15T10:00:00Z', | ||
| instanceUrl: 'https://gitlab.com', | ||
| repositories: [ | ||
| { id: 1, name: 'project-a', full_name: 'mygroup/project-a', private: false }, | ||
| { id: 2, name: 'project-b', full_name: 'mygroup/subgroup/project-b', private: true }, | ||
| ], | ||
| }; | ||
|
|
||
| const result = formatGitLabRepositoriesForPrompt(context); | ||
|
|
||
| expect(result).toContain('GitLab repository context'); | ||
| expect(result).toContain('Account: gitlab-user'); | ||
| expect(result).toContain('Instance: gitlab.com'); | ||
| expect(result).toContain('Repository access: selected'); | ||
| expect(result).toContain('Repositories synced at: 2024-01-15T10:00:00Z'); | ||
| expect(result).toContain('mygroup/project-a [id: 1]'); | ||
| expect(result).toContain('mygroup/subgroup/project-b (private) [id: 2]'); | ||
| expect(result).toContain('nested groups'); | ||
| }); | ||
|
|
||
| test('shows "all access" message when repositoryAccess is "all" and no repos listed', () => { | ||
| const context: GitLabRepositoryContext = { | ||
| accountLogin: 'gitlab-user', | ||
| repositoryAccess: 'all', | ||
| repositoriesSyncedAt: null, | ||
| instanceUrl: 'https://gitlab.com', | ||
| repositories: [], | ||
| }; | ||
|
|
||
| const result = formatGitLabRepositoriesForPrompt(context); | ||
|
|
||
| expect(result).toContain('not stored for "all" access'); | ||
| expect(result).toContain('group/project format'); | ||
| }); | ||
|
|
||
| test('shows "no repos connected" when no integration repos and access is not "all"', () => { | ||
| const context: GitLabRepositoryContext = { | ||
| accountLogin: null, | ||
| repositoryAccess: null, | ||
| repositoriesSyncedAt: null, | ||
| instanceUrl: null, | ||
| repositories: null, | ||
| }; | ||
|
|
||
| const result = formatGitLabRepositoriesForPrompt(context); | ||
|
|
||
| expect(result).toContain('No GitLab repositories are currently connected'); | ||
| }); | ||
|
|
||
| test('redacts self-hosted instance URL to prevent leaking internal hostnames', () => { | ||
| const context: GitLabRepositoryContext = { | ||
| accountLogin: 'admin', | ||
| repositoryAccess: 'selected', | ||
| repositoriesSyncedAt: null, | ||
| instanceUrl: 'https://gitlab.example.com', | ||
| repositories: [{ id: 10, name: 'internal', full_name: 'team/internal', private: true }], | ||
| }; | ||
|
|
||
| const result = formatGitLabRepositoriesForPrompt(context); | ||
|
|
||
| expect(result).toContain('Instance: self-hosted GitLab'); | ||
| expect(result).not.toContain('gitlab.example.com'); | ||
| expect(result).toContain('team/internal (private) [id: 10]'); | ||
| }); | ||
|
|
||
| test('handles null repositories the same as empty array', () => { | ||
| const contextNull: GitLabRepositoryContext = { | ||
| accountLogin: 'user', | ||
| repositoryAccess: 'selected', | ||
| repositoriesSyncedAt: null, | ||
| instanceUrl: 'https://gitlab.com', | ||
| repositories: null, | ||
| }; | ||
|
|
||
| const contextEmpty: GitLabRepositoryContext = { | ||
| ...contextNull, | ||
| repositories: [], | ||
| }; | ||
|
|
||
| const resultNull = formatGitLabRepositoriesForPrompt(contextNull); | ||
| const resultEmpty = formatGitLabRepositoriesForPrompt(contextEmpty); | ||
|
|
||
| expect(resultNull).toContain('No GitLab repositories are currently connected'); | ||
| expect(resultEmpty).toContain('No GitLab repositories are currently connected'); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.