Skip to content
Draft
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
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ on:
push:

jobs:
style-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Format
run: |
if [[ "$(make check_format | wc -l)" -gt 0 ]]; then
exit 1
fi

test:
runs-on: ubuntu-latest
steps:
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PKG_NAME=github.com/SwissDataScienceCenter/renku-gateway

.PHONY: build clean tests format
.PHONY: build clean tests format check_format tidy

build: internal/login/spec.gen.go
go mod download
Expand All @@ -20,3 +20,9 @@ internal/login/spec.gen.go: apispec.yaml

format:
gofmt -l -w cmd internal tools

check_format:
gofmt -l cmd internal tools

tidy:
go mod tidy -e
2 changes: 1 addition & 1 deletion internal/revproxy/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ func TestInternalSvcRoutes(t *testing.T) {
{
Path: "/ui-server/api/data/repositories/https%3A%2F%2Fexample.org%2Fgroup%2Frepo",
Expected: TestResults{
Path: "/api/data/repositories/https%3A%2F%2Fexample.org%2Fgroup%2Frepo",
Path: "/api/data/repositories/https%3A%2F%2Fexample.org%2Fgroup%2Frepo",
VisitedServerIDs: []string{"upstream"},
},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/revproxy/middlewares.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func notebooksAnonymousID(sessions *sessions.SessionStore) echo.MiddlewareFunc {
// NOTE: The anonymous session ID must start with a letter, otherwise when we use it to create sessions in k8s
// things fail because a label value must start with a letter. That is why we add `anon-` here to the value.
// Note that valid values for a label in k8s are [a-zA-Z0-9], also -_. and it must start with a letter.
c.Request().Header.Set("Renku-Auth-Anon-Id", "anon-" + session.ID)
c.Request().Header.Set("Renku-Auth-Anon-Id", "anon-"+session.ID)
return next(c)
}
}
Expand Down
Loading