Skip to content

Commit 20074bd

Browse files
committed
feat(scm): add Bitbucket types for SCM provider support
Signed-off-by: Ushira Dineth <[email protected]>
1 parent be6b09b commit 20074bd

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

api/v1alpha1/common_types.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ type GitLab struct {
2828
Domain string `json:"domain,omitempty"`
2929
}
3030

31+
// Bitbucket is a Bitbucket SCM provider configuration. It is used to configure the Bitbucket settings.
32+
type Bitbucket struct{}
33+
3134
// Forgejo is a Forgejo SCM provider configuration. It is used to configure the Forgejo settings.
3235
type Forgejo struct {
3336
// Domain is the Forgejo domain, such as "codeberg.org" or "forgejo.mycompany.com".
@@ -91,6 +94,16 @@ type ForgejoRepo struct {
9194
Name string `json:"name"`
9295
}
9396

97+
// BitbucketRepo is a repository in Bitbucket, identified by its workspace and repository.
98+
type BitbucketRepo struct {
99+
// Workspace is the workspace of the repository.
100+
// +kubebuilder:validation:Required
101+
Workspace string `json:"workspace"`
102+
// Repository is the repository of the repository.
103+
// +kubebuilder:validation:Required
104+
Repository string `json:"repository"`
105+
}
106+
94107
// FakeRepo is a placeholder for a repository in the fake SCM provider, used for testing purposes.
95108
type FakeRepo struct {
96109
// Owner is the owner of the repository.

api/v1alpha1/gitrepository_types.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ import (
2424
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
2525

2626
// GitRepositorySpec defines the desired state of GitRepository
27-
// +kubebuilder:validation:ExactlyOneOf=github;gitlab;forgejo;fake
27+
// +kubebuilder:validation:ExactlyOneOf=github;gitlab;forgejo;bitbucket;fake
2828
type GitRepositorySpec struct {
29-
GitHub *GitHubRepo `json:"github,omitempty"`
30-
GitLab *GitLabRepo `json:"gitlab,omitempty"`
31-
Forgejo *ForgejoRepo `json:"forgejo,omitempty"`
32-
Fake *FakeRepo `json:"fake,omitempty"`
29+
GitHub *GitHubRepo `json:"github,omitempty"`
30+
GitLab *GitLabRepo `json:"gitlab,omitempty"`
31+
Forgejo *ForgejoRepo `json:"forgejo,omitempty"`
32+
Bitbucket *BitbucketRepo `json:"bitbucket,omitempty"`
33+
Fake *FakeRepo `json:"fake,omitempty"`
3334
// +kubebuilder:validation:Required
3435
ScmProviderRef ScmProviderObjectReference `json:"scmProviderRef"`
3536
}

api/v1alpha1/scmprovider_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ type ScmProviderSpec struct {
4848
// Forgejo required configuration for Forgejo as the SCM provider
4949
Forgejo *Forgejo `json:"forgejo,omitempty"`
5050

51+
// Bitbucket required configuration for Bitbucket as the SCM provider
52+
Bitbucket *Bitbucket `json:"bitbucket,omitempty"`
53+
5154
// Fake required configuration for Fake as the SCM provider
5255
Fake *Fake `json:"fake,omitempty"`
5356
}

0 commit comments

Comments
 (0)