Skip to content
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

feat(webserver): support gitlab integration with automatic repository sync #1965

Merged
merged 9 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 129 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions ee/tabby-db/migrations/0028_gitlab-provider.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP TABLE gitlab_provided_repositories;
DROP TABLE gitlab_repository_provider;

19 changes: 19 additions & 0 deletions ee/tabby-db/migrations/0028_gitlab-provider.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CREATE TABLE gitlab_repository_provider(
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
display_name TEXT NOT NULL,
access_token TEXT
boxbeam marked this conversation as resolved.
Show resolved Hide resolved
);

CREATE TABLE gitlab_provided_repositories(
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
gitlab_repository_provider_id INTEGER NOT NULL,
-- vendor_id from https://docs.gitlab.com/ee/api/repositories.html
vendor_id TEXT NOT NULL,
name TEXT NOT NULL,
git_url TEXT NOT NULL,
active BOOLEAN NOT NULL DEFAULT FALSE,
updated_at TIMESTAMP NOT NULL DEFAULT (DATETIME('now')),
FOREIGN KEY (gitlab_repository_provider_id) REFERENCES gitlab_repository_provider(id) ON DELETE CASCADE,
CONSTRAINT `idx_vendor_id_provider_id` UNIQUE (vendor_id, gitlab_repository_provider_id)
);
CREATE INDEX gitlab_provided_repositories_updated_at ON gitlab_provided_repositories(updated_at);
Binary file modified ee/tabby-db/schema.sqlite
Binary file not shown.
20 changes: 20 additions & 0 deletions ee/tabby-db/schema/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,23 @@ CREATE TABLE github_repository_provider(
display_name TEXT NOT NULL,
access_token TEXT
);
CREATE TABLE gitlab_repository_provider(
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
display_name TEXT NOT NULL,
access_token TEXT
);
CREATE TABLE gitlab_provided_repositories(
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
gitlab_repository_provider_id INTEGER NOT NULL,
-- vendor_id from https://docs.gitlab.com/ee/api/repositories.html
vendor_id TEXT NOT NULL,
name TEXT NOT NULL,
git_url TEXT NOT NULL,
active BOOLEAN NOT NULL DEFAULT FALSE,
updated_at TIMESTAMP NOT NULL DEFAULT(DATETIME('now')),
FOREIGN KEY(gitlab_repository_provider_id) REFERENCES gitlab_repository_provider(id) ON DELETE CASCADE,
CONSTRAINT `idx_vendor_id_provider_id` UNIQUE(vendor_id, gitlab_repository_provider_id)
);
CREATE INDEX gitlab_provided_repositories_updated_at ON gitlab_provided_repositories(
updated_at
);
Loading
Loading