feat(web,ui): per-project forced git provider and settings gating
Adds a per-project forced provider (github|gitlab|gitea) on top of the per-project API base URL overrides: stored under gitProviders.provider in projects/<projectId>.json, sanitized server-side, and winning over remote-host detection both in useGitProvider and in server repo resolution (parseGitLabRemoteUrl/parseGiteaRemoteUrl accept any host when the provider is forced). The Projects settings page replaces the three always-visible URL fields with a provider selector (auto-detect + the three forges) and one URL override for the active provider. Global provider override fields on the GitHub/GitLab/Gitea settings tabs now render only once an account is connected, and Settings search availability matches that gating. Also fixes the useConfigStore/useDirectoryStore circular-import TDZ in the bundled chunk via the window-registered store handle and defers the directory subscription to a microtask; fixes the Gitea PR merge payload (Do carries the merge-style string enum, not a boolean + MergeMethod); and adds a documented Gitea client live-test harness (scripts/gitea-live-test.ts + client.d.ts).
This commit is contained in:
@@ -889,7 +889,7 @@ describe('Gitea data routes', () => {
|
||||
expect(response.body).toEqual({ error: 'Pull request not found' });
|
||||
});
|
||||
|
||||
test('pr/merge POSTs Do/MergeMethod and reports merged:true', async () => {
|
||||
test('pr/merge POSTs the merge style in Do and reports merged:true', async () => {
|
||||
const fetchMock = scriptedFetch([
|
||||
(url, options) => {
|
||||
if (matches(/\/pulls\/12\/merge$/)(url) && options.method === 'POST') {
|
||||
@@ -908,10 +908,10 @@ describe('Gitea data routes', () => {
|
||||
expect(response.body).toEqual({ connected: true, merged: true });
|
||||
const [, options] = fetchMock.mock.calls[0];
|
||||
expect(options.method).toBe('POST');
|
||||
expect(JSON.parse(options.body)).toEqual({ Do: true, MergeMethod: 'merge' });
|
||||
expect(JSON.parse(options.body)).toEqual({ Do: 'merge' });
|
||||
});
|
||||
|
||||
test('pr/merge maps the method to MergeMethod', async () => {
|
||||
test('pr/merge maps the method to Do', async () => {
|
||||
const fetchMock = scriptedFetch([
|
||||
(url, options) => {
|
||||
if (matches(/\/pulls\/12\/merge$/)(url) && options.method === 'POST') {
|
||||
@@ -927,7 +927,7 @@ describe('Gitea data routes', () => {
|
||||
.send({ directory: '/tmp/work', number: 12, method: 'squash' });
|
||||
|
||||
const [, options] = fetchMock.mock.calls[0];
|
||||
expect(JSON.parse(options.body)).toEqual({ Do: true, MergeMethod: 'squash' });
|
||||
expect(JSON.parse(options.body)).toEqual({ Do: 'squash' });
|
||||
});
|
||||
|
||||
test('pr/merge passes through a Gitea merge rejection as merged:false', async () => {
|
||||
|
||||
Reference in New Issue
Block a user