diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b9ac0be9d6..dee768c3ba 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -29,6 +29,16 @@ jobs: - name: Build go modules run: make build/go + plugin: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + - name: Build plugin + run: make build/plugin + web: runs-on: ubuntu-24.04 steps: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index b1bfbf8812..db70d646f4 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -50,10 +50,18 @@ jobs: # It is used to set as required check for the branch protection rules go-lint-completed: runs-on: ubuntu-24.04 + if: always() needs: go steps: - - run: | - echo completed + - name: Check if all go lint jobs succeeded + # if jobs in the 'go' job matrix failed or were cancelled, this job will fail + # otherwise this job is marked as successful because all steps are skipped + run: exit 1 + if: >- + ${{ + contains(needs.*.result, 'failure') + || contains(needs.*.result, 'cancelled') + }} web: runs-on: ubuntu-24.04 diff --git a/.github/workflows/plugin_release.yaml b/.github/workflows/plugin_release.yaml index d5889adfcd..81dc47d356 100644 --- a/.github/workflows/plugin_release.yaml +++ b/.github/workflows/plugin_release.yaml @@ -26,6 +26,7 @@ jobs: with: go-version: ${{ env.GO_VERSION }} cache: true + cache-dependency-path: ${{ inputs.path }}/go.sum - name: Determine Plugin Info run: echo "PLUGIN_NAME=$(basename ${{ inputs.path }})" >> $GITHUB_ENV - name: Build binary artifacts diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7dc0b57e98..b91cf1612d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -58,10 +58,18 @@ jobs: # It is used to set as required check for the branch protection rules go-test-completed: runs-on: ubuntu-24.04 + if: always() needs: go steps: - - run: | - echo completed + - name: Check if all go test jobs succeeded + # if jobs in the 'go' job matrix failed or were cancelled, this job will fail + # otherwise this job is marked as successful because all steps are skipped + run: exit 1 + if: >- + ${{ + contains(needs.*.result, 'failure') + || contains(needs.*.result, 'cancelled') + }} web: runs-on: ubuntu-24.04 diff --git a/RELEASE b/RELEASE index 72f1269df7..4c70a69314 100644 --- a/RELEASE +++ b/RELEASE @@ -1,6 +1,6 @@ # Generated by `make release` command. # DO NOT EDIT. -tag: v0.54.1 +tag: v0.54.2 releaseNoteGenerator: showCommitter: false diff --git a/pkg/app/pipedv1/livestatereporter/livestatereporter.go b/pkg/app/pipedv1/livestatereporter/livestatereporter.go index 839ca97f53..895332a247 100644 --- a/pkg/app/pipedv1/livestatereporter/livestatereporter.go +++ b/pkg/app/pipedv1/livestatereporter/livestatereporter.go @@ -229,7 +229,7 @@ func (r *reporter) flush(ctx context.Context, app *model.Application, repo git.R ApplicationId: app.GetId(), ApplicationName: app.GetName(), DeploySource: ds.ToPluginDeploySource(), - DeployTargets: app.GetDeployTargets(), + DeployTargets: app.GetDeployTargetsByPluginName(pluginClient.Name()), }) if err != nil { st, ok := status.FromError(err) diff --git a/pkg/app/pipedv1/livestatereporter/livestatereporter_test.go b/pkg/app/pipedv1/livestatereporter/livestatereporter_test.go index 5a8c21886d..d8bc44b79e 100644 --- a/pkg/app/pipedv1/livestatereporter/livestatereporter_test.go +++ b/pkg/app/pipedv1/livestatereporter/livestatereporter_test.go @@ -52,6 +52,7 @@ func (f *fakeAPIClient) ReportApplicationSyncState(ctx context.Context, req *pip // TODO: make lib for fakePlugin to use in other tests type fakePlugin struct { pluginapi.PluginClient + name string syncStrategy *deployment.DetermineStrategyResponse quickStages []*model.PipelineStage pipelineStages []*model.PipelineStage @@ -122,6 +123,9 @@ func (p *fakePlugin) GetLivestate(ctx context.Context, in *livestate.GetLivestat SyncState: &model.ApplicationSyncState{}, }, nil } +func (p *fakePlugin) Name() string { + return p.name +} type fakeAPILister struct { applicationLister diff --git a/pkg/app/pipedv1/planpreview/builder.go b/pkg/app/pipedv1/planpreview/builder.go index 3b553e2def..46f8282d43 100644 --- a/pkg/app/pipedv1/planpreview/builder.go +++ b/pkg/app/pipedv1/planpreview/builder.go @@ -287,7 +287,7 @@ func (b *builder) buildApp(ctx context.Context, worker int, command string, app ApplicationId: app.Id, ApplicationName: app.Name, PipedId: b.pipedCfg.PipedID, - DeployTargets: app.GetDeployTargets(), + DeployTargets: app.GetDeployTargetsByPluginName(plugin.Name()), TargetDeploymentSource: pluginTargetDS, RunningDeploymentSource: pluginRunningDS, }) diff --git a/pkg/model/application.go b/pkg/model/application.go index f3f70ab020..5c9651396e 100644 --- a/pkg/model/application.go +++ b/pkg/model/application.go @@ -94,6 +94,15 @@ func (a *Application) GetDeployTargets() []string { return deployTargets } +func (a *Application) GetDeployTargetsByPluginName(name string) []string { + dts, ok := a.DeployTargetsByPlugin[name] + if !ok { + return []string{} + } + + return dts.GetDeployTargets() +} + func (a *Application) GetLabelsString() string { labels := make([]string, 0, len(a.Labels)) for k, v := range a.Labels { diff --git a/quickstart/control-plane-values.yaml b/quickstart/control-plane-values.yaml index 67a07c67d7..cddb4a728d 100644 --- a/quickstart/control-plane-values.yaml +++ b/quickstart/control-plane-values.yaml @@ -2,7 +2,7 @@ quickstart: enabled: true localStorageVolumes: - enabled: true + enabled: false config: data: | diff --git a/tool/actions-plan-preview/planpreview.go b/tool/actions-plan-preview/planpreview.go index bb7583e74a..dcffd90f81 100644 --- a/tool/actions-plan-preview/planpreview.go +++ b/tool/actions-plan-preview/planpreview.go @@ -244,7 +244,7 @@ func makeCommentBody(event *githubEvent, r *PlanPreviewResult, title string) str for _, ppr := range app.PluginPlanResults { fmt.Fprintf(&b, " - %s(%s): %s\n", ppr.PluginName, ppr.DeployTarget, ppr.PlanSummary) } - fmt.Fprint(&b, " Details:\n") + fmt.Fprint(&b, "\n Details:\n") for _, ppr := range app.PluginPlanResults { fmt.Fprintf(&b, " - %s(%s):\n", ppr.PluginName, ppr.DeployTarget) diff --git a/tool/actions-plan-preview/testdata/comment-plugin-has-failed-app.txt b/tool/actions-plan-preview/testdata/comment-plugin-has-failed-app.txt index 75ad24583e..0414b10b1a 100644 --- a/tool/actions-plan-preview/testdata/comment-plugin-has-failed-app.txt +++ b/tool/actions-plan-preview/testdata/comment-plugin-has-failed-app.txt @@ -10,6 +10,7 @@ Sync strategy: PIPELINE Plugin(s): kubernetes Summary: - kubernetes(dt-1): 2 resources will be added, 1 resource will be deleted and 5 resources will be changed + Details: - kubernetes(dt-1):
diff --git a/tool/actions-plan-preview/testdata/comment-plugin-one-success-app-multiple-plugins.txt b/tool/actions-plan-preview/testdata/comment-plugin-one-success-app-multiple-plugins.txt index 29848849d3..9f89240cb3 100644 --- a/tool/actions-plan-preview/testdata/comment-plugin-one-success-app-multiple-plugins.txt +++ b/tool/actions-plan-preview/testdata/comment-plugin-one-success-app-multiple-plugins.txt @@ -11,6 +11,7 @@ Sync strategy: PIPELINE Summary: - kubernetes(dt-1): 2 resources will be added, 1 resource will be deleted and 5 resources will be changed - terraform(dt-2): 1 resource will be added, 2 resources will be deleted and 3 resources will be changed + Details: - kubernetes(dt-1):
diff --git a/tool/actions-plan-preview/testdata/comment-plugin-one-success-app.txt b/tool/actions-plan-preview/testdata/comment-plugin-one-success-app.txt index 46ce9aee76..b7bb47f955 100644 --- a/tool/actions-plan-preview/testdata/comment-plugin-one-success-app.txt +++ b/tool/actions-plan-preview/testdata/comment-plugin-one-success-app.txt @@ -10,6 +10,7 @@ Sync strategy: QUICK_SYNC Plugin(s): kubernetes Summary: - kubernetes(dt-1): 2 resources will be added, 1 resource will be deleted and 5 resources will be changed + Details: - kubernetes(dt-1):
diff --git a/web/package.json b/web/package.json index d036f71ab0..89f63b1210 100644 --- a/web/package.json +++ b/web/package.json @@ -73,7 +73,7 @@ "@types/yup": "^0.29.14", "clsx": "^1.2.1", "dagre": "^0.8.5", - "dayjs": "^1.11.13", + "dayjs": "^1.11.15", "dotenv": "^8.6.0", "echarts": "^5.6.0", "formik": "^2.2.9", diff --git a/web/src/components/settings-page/api-key/index.tsx b/web/src/components/settings-page/api-key/index.tsx index 9859f5e941..4a0a49a8e6 100644 --- a/web/src/components/settings-page/api-key/index.tsx +++ b/web/src/components/settings-page/api-key/index.tsx @@ -84,10 +84,9 @@ export const APIKeyPage: FC = memo(function APIKeyPage() { ); const [generatedKey, setGeneratedKey] = useState(null); - const { data: keys = [], isLoading: loading } = useGetApiKeys( - { enabled: true }, - { retry: false } - ); + const { data: keys = [], isLoading: loading } = useGetApiKeys({ + enabled: true, + }); const { addToast } = useToast(); const { mutateAsync: generateApiKey } = useGenerateApiKey(); diff --git a/web/src/components/settings-page/piped/index.tsx b/web/src/components/settings-page/piped/index.tsx index 48b3116925..707423ff6f 100644 --- a/web/src/components/settings-page/piped/index.tsx +++ b/web/src/components/settings-page/piped/index.tsx @@ -82,7 +82,7 @@ export const SettingsPipedPage: FC = memo(function SettingsPipedPage() { const { data: allPipeds } = useGetPipeds( { withStatus: true }, - { refetchInterval: FETCH_INTERVAL } + { refetchInterval: FETCH_INTERVAL, retry: false, staleTime: FETCH_INTERVAL } ); const { data: releasedVersions = [] } = useGetReleasedVersions({ @@ -91,7 +91,7 @@ export const SettingsPipedPage: FC = memo(function SettingsPipedPage() { const { data: breakingChangesNote } = useGetBreakingChanges( { projectId: projectDetail?.id ?? "" }, - { enabled: !!projectDetail?.id, retry: false } + { enabled: !!projectDetail?.id } ); const pipeds = useMemo(() => { diff --git a/web/src/queries/api-keys/use-get-api-keys.tsx b/web/src/queries/api-keys/use-get-api-keys.tsx index bd40b07681..6cc8162adf 100644 --- a/web/src/queries/api-keys/use-get-api-keys.tsx +++ b/web/src/queries/api-keys/use-get-api-keys.tsx @@ -16,6 +16,12 @@ export const useGetApiKeys = ( const res = await APIKeysAPI.getAPIKeys({ options }); return res.keysList; }, + retry: false, + refetchOnMount: false, + refetchOnReconnect: false, + refetchOnWindowFocus: false, + staleTime: 120000, // 2 minutes + cacheTime: 300000, // 5 minutes ...queryOption, }); }; diff --git a/web/src/queries/pipeds/use-get-breaking-changes.tsx b/web/src/queries/pipeds/use-get-breaking-changes.tsx index 8c59cf0646..b61148f51c 100644 --- a/web/src/queries/pipeds/use-get-breaking-changes.tsx +++ b/web/src/queries/pipeds/use-get-breaking-changes.tsx @@ -17,6 +17,12 @@ export const useGetBreakingChanges = ( }); return notes; }, + retry: false, + refetchOnMount: false, + refetchOnReconnect: false, + refetchOnWindowFocus: false, + staleTime: 120000, // 2 minutes + cacheTime: 300000, // 5 minutes ...queryOption, }); }; diff --git a/web/src/queries/pipeds/use-get-released-versions.tsx b/web/src/queries/pipeds/use-get-released-versions.tsx index 1668c7538e..5c33e143ca 100644 --- a/web/src/queries/pipeds/use-get-released-versions.tsx +++ b/web/src/queries/pipeds/use-get-released-versions.tsx @@ -14,6 +14,11 @@ export const useGetReleasedVersions = ( const { versionsList } = await pipedsApi.listReleasedVersions(); return versionsList; }, + refetchOnMount: false, + refetchOnReconnect: false, + refetchOnWindowFocus: false, + staleTime: 120000, // 2 minutes + cacheTime: 300000, // 5 minutes ...queryOption, }); }; diff --git a/web/src/queries/project/use-get-project.tsx b/web/src/queries/project/use-get-project.tsx index 58124d26b7..1386672362 100644 --- a/web/src/queries/project/use-get-project.tsx +++ b/web/src/queries/project/use-get-project.tsx @@ -71,6 +71,12 @@ export const useGetProject = ( userGroups: [], rbacRoles: [], }, + retry: false, + refetchOnMount: false, + refetchOnReconnect: false, + refetchOnWindowFocus: false, + staleTime: 120000, // 2 minutes + cacheTime: 300000, // 5 minutes ...queryOption, }); }; diff --git a/web/yarn.lock b/web/yarn.lock index df9e44e637..1a5d656324 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -3220,10 +3220,10 @@ data-view-byte-offset@^1.0.1: es-errors "^1.3.0" is-data-view "^1.0.1" -dayjs@^1.11.13: - version "1.11.13" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.13.tgz#92430b0139055c3ebb60150aa13e860a4b5a366c" - integrity sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg== +dayjs@^1.11.15: + version "1.11.18" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.18.tgz#835fa712aac52ab9dec8b1494098774ed7070a11" + integrity sha512-zFBQ7WFRvVRhKcWoUh+ZA1g2HVgUbsZm9sbddh8EC5iv93sui8DVVz1Npvz+r6meo9VKfa8NyLWBsQK1VvIKPA== debug@2.6.9: version "2.6.9"