Skip to content

Commit f5eb4fd

Browse files
fix upload artifact name conflict (#1373)
* fix upload test report name Signed-off-by: Mukundan Sundararajan <[email protected]> * fix linter errors Signed-off-by: Mukundan Sundararajan <[email protected]> * fix upload artifacts version and name conflicts Signed-off-by: Mukundan Sundararajan <[email protected]> * fix typo Signed-off-by: Mukundan Sundararajan <[email protected]> * fix typo Signed-off-by: Mukundan Sundararajan <[email protected]> --------- Signed-off-by: Mukundan Sundararajan <[email protected]>
1 parent c7e8612 commit f5eb4fd

File tree

12 files changed

+64
-57
lines changed

12 files changed

+64
-57
lines changed

.github/workflows/dapr_cli.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
name: Build ${{ matrix.target_os }}_${{ matrix.target_arch }} binaries
3030
runs-on: ${{ matrix.os }}
3131
env:
32-
GOLANG_CI_LINT_VER: v1.51.2
32+
GOLANG_CI_LINT_VER: v1.55.2
3333
GOOS: ${{ matrix.target_os }}
3434
GOARCH: ${{ matrix.target_arch }}
3535
GOPROXY: https://proxy.golang.org
@@ -132,14 +132,14 @@ jobs:
132132
if: matrix.target_arch == 'amd64' && matrix.target_os == 'linux'
133133
run: |
134134
[ ! -z "${{ env.REL_VERSION }}" ] && echo "${{ env.REL_VERSION }}" > "${{ env.ARCHIVE_OUTDIR }}/release_version.txt"
135-
- name: upload artifacts
136-
uses: actions/upload-artifact@master
135+
- name: upload artifacts ## Following migration guide in https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md
136+
uses: actions/upload-artifact@v4
137137
with:
138-
name: cli_drop
138+
name: cli_drop-${{ matrix.target_os }}_${{ matrix.target_arch }}
139139
path: ${{ env.ARCHIVE_OUTDIR }}
140140
- name: Upload test results
141141
if: always()
142-
uses: actions/upload-artifact@master
142+
uses: actions/upload-artifact@v4
143143
with:
144144
name: ${{ matrix.target_os }}_${{ matrix.target_arch }}_test_unit.json
145145
path: ${{ env.TEST_OUTPUT_FILE }}
@@ -152,9 +152,10 @@ jobs:
152152
runs-on: ubuntu-latest
153153
steps:
154154
- name: download artifacts
155-
uses: actions/download-artifact@master
155+
uses: actions/download-artifact@v4
156156
with:
157-
name: cli_drop
157+
pattern: cli_drop-*
158+
merge-multiple: true
158159
path: ${{ env.ARTIFACT_DIR }}
159160
- name: Set Release Version
160161
run: |

.github/workflows/kind_e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ jobs:
195195
shell: bash
196196
- name: Upload test results
197197
if: always()
198-
uses: actions/upload-artifact@master
198+
uses: actions/upload-artifact@v4
199199
with:
200200
name: ${{ matrix.k8s-version }}_${{ matrix.mode }}_e2e_k8s.json
201201
path: ${{ env.TEST_OUTPUT_FILE }}

.github/workflows/self_hosted_e2e.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ jobs:
4040
ARCHIVE_OUTDIR: dist/archives
4141
DAPR_RUNTIME_PINNED_VERSION: "1.12.0"
4242
DAPR_DASHBOARD_PINNED_VERSION: 0.14.0
43-
DAPR_RUNTIME_LATEST_STABLE_VERSION:
44-
DAPR_DASHBOARD_LATEST_STABLE_VERSION:
43+
DAPR_RUNTIME_LATEST_STABLE_VERSION: ""
44+
DAPR_DASHBOARD_LATEST_STABLE_VERSION: ""
4545
GOLANG_PROTOBUF_REGISTRATION_CONFLICT: warn
4646
PODMAN_VERSION: 4.4.4
4747
strategy:
@@ -179,7 +179,7 @@ jobs:
179179
shell: bash
180180
- name: Upload test results
181181
if: always()
182-
uses: actions/upload-artifact@master
182+
uses: actions/upload-artifact@v4
183183
with:
184-
name: ${{ matrix.target_os }}_${{ matrix.target_arch }}_e2e_standalone.json
184+
name: ${{ matrix.target_os }}_${{ matrix.target_arch }}_${{ matrix.dapr_install_mode }}_e2e_standalone.json
185185
path: ${{ env.TEST_OUTPUT_FILE }}

.github/workflows/upgrade_e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ jobs:
158158
159159
- name: Upload test results
160160
if: always()
161-
uses: actions/upload-artifact@master
161+
uses: actions/upload-artifact@v4
162162
with:
163163
name: ${{ matrix.k8s-version }}_${{ matrix.mode }}_e2e_upgrade_k8s.json
164164
path: ${{ env.TEST_OUTPUT_FILE }}

.golangci.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,11 @@ linters-settings:
118118
# minimal occurrences count to trigger, 3 by default
119119
min-occurrences: 5
120120
depguard:
121-
list-type: blacklist
122-
include-go-root: false
123-
packages:
124-
- github.com/Sirupsen/logrus
125-
packages-with-error-messages:
126-
# specify an error message to output when a blacklisted package is used
127-
github.com/Sirupsen/logrus: "must use github.com/sirupsen/logrus"
121+
rules:
122+
main:
123+
deny:
124+
- pkg: "github.com/Sirupsen/logrus"
125+
desc: "must use github.com/sirupsen/logrus"
128126
misspell:
129127
# Correct spellings using locale preferences for US or UK.
130128
# Default is to use a neutral variety of English.
@@ -216,7 +214,6 @@ linters-settings:
216214
# Allow multiline assignments to be cuddled. Default is true.
217215
allow-multiline-assign: true
218216
# Allow case blocks to end with a whitespace.
219-
allow-case-traling-whitespace: true
220217
# Allow declarations (var) to be cuddled.
221218
allow-cuddle-declarations: false
222219

@@ -262,4 +259,10 @@ linters:
262259
- forcetypeassert
263260
- ireturn
264261
- golint
265-
- nosnakecase
262+
- nosnakecase
263+
- tagalign
264+
- varcheck
265+
- deadcode
266+
- structcheck
267+
- ifshort
268+
- testifylint

cmd/dashboard.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ dapr dashboard -k -p 0
180180
}()
181181

182182
// url for dashboard after port forwarding.
183-
webURL := fmt.Sprintf("http://%s", net.JoinHostPort(dashboardHost, fmt.Sprint(portForward.LocalPort)))
183+
webURL := fmt.Sprintf("http://%s", net.JoinHostPort(dashboardHost, fmt.Sprint(portForward.LocalPort))) //nolint: perfsprint
184184

185185
print.InfoStatusEvent(os.Stdout, fmt.Sprintf("Dapr dashboard found in namespace:\t%s", foundNamespace))
186186
print.InfoStatusEvent(os.Stdout, fmt.Sprintf("Dapr dashboard available at:\t%s\n", webURL))

pkg/kubernetes/annotator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const (
8282
)
8383

8484
type Annotator interface {
85-
Annotate(io.Reader, io.Writer) error
85+
Annotate(io.Reader, io.Writer) error //nolint: inamedparam
8686
}
8787

8888
type K8sAnnotator struct {

pkg/kubernetes/annotator_test.go

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ package kubernetes
22

33
import (
44
"bytes"
5-
"fmt"
65
"io"
76
"os"
87
"path"
98
"sort"
9+
"strconv"
1010
"strings"
1111
"testing"
1212

@@ -292,6 +292,7 @@ func TestAnnotate(t *testing.T) {
292292
var out bytes.Buffer
293293
in := []io.Reader{inputFile}
294294
for i, annotation := range tt.annotations {
295+
annotation := annotation
295296
annotator := NewK8sAnnotator(K8sAnnotatorConfig{
296297
TargetResource: &annotation.targetResource,
297298
TargetNamespace: &annotation.targetNamespace,
@@ -423,39 +424,39 @@ func TestGetDaprAnnotations(t *testing.T) {
423424

424425
assert.Equal(t, "true", annotations[daprEnabledKey])
425426
assert.Equal(t, appID, annotations[daprAppIDKey])
426-
assert.Equal(t, fmt.Sprintf("%d", appPort), annotations[daprAppPortKey])
427+
assert.Equal(t, strconv.Itoa(appPort), annotations[daprAppPortKey])
427428
assert.Equal(t, config, annotations[daprConfigKey])
428429
assert.Equal(t, appProtocol, annotations[daprAppProtocolKey])
429430
assert.Equal(t, "true", annotations[daprEnableProfilingKey])
430431
assert.Equal(t, logLevel, annotations[daprLogLevelKey])
431432
assert.Equal(t, apiTokenSecret, annotations[daprAPITokenSecretKey])
432433
assert.Equal(t, appTokenSecret, annotations[daprAppTokenSecretKey])
433434
assert.Equal(t, "true", annotations[daprLogAsJSONKey])
434-
assert.Equal(t, fmt.Sprintf("%d", appMaxConcurrency), annotations[daprAppMaxConcurrencyKey])
435+
assert.Equal(t, strconv.Itoa(appMaxConcurrency), annotations[daprAppMaxConcurrencyKey])
435436
assert.Equal(t, "true", annotations[daprEnableMetricsKey])
436-
assert.Equal(t, fmt.Sprintf("%d", metricsPort), annotations[daprMetricsPortKey])
437+
assert.Equal(t, strconv.Itoa(metricsPort), annotations[daprMetricsPortKey])
437438
assert.Equal(t, "true", annotations[daprEnableDebugKey])
438-
assert.Equal(t, fmt.Sprintf("%d", debugPort), annotations[daprDebugPortKey])
439+
assert.Equal(t, strconv.Itoa(debugPort), annotations[daprDebugPortKey])
439440
assert.Equal(t, env, annotations[daprEnvKey])
440441
assert.Equal(t, cpuLimit, annotations[daprCPULimitKey])
441442
assert.Equal(t, memoryLimit, annotations[daprMemoryLimitKey])
442443
assert.Equal(t, cpuRequest, annotations[daprCPURequestKey])
443444
assert.Equal(t, memoryRequest, annotations[daprMemoryRequestKey])
444445
assert.Equal(t, listenAddresses, annotations[daprListenAddressesKey])
445-
assert.Equal(t, fmt.Sprintf("%d", livenessProbeDelay), annotations[daprLivenessProbeDelayKey])
446-
assert.Equal(t, fmt.Sprintf("%d", livenessProbeTimeout), annotations[daprLivenessProbeTimeoutKey])
447-
assert.Equal(t, fmt.Sprintf("%d", livenessProbePeriod), annotations[daprLivenessProbePeriodKey])
448-
assert.Equal(t, fmt.Sprintf("%d", livenessProbeThreshold), annotations[daprLivenessProbeThresholdKey])
449-
assert.Equal(t, fmt.Sprintf("%d", readinessProbeDelay), annotations[daprReadinessProbeDelayKey])
450-
assert.Equal(t, fmt.Sprintf("%d", readinessProbeTimeout), annotations[daprReadinessProbeTimeoutKey])
451-
assert.Equal(t, fmt.Sprintf("%d", readinessProbePeriod), annotations[daprReadinessProbePeriodKey])
452-
assert.Equal(t, fmt.Sprintf("%d", readinessProbeThreshold), annotations[daprReadinessProbeThresholdKey])
446+
assert.Equal(t, strconv.Itoa(livenessProbeDelay), annotations[daprLivenessProbeDelayKey])
447+
assert.Equal(t, strconv.Itoa(livenessProbeTimeout), annotations[daprLivenessProbeTimeoutKey])
448+
assert.Equal(t, strconv.Itoa(livenessProbePeriod), annotations[daprLivenessProbePeriodKey])
449+
assert.Equal(t, strconv.Itoa(livenessProbeThreshold), annotations[daprLivenessProbeThresholdKey])
450+
assert.Equal(t, strconv.Itoa(readinessProbeDelay), annotations[daprReadinessProbeDelayKey])
451+
assert.Equal(t, strconv.Itoa(readinessProbeTimeout), annotations[daprReadinessProbeTimeoutKey])
452+
assert.Equal(t, strconv.Itoa(readinessProbePeriod), annotations[daprReadinessProbePeriodKey])
453+
assert.Equal(t, strconv.Itoa(readinessProbeThreshold), annotations[daprReadinessProbeThresholdKey])
453454
assert.Equal(t, daprImage, annotations[daprImageKey])
454455
assert.Equal(t, "true", annotations[daprAppSSLKey])
455-
assert.Equal(t, fmt.Sprintf("%d", maxRequestBodySize), annotations[daprMaxRequestBodySizeKey])
456-
assert.Equal(t, fmt.Sprintf("%d", readBufferSize), annotations[daprReadBufferSizeKey])
456+
assert.Equal(t, strconv.Itoa(maxRequestBodySize), annotations[daprMaxRequestBodySizeKey])
457+
assert.Equal(t, strconv.Itoa(readBufferSize), annotations[daprReadBufferSizeKey])
457458
assert.Equal(t, "true", annotations[daprHTTPStreamRequestBodyKey])
458-
assert.Equal(t, fmt.Sprintf("%d", gracefulShutdownSeconds), annotations[daprGracefulShutdownSecondsKey])
459+
assert.Equal(t, strconv.Itoa(gracefulShutdownSeconds), annotations[daprGracefulShutdownSecondsKey])
459460
assert.Equal(t, "true", annotations[daprEnableAPILoggingKey])
460461
assert.Equal(t, unixDomainSocketPath, annotations[daprUnixDomainSocketPathKey])
461462
assert.Equal(t, volumeMountsReadOnly, annotations[daprVolumeMountsReadOnlyKey])

pkg/standalone/invoke.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (s *Standalone) Invoke(appID, method string, data []byte, verb string, path
6464
}
6565

6666
func makeEndpoint(lo ListOutput, method string) string {
67-
return fmt.Sprintf("http://127.0.0.1:%s/v%s/invoke/%s/method/%s", fmt.Sprintf("%v", lo.HTTPPort), api.RuntimeAPIVersion, lo.AppID, method)
67+
return fmt.Sprintf("http://127.0.0.1:%s/v%s/invoke/%s/method/%s", fmt.Sprintf("%v", lo.HTTPPort), api.RuntimeAPIVersion, lo.AppID, method) //nolint: perfsprint
6868
}
6969

7070
func handleResponse(response *http.Response) (string, error) {

pkg/standalone/publish.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (s *Standalone) Publish(publishAppID, pubsubName, topic string, payload []b
6262
},
6363
}
6464
} else {
65-
url = fmt.Sprintf("http://localhost:%s/v%s/publish/%s/%s%s", fmt.Sprintf("%v", instance.HTTPPort), api.RuntimeAPIVersion, pubsubName, topic, queryParams)
65+
url = fmt.Sprintf("http://localhost:%s/v%s/publish/%s/%s%s", fmt.Sprintf("%v", instance.HTTPPort), api.RuntimeAPIVersion, pubsubName, topic, queryParams) //nolint: perfsprint
6666
}
6767

6868
contentType := "application/json"

0 commit comments

Comments
 (0)