Skip to content

Commit

Permalink
Add GitHub Actions for dependency updates (#342)
Browse files Browse the repository at this point in the history
* add actions

* add exceptions and fix UT failure

* fix format
  • Loading branch information
shaynafinocchiaro authored Feb 5, 2025
1 parent 0833d06 commit 8aba6f1
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 8 deletions.
5 changes: 2 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@ updates:
interval: "daily"
time: "18:00"
allow:
# Allow both direct and indirect updates for all packages
- dependency-type: all
# Allow direct updates for packages
- dependency-type: direct
# a group of dependencies will be updated together in one pull request
groups:
golang:
# group all semantic versioning levels together in one pull request
update-types:
- major
- minor
- patch
patterns:
- "*"

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ jobs:
uses: dell/common-github-actions/go-code-tester@main
with:
threshold: 90
skip-list: "karavi-authorization/deploy,karavi-authorization/internal/web,karavi-authorization/internal/tenantsvc,karavi-authorization/cmd/karavictl/cmd,karavi-authorization/cmd/proxy-server,karavi-authorization/cmd/tenant-service,karavi-authorization/internal/proxy,karavi-authorization/internal/tenantsvc,karavi-authorization/internal/token/jwx,karavi-authorization/internal/k8s,karavi-authorization/internal/role-service,karavi-authorization/internal/role-service/validate,karavi-authorization/cmd/sidecar-proxy"
skip-list: "karavi-authorization/deploy,karavi-authorization/internal/web,karavi-authorization/internal/tenantsvc,karavi-authorization/cmd/karavictl/cmd,karavi-authorization/cmd/proxy-server,karavi-authorization/cmd/tenant-service,karavi-authorization/internal/proxy,karavi-authorization/internal/tenantsvc,karavi-authorization/internal/token/jwx,karavi-authorization/internal/k8s,karavi-authorization/internal/role-service,karavi-authorization/internal/role-service/validate,karavi-authorization/cmd/sidecar-proxy, karavi-authorization/cmd/karavictl/cmd/api, karavi-authorization/internal/role-service/roles, karavi-authorization/internal/storage-service/mocks, karavi-authorization/internal/role-service/middleware, karavi-authorization/cmd/karavictl/cmd/api/mocks, karavi-authorization/internal/tenantsvc/middleware, karavi-authorization/internal/decision, karavi-authorization/cmd/role-service, karavi-authorization/internal/role-service/mocks, karavi-authorization/internal/tenantsvc/mocks, karavi-authorization/cmd/storage-service, karavi-authorization/pb, karavi-authorization/cmd/karavictl"
env:
# The hostname used to communicate with the Redis service container
REDIS_HOST: redis
# The default Redis port
REDIS_PORT: 6379
REDIS_PORT: 6379

go_security_scan:
name: Go security
runs-on: ubuntu-latest
Expand All @@ -64,7 +64,7 @@ jobs:
- name: Run Go Security
uses: securego/gosec@master
with:
args: -exclude=G108,G402,G307 ./...
args: -exclude=G108,G402,G307 ./...
malware_security_scan:
name: Malware Scanner
runs-on: ubuntu-latest
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/update-libraries-to-commits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0

# Reusable workflow to perform updates of Dell client libraries to latest commits
name: Dell Libraries Commit Update
on: # yamllint disable-line rule:truthy
workflow_dispatch:

jobs:
package-update:
uses: dell/common-github-actions/.github/workflows/update-libraries-to-commits.yml@main
name: Dell Libraries Update
secrets: inherit
20 changes: 20 additions & 0 deletions .github/workflows/update-libraries.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0

# Reusable workflow to perform updates of Dell client libraries
name: Dell Libraries Release Update
on: # yamllint disable-line rule:truthy
workflow_dispatch:
repository_dispatch:
types: [latest-released-libraries]

jobs:
package-update:
uses: dell/common-github-actions/.github/workflows/update-libraries.yml@main
name: Dell Libraries Update
secrets: inherit
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ test: testopa

.PHONY: testopa
testopa: verify-podman-version
$(BUILDER) run --rm -it -v ${PWD}/policies:/policies/ openpolicyagent/opa test -v /policies/
$(BUILDER) run --rm -it -v ${PWD}/policies:/policies/ openpolicyagent/opa:0.70.0 test -v /policies/

.PHONY: package
package:
Expand Down
9 changes: 9 additions & 0 deletions internal/storage-service/powerflex.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package storage

import (
"context"
"sync"

"github.com/dell/goscaleio"
types "github.com/dell/goscaleio/types/v1"
Expand All @@ -11,12 +12,14 @@ import (
type rateLimitedPowerFlexClient struct {
client *goscaleio.Client
sem *semaphore.Weighted
lock sync.Mutex
}

func newRateLimitedPowerFlexClient(client *goscaleio.Client, semaphore *semaphore.Weighted) *rateLimitedPowerFlexClient {
return &rateLimitedPowerFlexClient{
client: client,
sem: semaphore,
lock: sync.Mutex{},
}
}

Expand All @@ -27,6 +30,9 @@ func (c *rateLimitedPowerFlexClient) GetVolume(ctx context.Context, volumehref s
}
defer c.sem.Release(1)

c.lock.Lock()
defer c.lock.Unlock()

return c.client.GetVolume(volumehref, volumeid, ancestorvolumeid, volumename, getSnapshots)
}

Expand All @@ -37,5 +43,8 @@ func (c *rateLimitedPowerFlexClient) FindStoragePool(ctx context.Context, id str
}
defer c.sem.Release(1)

c.lock.Lock()
defer c.lock.Unlock()

return c.client.FindStoragePool(id, name, href, protectionDomain)
}

0 comments on commit 8aba6f1

Please sign in to comment.