fix: list fixes and ci improvement
PR Checks / lint-test-and-build (pull_request) Successful in 3m6s
PR Checks / lint-test-and-build (pull_request) Successful in 3m6s
This commit is contained in:
@@ -10,6 +10,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: golang:1.27-bookworm
|
image: golang:1.27-bookworm
|
||||||
|
volumes:
|
||||||
|
- go-mod-cache:/go/pkg/mod
|
||||||
|
- go-build-cache:/root/.cache/go-build
|
||||||
steps:
|
steps:
|
||||||
- name: Install system dependencies
|
- name: Install system dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -20,9 +23,6 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Lint
|
|
||||||
run: make lint
|
|
||||||
|
|
||||||
- name: Check formatting
|
- name: Check formatting
|
||||||
run: |
|
run: |
|
||||||
unformatted=$(gofmt -l .)
|
unformatted=$(gofmt -l .)
|
||||||
@@ -32,6 +32,12 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Download modules
|
||||||
|
run: go mod download
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: make lint
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: make test
|
run: make test
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ func (s *ListService) OrderLists(ctx context.Context, authUserID string, listIDs
|
|||||||
|
|
||||||
if !isPermutation(listIDs, serverIDs) {
|
if !isPermutation(listIDs, serverIDs) {
|
||||||
slog.ErrorContext(ctx, "no permutation",
|
slog.ErrorContext(ctx, "no permutation",
|
||||||
slog.Any("client_lids_ids", listIDs),
|
slog.Any("client_list_ids", listIDs),
|
||||||
slog.Any("server_list_ids", serverIDs))
|
slog.Any("server_list_ids", serverIDs))
|
||||||
return ErrStaleListIDs
|
return ErrStaleListIDs
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ func (r *ListRepo) LockUsersLists(ctx context.Context, userID string) ([]string,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to lock users lists: %w", err)
|
return nil, fmt.Errorf("failed to lock users lists: %w", err)
|
||||||
}
|
}
|
||||||
|
defer rows.Close()
|
||||||
|
|
||||||
ids := make([]string, 0, 16)
|
ids := make([]string, 0, 16)
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
|
|||||||
Reference in New Issue
Block a user