Skip to content

git settings: Add gitlab project settings + export type#12232

Merged
estib-vega merged 2 commits intomasterfrom
use-but-gitlab
Feb 5, 2026
Merged

git settings: Add gitlab project settings + export type#12232
estib-vega merged 2 commits intomasterfrom
use-but-gitlab

Conversation

@estib-vega
Copy link
Contributor

@estib-vega estib-vega commented Feb 5, 2026

  • Add the GitLab project and upstream project IDs to the git settings
  • Export the git config type and use it in the git config service

@vercel
Copy link

vercel bot commented Feb 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
gitbutler-web Ignored Ignored Preview Feb 5, 2026 4:04pm

Request Review

@github-actions github-actions bot added rust Pull requests that update Rust code @gitbutler/desktop labels Feb 5, 2026
@estib-vega estib-vega marked this pull request as ready for review February 5, 2026 12:22
Copilot AI review requested due to automatic review settings February 5, 2026 12:23
Copy link
Contributor

Copilot AI left a comment

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 adds GitLab project ID settings to the git configuration system to support GitLab-specific features. The changes introduce two new configuration fields: gitbutler_gitlab_project_id and gitbutler_gitlab_upstream_project_id.

Changes:

  • Added two new GitLab project ID fields to the git config settings (project ID and upstream project ID)
  • Replaced the TypeScript GbConfig class with the auto-generated GitConfigSettings type from Rust
  • Exported the GitConfigSettings type for use across the application

Reviewed changes

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

Show a summary per file
File Description
packages/core/src/generated/settings/gitConfigSettings.ts New auto-generated TypeScript type with GitLab fields added
packages/core/src/generated/index.ts Exports the new GitConfigSettings type
crates/but-core/tests/core/settings.rs Updated tests to include new GitLab fields
crates/but-core/src/settings.rs Added constants, struct fields, and initialization for GitLab project IDs with TypeScript export annotations
apps/desktop/src/lib/config/gitConfigService.ts Replaced GbConfig class with imported GitConfigSettings type, updated method signatures
apps/desktop/src/lib/ai/service.test.ts Updated test mock to use GitConfigSettings type
Cargo.lock Minor version bump of thiserror dependency (2.0.17 → 2.0.18)

- Add the project and upstream project IDs to the git settings
- Export the git config type and use it in the git config service
Copy link
Contributor

Copilot AI left a comment

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 4 out of 7 changed files in this pull request and generated no new comments.

@Byron Byron self-assigned this Feb 5, 2026
I think it's fine to now allow users to provide unreasonable values for
it, to save us some trouble with `ts-rs`.

Maybe this way we can prevent unnecessary spread of `BStringForFrontend`
which clearly is a crutch.
Copy link
Collaborator

@Byron Byron left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

I added a refactor on top which simplifies the type we store for Gitlab project ids to match what it's storing. That way, everything gets a lot simpler and we don't just proliferate the crutch that is BStringForFrontend.

And seeing these ugly annotations, I was hoping that maybe there is some central place to teach ts-rs basic type mappings, on a project level. So from that point of you, these cfg_attr annotations do exactly what they are supposed to - make us think of ways to have less of them 😁.

In any case, good to go.

#[serde(rename = "signCommits")]
pub gitbutler_sign_commits: Option<bool>,
pub gitbutler_gerrit_mode: Option<bool>,
#[cfg_attr(feature = "export-ts", ts(type = "string | null"))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

While having seen that before, it's strange to me that ts-rs won't do this automatically. Are we sure it' can't turn an option into null - that should be the point of it.

Edit: I think I understand now that the problem is not the Option, the problem is the BStringForFrontend. It would be nice if there was a way to configure ts-rs more centrally, and configure it once.

@estib-vega
Copy link
Contributor Author

Thanks @Byron!
Noted, I'll look into configuring it somewhere similar to the things we have for serde.

@estib-vega estib-vega enabled auto-merge February 5, 2026 16:10
@estib-vega estib-vega merged commit 91a6078 into master Feb 5, 2026
25 checks passed
@estib-vega estib-vega deleted the use-but-gitlab branch February 5, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@gitbutler/desktop rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants