[] = [
+ {
+ // add user
+ fn: (previous: BitbucketConnectionConfig) => ({
+ ...previous,
+ user: previous.user ?? "username"
+ }),
+ name: "Add username",
+ selectionText: "username",
+ description: (
+
+ Username to use for authentication. This is only required if you're using an App Password (stored in token
) for authentication.
+
+ )
+ },
+ {
+ fn: (previous: BitbucketConnectionConfig) => ({
+ ...previous,
+ workspaces: [
+ ...(previous.workspaces ?? []),
+ "myWorkspace"
+ ]
+ }),
+ name: "Add a workspace",
+ selectionText: "myWorkspace",
+ description: (
+
+ Add a workspace to sync with. Ensure the workspace is visible to the provided token
(if any).
+
+ )
+ },
+ {
+ fn: (previous: BitbucketConnectionConfig) => ({
+ ...previous,
+ repos: [
+ ...(previous.repos ?? []),
+ "myWorkspace/myRepo"
+ ]
+ }),
+ name: "Add a repo",
+ selectionText: "myWorkspace/myRepo",
+ description: (
+
+ Add an individual repository to sync with. Ensure the repository is visible to the provided token
(if any).
+
+ )
+ },
+ {
+ fn: (previous: BitbucketConnectionConfig) => ({
+ ...previous,
+ projects: [
+ ...(previous.projects ?? []),
+ "myProject"
+ ]
+ }),
+ name: "Add a project",
+ selectionText: "myProject",
+ description: (
+
+ Add a project to sync with. Ensure the project is visible to the provided token
(if any).
+
+ )
+ },
+ {
+ fn: (previous: BitbucketConnectionConfig) => ({
+ ...previous,
+ exclude: {
+ ...previous.exclude,
+ repos: [...(previous.exclude?.repos ?? []), "myWorkspace/myExcludedRepo"]
+ }
+ }),
+ name: "Exclude a repo",
+ selectionText: "myWorkspace/myExcludedRepo",
+ description: (
+
+ Exclude a repository from syncing. Glob patterns are supported.
+
+ )
+ },
+ // exclude forked
+ {
+ fn: (previous: BitbucketConnectionConfig) => ({
+ ...previous,
+ exclude: {
+ ...previous.exclude,
+ forks: true
+ }
+ }),
+ name: "Exclude forked repos",
+ description: Exclude forked repositories from syncing.
+ }
+]
+
+export const bitbucketDataCenterQuickActions: QuickAction[] = [
+ {
+ fn: (previous: BitbucketConnectionConfig) => ({
+ ...previous,
+ url: previous.url ?? "https://bitbucket.example.com",
+ }),
+ name: "Set url to Bitbucket DC instance",
+ selectionText: "https://bitbucket.example.com",
+ },
+ {
+ fn: (previous: BitbucketConnectionConfig) => ({
+ ...previous,
+ repos: [
+ ...(previous.repos ?? []),
+ "myProject/myRepo"
+ ]
+ }),
+ name: "Add a repo",
+ selectionText: "myProject/myRepo",
+ description: (
+
+
Add a individual repository to sync with. Ensure the repository is visible to the provided token
(if any).
+
Examples:
+
+ {[
+ "PROJ/repo-name",
+ "MYPROJ/api"
+ ].map((repo) => (
+ {repo}
+ ))}
+
+
+ )
+ },
+ {
+ fn: (previous: BitbucketConnectionConfig) => ({
+ ...previous,
+ projects: [
+ ...(previous.projects ?? []),
+ "myProject"
+ ]
+ }),
+ name: "Add a project",
+ selectionText: "myProject",
+ description: (
+
+ Add a project to sync with. Ensure the project is visible to the provided token
(if any).
+
+ )
+ },
+ {
+ fn: (previous: BitbucketConnectionConfig) => ({
+ ...previous,
+ exclude: {
+ ...previous.exclude,
+ repos: [...(previous.exclude?.repos ?? []), "myProject/myExcludedRepo"]
+ }
+ }),
+ name: "Exclude a repo",
+ selectionText: "myProject/myExcludedRepo",
+ description: (
+
+
Exclude a repository from syncing. Glob patterns are supported.
+
Examples:
+
+ {[
+ "myProject/myExcludedRepo",
+ "myProject2/*"
+ ].map((repo) => (
+ {repo}
+ ))}
+
+
+ )
+ },
+ // exclude archived
+ {
+ fn: (previous: BitbucketConnectionConfig) => ({
+ ...previous,
+ exclude: {
+ ...previous.exclude,
+ archived: true
+ }
+ }),
+ name: "Exclude archived repos",
+ },
+ // exclude forked
+ {
+ fn: (previous: BitbucketConnectionConfig) => ({
+ ...previous,
+ exclude: {
+ ...previous.exclude,
+ forks: true
+ }
+ }),
+ name: "Exclude forked repos",
+ }
+]
+
diff --git a/packages/web/src/app/[domain]/onboard/components/connectCodeHost.tsx b/packages/web/src/app/[domain]/onboard/components/connectCodeHost.tsx
index dc0f4589..00fecdb0 100644
--- a/packages/web/src/app/[domain]/onboard/components/connectCodeHost.tsx
+++ b/packages/web/src/app/[domain]/onboard/components/connectCodeHost.tsx
@@ -7,7 +7,9 @@ import {
GitHubConnectionCreationForm,
GitLabConnectionCreationForm,
GiteaConnectionCreationForm,
- GerritConnectionCreationForm
+ GerritConnectionCreationForm,
+ BitbucketCloudConnectionCreationForm,
+ BitbucketDataCenterConnectionCreationForm
} from "@/app/[domain]/components/connectionCreationForms";
import { useRouter } from "next/navigation";
import { useCallback } from "react";
@@ -79,6 +81,24 @@ export const ConnectCodeHost = ({ nextStep, securityCardEnabled }: ConnectCodeHo
)
}
+ if (selectedCodeHost === "bitbucket-cloud") {
+ return (
+ <>
+
+
+ >
+ )
+ }
+
+ if (selectedCodeHost === "bitbucket-server") {
+ return (
+ <>
+
+
+ >
+ )
+ }
+
return null;
}
@@ -90,7 +110,7 @@ const CodeHostSelection = ({ onSelect }: CodeHostSelectionProps) => {
const captureEvent = useCaptureEvent();
return (
-
+
{
captureEvent("wa_onboard_gitlab_selected", {});
}}
/>
+ {
+ onSelect("bitbucket-cloud");
+ captureEvent("wa_onboard_bitbucket_cloud_selected", {});
+ }}
+ />
+ {
+ onSelect("bitbucket-server");
+ captureEvent("wa_onboard_bitbucket_server_selected", {});
+ }}
+ />