Skip to content

Commit

Permalink
fix upload artifact name conflict (#1373)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
mukundansundar committed Jan 18, 2024
1 parent c7e8612 commit f5eb4fd
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 57 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/dapr_cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
name: Build ${{ matrix.target_os }}_${{ matrix.target_arch }} binaries
runs-on: ${{ matrix.os }}
env:
GOLANG_CI_LINT_VER: v1.51.2
GOLANG_CI_LINT_VER: v1.55.2
GOOS: ${{ matrix.target_os }}
GOARCH: ${{ matrix.target_arch }}
GOPROXY: https://proxy.golang.org
Expand Down Expand Up @@ -132,14 +132,14 @@ jobs:
if: matrix.target_arch == 'amd64' && matrix.target_os == 'linux'
run: |
[ ! -z "${{ env.REL_VERSION }}" ] && echo "${{ env.REL_VERSION }}" > "${{ env.ARCHIVE_OUTDIR }}/release_version.txt"
- name: upload artifacts
uses: actions/upload-artifact@master
- name: upload artifacts ## Following migration guide in https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md
uses: actions/upload-artifact@v4
with:
name: cli_drop
name: cli_drop-${{ matrix.target_os }}_${{ matrix.target_arch }}
path: ${{ env.ARCHIVE_OUTDIR }}
- name: Upload test results
if: always()
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target_os }}_${{ matrix.target_arch }}_test_unit.json
path: ${{ env.TEST_OUTPUT_FILE }}
Expand All @@ -152,9 +152,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: download artifacts
uses: actions/download-artifact@master
uses: actions/download-artifact@v4
with:
name: cli_drop
pattern: cli_drop-*
merge-multiple: true
path: ${{ env.ARTIFACT_DIR }}
- name: Set Release Version
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kind_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ jobs:
shell: bash
- name: Upload test results
if: always()
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.k8s-version }}_${{ matrix.mode }}_e2e_k8s.json
path: ${{ env.TEST_OUTPUT_FILE }}
8 changes: 4 additions & 4 deletions .github/workflows/self_hosted_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
ARCHIVE_OUTDIR: dist/archives
DAPR_RUNTIME_PINNED_VERSION: "1.12.0"
DAPR_DASHBOARD_PINNED_VERSION: 0.14.0
DAPR_RUNTIME_LATEST_STABLE_VERSION:
DAPR_DASHBOARD_LATEST_STABLE_VERSION:
DAPR_RUNTIME_LATEST_STABLE_VERSION: ""
DAPR_DASHBOARD_LATEST_STABLE_VERSION: ""
GOLANG_PROTOBUF_REGISTRATION_CONFLICT: warn
PODMAN_VERSION: 4.4.4
strategy:
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:
shell: bash
- name: Upload test results
if: always()
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target_os }}_${{ matrix.target_arch }}_e2e_standalone.json
name: ${{ matrix.target_os }}_${{ matrix.target_arch }}_${{ matrix.dapr_install_mode }}_e2e_standalone.json
path: ${{ env.TEST_OUTPUT_FILE }}
2 changes: 1 addition & 1 deletion .github/workflows/upgrade_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:
- name: Upload test results
if: always()
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.k8s-version }}_${{ matrix.mode }}_e2e_upgrade_k8s.json
path: ${{ env.TEST_OUTPUT_FILE }}
21 changes: 12 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,11 @@ linters-settings:
# minimal occurrences count to trigger, 3 by default
min-occurrences: 5
depguard:
list-type: blacklist
include-go-root: false
packages:
- github.com/Sirupsen/logrus
packages-with-error-messages:
# specify an error message to output when a blacklisted package is used
github.com/Sirupsen/logrus: "must use github.com/sirupsen/logrus"
rules:
main:
deny:
- pkg: "github.com/Sirupsen/logrus"
desc: "must use github.com/sirupsen/logrus"
misspell:
# Correct spellings using locale preferences for US or UK.
# Default is to use a neutral variety of English.
Expand Down Expand Up @@ -216,7 +214,6 @@ linters-settings:
# Allow multiline assignments to be cuddled. Default is true.
allow-multiline-assign: true
# Allow case blocks to end with a whitespace.
allow-case-traling-whitespace: true
# Allow declarations (var) to be cuddled.
allow-cuddle-declarations: false

Expand Down Expand Up @@ -262,4 +259,10 @@ linters:
- forcetypeassert
- ireturn
- golint
- nosnakecase
- nosnakecase
- tagalign
- varcheck
- deadcode
- structcheck
- ifshort
- testifylint
2 changes: 1 addition & 1 deletion cmd/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ dapr dashboard -k -p 0
}()

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

print.InfoStatusEvent(os.Stdout, fmt.Sprintf("Dapr dashboard found in namespace:\t%s", foundNamespace))
print.InfoStatusEvent(os.Stdout, fmt.Sprintf("Dapr dashboard available at:\t%s\n", webURL))
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubernetes/annotator.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const (
)

type Annotator interface {
Annotate(io.Reader, io.Writer) error
Annotate(io.Reader, io.Writer) error //nolint: inamedparam
}

type K8sAnnotator struct {
Expand Down
33 changes: 17 additions & 16 deletions pkg/kubernetes/annotator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package kubernetes

import (
"bytes"
"fmt"
"io"
"os"
"path"
"sort"
"strconv"
"strings"
"testing"

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

assert.Equal(t, "true", annotations[daprEnabledKey])
assert.Equal(t, appID, annotations[daprAppIDKey])
assert.Equal(t, fmt.Sprintf("%d", appPort), annotations[daprAppPortKey])
assert.Equal(t, strconv.Itoa(appPort), annotations[daprAppPortKey])
assert.Equal(t, config, annotations[daprConfigKey])
assert.Equal(t, appProtocol, annotations[daprAppProtocolKey])
assert.Equal(t, "true", annotations[daprEnableProfilingKey])
assert.Equal(t, logLevel, annotations[daprLogLevelKey])
assert.Equal(t, apiTokenSecret, annotations[daprAPITokenSecretKey])
assert.Equal(t, appTokenSecret, annotations[daprAppTokenSecretKey])
assert.Equal(t, "true", annotations[daprLogAsJSONKey])
assert.Equal(t, fmt.Sprintf("%d", appMaxConcurrency), annotations[daprAppMaxConcurrencyKey])
assert.Equal(t, strconv.Itoa(appMaxConcurrency), annotations[daprAppMaxConcurrencyKey])
assert.Equal(t, "true", annotations[daprEnableMetricsKey])
assert.Equal(t, fmt.Sprintf("%d", metricsPort), annotations[daprMetricsPortKey])
assert.Equal(t, strconv.Itoa(metricsPort), annotations[daprMetricsPortKey])
assert.Equal(t, "true", annotations[daprEnableDebugKey])
assert.Equal(t, fmt.Sprintf("%d", debugPort), annotations[daprDebugPortKey])
assert.Equal(t, strconv.Itoa(debugPort), annotations[daprDebugPortKey])
assert.Equal(t, env, annotations[daprEnvKey])
assert.Equal(t, cpuLimit, annotations[daprCPULimitKey])
assert.Equal(t, memoryLimit, annotations[daprMemoryLimitKey])
assert.Equal(t, cpuRequest, annotations[daprCPURequestKey])
assert.Equal(t, memoryRequest, annotations[daprMemoryRequestKey])
assert.Equal(t, listenAddresses, annotations[daprListenAddressesKey])
assert.Equal(t, fmt.Sprintf("%d", livenessProbeDelay), annotations[daprLivenessProbeDelayKey])
assert.Equal(t, fmt.Sprintf("%d", livenessProbeTimeout), annotations[daprLivenessProbeTimeoutKey])
assert.Equal(t, fmt.Sprintf("%d", livenessProbePeriod), annotations[daprLivenessProbePeriodKey])
assert.Equal(t, fmt.Sprintf("%d", livenessProbeThreshold), annotations[daprLivenessProbeThresholdKey])
assert.Equal(t, fmt.Sprintf("%d", readinessProbeDelay), annotations[daprReadinessProbeDelayKey])
assert.Equal(t, fmt.Sprintf("%d", readinessProbeTimeout), annotations[daprReadinessProbeTimeoutKey])
assert.Equal(t, fmt.Sprintf("%d", readinessProbePeriod), annotations[daprReadinessProbePeriodKey])
assert.Equal(t, fmt.Sprintf("%d", readinessProbeThreshold), annotations[daprReadinessProbeThresholdKey])
assert.Equal(t, strconv.Itoa(livenessProbeDelay), annotations[daprLivenessProbeDelayKey])
assert.Equal(t, strconv.Itoa(livenessProbeTimeout), annotations[daprLivenessProbeTimeoutKey])
assert.Equal(t, strconv.Itoa(livenessProbePeriod), annotations[daprLivenessProbePeriodKey])
assert.Equal(t, strconv.Itoa(livenessProbeThreshold), annotations[daprLivenessProbeThresholdKey])
assert.Equal(t, strconv.Itoa(readinessProbeDelay), annotations[daprReadinessProbeDelayKey])
assert.Equal(t, strconv.Itoa(readinessProbeTimeout), annotations[daprReadinessProbeTimeoutKey])
assert.Equal(t, strconv.Itoa(readinessProbePeriod), annotations[daprReadinessProbePeriodKey])
assert.Equal(t, strconv.Itoa(readinessProbeThreshold), annotations[daprReadinessProbeThresholdKey])
assert.Equal(t, daprImage, annotations[daprImageKey])
assert.Equal(t, "true", annotations[daprAppSSLKey])
assert.Equal(t, fmt.Sprintf("%d", maxRequestBodySize), annotations[daprMaxRequestBodySizeKey])
assert.Equal(t, fmt.Sprintf("%d", readBufferSize), annotations[daprReadBufferSizeKey])
assert.Equal(t, strconv.Itoa(maxRequestBodySize), annotations[daprMaxRequestBodySizeKey])
assert.Equal(t, strconv.Itoa(readBufferSize), annotations[daprReadBufferSizeKey])
assert.Equal(t, "true", annotations[daprHTTPStreamRequestBodyKey])
assert.Equal(t, fmt.Sprintf("%d", gracefulShutdownSeconds), annotations[daprGracefulShutdownSecondsKey])
assert.Equal(t, strconv.Itoa(gracefulShutdownSeconds), annotations[daprGracefulShutdownSecondsKey])
assert.Equal(t, "true", annotations[daprEnableAPILoggingKey])
assert.Equal(t, unixDomainSocketPath, annotations[daprUnixDomainSocketPathKey])
assert.Equal(t, volumeMountsReadOnly, annotations[daprVolumeMountsReadOnlyKey])
Expand Down
2 changes: 1 addition & 1 deletion pkg/standalone/invoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (s *Standalone) Invoke(appID, method string, data []byte, verb string, path
}

func makeEndpoint(lo ListOutput, method string) string {
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)
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
}

func handleResponse(response *http.Response) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/standalone/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (s *Standalone) Publish(publishAppID, pubsubName, topic string, payload []b
},
}
} else {
url = fmt.Sprintf("http://localhost:%s/v%s/publish/%s/%s%s", fmt.Sprintf("%v", instance.HTTPPort), api.RuntimeAPIVersion, pubsubName, topic, queryParams)
url = fmt.Sprintf("http://localhost:%s/v%s/publish/%s/%s%s", fmt.Sprintf("%v", instance.HTTPPort), api.RuntimeAPIVersion, pubsubName, topic, queryParams) //nolint: perfsprint
}

contentType := "application/json"
Expand Down
6 changes: 3 additions & 3 deletions pkg/standalone/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ func Stop(appID string, cliPIDToNoOfApps map[int]int, apps []ListOutput) error {
// Kill the Daprd process if Daprd was started without CLI, otherwise
// kill the CLI process which also kills the associated Daprd process.
if a.CliPID == 0 || cliPIDToNoOfApps[a.CliPID] > 1 {
pid = fmt.Sprintf("%v", a.DaprdPID)
pid = fmt.Sprintf("%v", a.DaprdPID) //nolint: perfsprint
cliPIDToNoOfApps[a.CliPID]--
} else {
pid = fmt.Sprintf("%v", a.CliPID)
pid = fmt.Sprintf("%v", a.CliPID) //nolint: perfsprint
}

_, err := utils.RunCmdAndWait("kill", pid)
Expand All @@ -57,7 +57,7 @@ func StopAppsWithRunFile(runTemplatePath string) error {
pgid, err := syscall.Getpgid(a.CliPID)
if err != nil {
// Fall back to cliPID if pgid is not available.
_, err = utils.RunCmdAndWait("kill", fmt.Sprintf("%v", a.CliPID))
_, err = utils.RunCmdAndWait("kill", fmt.Sprintf("%v", a.CliPID)) //nolint:perfsprint
return err
}
// Kill the whole process group.
Expand Down
26 changes: 14 additions & 12 deletions tests/e2e/upgrade/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
"github.com/dapr/cli/tests/e2e/common"
)

const deleteCRDs = "delete CRDs "

type upgradePath struct {
previous common.VersionDetails
next common.VersionDetails
Expand Down Expand Up @@ -129,8 +131,8 @@ func getTestsOnUpgrade(p upgradePath, installOpts, upgradeOpts common.TestOption

// delete CRDs if exist.
tests = append(tests,
common.TestCase{Name: "delete CRDs " + p.previous.RuntimeVersion, Callable: common.DeleteCRD(p.previous.CustomResourceDefs)},
common.TestCase{Name: "delete CRDs " + p.next.RuntimeVersion, Callable: common.DeleteCRD(p.next.CustomResourceDefs)})
common.TestCase{Name: deleteCRDs + p.previous.RuntimeVersion, Callable: common.DeleteCRD(p.previous.CustomResourceDefs)},
common.TestCase{Name: deleteCRDs + p.next.RuntimeVersion, Callable: common.DeleteCRD(p.next.CustomResourceDefs)})

return tests
}
Expand All @@ -142,8 +144,8 @@ func TestUpgradePathNonHAModeMTLSDisabled(t *testing.T) {
common.EnsureUninstall(false, false) // does not wait for pod deletion.
for _, p := range supportedUpgradePaths {
t.Run(fmt.Sprintf("setup v%s to v%s", p.previous.RuntimeVersion, p.next.RuntimeVersion), func(t *testing.T) {
t.Run("delete CRDs "+p.previous.RuntimeVersion, common.DeleteCRD(p.previous.CustomResourceDefs))
t.Run("delete CRDs "+p.next.RuntimeVersion, common.DeleteCRD(p.next.CustomResourceDefs))
t.Run(deleteCRDs+p.previous.RuntimeVersion, common.DeleteCRD(p.previous.CustomResourceDefs))
t.Run(deleteCRDs+p.next.RuntimeVersion, common.DeleteCRD(p.next.CustomResourceDefs))
})
}

Expand Down Expand Up @@ -187,8 +189,8 @@ func TestUpgradePathNonHAModeMTLSEnabled(t *testing.T) {
common.EnsureUninstall(false, false) // does not wait for pod deletion.
for _, p := range supportedUpgradePaths {
t.Run(fmt.Sprintf("setup v%s to v%s", p.previous.RuntimeVersion, p.next.RuntimeVersion), func(t *testing.T) {
t.Run("delete CRDs "+p.previous.RuntimeVersion, common.DeleteCRD(p.previous.CustomResourceDefs))
t.Run("delete CRDs "+p.next.RuntimeVersion, common.DeleteCRD(p.next.CustomResourceDefs))
t.Run(deleteCRDs+p.previous.RuntimeVersion, common.DeleteCRD(p.previous.CustomResourceDefs))
t.Run(deleteCRDs+p.next.RuntimeVersion, common.DeleteCRD(p.next.CustomResourceDefs))
})
}

Expand Down Expand Up @@ -232,8 +234,8 @@ func TestUpgradePathHAModeMTLSDisabled(t *testing.T) {
common.EnsureUninstall(false, false) // does not wait for pod deletion.
for _, p := range supportedUpgradePaths {
t.Run(fmt.Sprintf("setup v%s to v%s", p.previous.RuntimeVersion, p.next.RuntimeVersion), func(t *testing.T) {
t.Run("delete CRDs "+p.previous.RuntimeVersion, common.DeleteCRD(p.previous.CustomResourceDefs))
t.Run("delete CRDs "+p.next.RuntimeVersion, common.DeleteCRD(p.next.CustomResourceDefs))
t.Run(deleteCRDs+p.previous.RuntimeVersion, common.DeleteCRD(p.previous.CustomResourceDefs))
t.Run(deleteCRDs+p.next.RuntimeVersion, common.DeleteCRD(p.next.CustomResourceDefs))
})
}

Expand Down Expand Up @@ -277,8 +279,8 @@ func TestUpgradePathHAModeMTLSEnabled(t *testing.T) {
common.EnsureUninstall(false, false) // does not wait for pod deletion.
for _, p := range supportedUpgradePaths {
t.Run(fmt.Sprintf("setup v%s to v%s", p.previous.RuntimeVersion, p.next.RuntimeVersion), func(t *testing.T) {
t.Run("delete CRDs "+p.previous.RuntimeVersion, common.DeleteCRD(p.previous.CustomResourceDefs))
t.Run("delete CRDs "+p.next.RuntimeVersion, common.DeleteCRD(p.next.CustomResourceDefs))
t.Run(deleteCRDs+p.previous.RuntimeVersion, common.DeleteCRD(p.previous.CustomResourceDefs))
t.Run(deleteCRDs+p.next.RuntimeVersion, common.DeleteCRD(p.next.CustomResourceDefs))
})
}

Expand Down Expand Up @@ -324,8 +326,8 @@ func TestUpgradeWithHTTPEndpoint(t *testing.T) {
common.EnsureUninstall(false, false) // does not wait for pod deletion.
for _, p := range supportedUpgradePaths {
t.Run(fmt.Sprintf("setup v%s to v%s", p.previous.RuntimeVersion, p.next.RuntimeVersion), func(t *testing.T) {
t.Run("delete CRDs "+p.previous.RuntimeVersion, common.DeleteCRD(p.previous.CustomResourceDefs))
t.Run("delete CRDs "+p.next.RuntimeVersion, common.DeleteCRD(p.next.CustomResourceDefs))
t.Run(deleteCRDs+p.previous.RuntimeVersion, common.DeleteCRD(p.previous.CustomResourceDefs))
t.Run(deleteCRDs+p.next.RuntimeVersion, common.DeleteCRD(p.next.CustomResourceDefs))
})
}

Expand Down

0 comments on commit f5eb4fd

Please sign in to comment.