feat(API): Add instance-level Git connection settings (no-changelog) - #36910
Draft
ireneea wants to merge 18 commits into
Draft
feat(API): Add instance-level Git connection settings (no-changelog)#36910ireneea wants to merge 18 commits into
ireneea wants to merge 18 commits into
Conversation
Add a settings-backed singleton instance Git connection in the git-connections module, stored under the features.gitConnections.instance settings key. Same shape as a project connection minus name, plus an enabled toggle, with inline encrypted secrets. Expose it via GET/PUT /instance-git-settings (public API) and git-connections instance get/set (CLI). Enabling requires a fully valid configuration; disabling retains the config. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ettings DTO (no-changelog) Export repositoryUrlSchema and branchNameSchema from git-connections.dto instead of re-declaring them, and drop a stray blank line in the CLI client. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…test (no-changelog) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…nstance services (no-changelog) Extract applyAuthenticationUpdate and validateHttpsCredentials into git-connections-auth.utils.ts. Both services now delegate to it, and the entity create path reuses the update path with an empty starting state. Also validate the target URL and branch before applying auth in the instance service, so invalid input fails fast instead of generating a throwaway SSH key pair. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ngelog) - Reject a repository URL when no connection type is set, so an unvalidated (and unusable) URL is never persisted. - Persist the singleton via an atomic upsert to avoid a primary-key race on concurrent first writes, and raise OperationalError (not UnexpectedError) on a failed write. - Share the auth deps adapter between the project and instance services via a gitAuthDeps factory. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
PR review overviewBased on ownership of the 22 changed files in this PR:
|
Bundle ReportChanges will increase total bundle size by 17.64kB (0.03%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: editor-ui-esmAssets Changed:
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
… settings DTOs (no-changelog) Compose the instance Git settings DTOs from the connection DTOs instead of restating their fields: extract a shared optional-fields shape for the update DTOs, and derive the instance public schema from the connection public schema via omit/extend. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ireneea
force-pushed
the
ligo-1020-support-instance-git-connection
branch
from
August 24, 2026 10:56
769c9a9 to
247d0d7
Compare
…references (no-changelog) Compose InstanceGitConnectionPreferences from the shared GitAuthMaterial type and seed its defaults from emptyGitAuthMaterial(), removing the duplicated auth field declarations and their default values. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…n (no-changelog) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… in place Convert applyAuthenticationUpdate into computeAuthenticationUpdate, which returns a GitAuthResult with a non-nullable connectionType. Callers apply the result with Object.assign, so the compiler now forbids writing null into the entity's non-nullable connectionType column while still supporting the nullable instance-settings caller. Behavior is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…hangelog) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…no-changelog) Construct the auth deps inline where computeAuthenticationUpdate is called rather than holding them in a field initializer that reads constructor parameter properties. The two-closure object is cheap to build per call and this drops the initialization-order dependency on the compile target. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…gelog) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…on (no-changelog) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…no-changelog) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ngelog) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…on (no-changelog) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds an instance-level Git connection: a settings-backed singleton (mirroring the per-project
GitConnectionshape plus anenabledtoggle) exposed via two public API endpoints,GETandPUT /api/v1/instance-git-settings. The settings default to a disabled, empty connection and are readable before ever being configured; secrets are stored encrypted and never returned. The endpoints are gated behind thegit-connectionsmodule, theGIT_CONNECTIONSlicense feature, andgitConnection:read/gitConnection:updatescopes. This also extracts the shared Git connection auth logic (SSH key generation / HTTPS credential handling) intogit-connections-auth.utils.tsso the project and instance services delegate to one implementation, and addsn8n-cli git-connections instance get/setcommands.How to test
N8N_ENABLED_MODULES=git-connectionsplus a license granting theGIT_CONNECTIONSfeature.gitConnection:read, callGET /api/v1/instance-git-settings— expect a disabled, empty connection.gitConnection:update,PUTa partial body (e.g.repositoryUrl,branchName,connectionType) and confirm the response reflects the update with secrets omitted; enabling requires a fully configured connection, and an empty body is rejected.Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/LIGO-1020
Review / Merge checklist
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)🤖 PR Summary generated by AI