Skip to content

Commit ed63abe

Browse files
chetan-rnswtam2018
andauthored
fix: update default ref from main to HEAD (#16)
GitHub updated it's default branch from master to main. But GitLab is still using master, due to which the GitOps UI APIs were failing for a GitLab repository. This PP updates the default ref to HEAD. Signed-off-by: Chetan Banavikalmutt <[email protected]> Co-authored-by: William Tam <[email protected]>
1 parent ba73ea3 commit ed63abe

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/httpapi/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var DefaultSecretRef = types.NamespacedName{
2424
Namespace: "pipelines-app-delivery",
2525
}
2626

27-
const defaultRef = "main"
27+
const defaultRef = "HEAD"
2828

2929
// APIRouter is an HTTP API for accessing app configurations.
3030
type APIRouter struct {

pkg/httpapi/api_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const (
2727

2828
func TestGetPipelines(t *testing.T) {
2929
ts, c := makeServer(t)
30-
c.addContents("example/gitops", "pipelines.yaml", "main", "testdata/pipelines.yaml")
30+
c.addContents("example/gitops", "pipelines.yaml", "HEAD", "testdata/pipelines.yaml")
3131
pipelinesURL := "https://github.com/example/gitops.git"
3232

3333
req := makeClientRequest(t, "Bearer testing", fmt.Sprintf("%s/pipelines?url=%s", ts.URL, pipelinesURL))
@@ -115,7 +115,7 @@ func TestGetPipelinesWithNamespaceAndNameInURL(t *testing.T) {
115115
ts, c := makeServer(t, func(a *APIRouter) {
116116
a.secretGetter = sg
117117
})
118-
c.addContents("example/gitops", "pipelines.yaml", "main", "testdata/pipelines.yaml")
118+
c.addContents("example/gitops", "pipelines.yaml", "HEAD", "testdata/pipelines.yaml")
119119
pipelinesURL := "https://github.com/example/gitops.git"
120120
options := url.Values{
121121
"url": []string{pipelinesURL},
@@ -173,7 +173,7 @@ func TestGetPipelineApplication(t *testing.T) {
173173
ts, c := makeServer(t, func(a *APIRouter) {
174174
a.resourceParser = stubResourceParser(testResource)
175175
})
176-
c.addContents("example/gitops", "pipelines.yaml", "main", "testdata/pipelines.yaml")
176+
c.addContents("example/gitops", "pipelines.yaml", "HEAD", "testdata/pipelines.yaml")
177177
pipelinesURL := "https://github.com/example/gitops.git"
178178
options := url.Values{
179179
"url": []string{pipelinesURL},

0 commit comments

Comments
 (0)