Skip to content

Conversation

@nghialv
Copy link
Member

@nghialv nghialv commented Jul 5, 2021

What this PR does / why we need it:

  • Use the planner package to decide which strategy should be used
  • Use terraform plan as plan details for Terraform application
  • Use diff between head and running commits as plan details for Kubernetes application
  • Refine the output of pipectl plan-preview to make it more readable

Which issue(s) this PR fixes:

Fixes #2167

Does this PR introduce a user-facing change?:

NONE

Copy link
Collaborator

@pipecd-bot pipecd-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GO_LINTER

Some issues were detected while linting go source files in your changes.

ApplicationID string
ApplicationName string
GitPath model.ApplicationGitPath
Trigger model.DeploymentTrigger
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing only needed data to make it can be reused by planpreview package where there is no deployment data.

@pipecd-bot
Copy link
Collaborator

TODO

The following ISSUES will be created once got merged. If you want me to skip creating the issue, you can use /todo skip command.

Details

1. Calculating planpreview's diff for other application kinds.

https://github.com/pipe-cd/pipe/blob/2fb84447f0019c3c07399d4a07b4b37f1693bfcb/pkg/app/piped/planpreview/builder.go#L184-L187

This was created by todo plugin since "TODO:" was found in 2fb8444 when #2176 was merged. cc: @nghialv.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.39%. This pull request decreases coverage by -0.04%.

File Function Base Head Diff
pkg/app/piped/cloudprovider/kubernetes/diff.go DiffListResult.NoChange -- 0.00% +0.00%
pkg/app/piped/cloudprovider/kubernetes/diff.go Diff -- 100.00% +100.00%
pkg/app/piped/cloudprovider/kubernetes/diff.go DiffList -- 0.00% +0.00%
pkg/app/piped/cloudprovider/kubernetes/diff.go DiffListResult.DiffString -- 0.00% +0.00%
pkg/app/piped/cloudprovider/kubernetes/diff.go groupManifests -- 92.00% +92.00%
pkg/app/piped/planpreview/builder.go builder.findTriggerApps -- 0.00% +0.00%
pkg/app/piped/planpreview/builder.go builder.getMostRecentlySuccessfulDeployment -- 0.00% +0.00%
pkg/app/piped/planpreview/kubernetesdiff.go builder.kubernetesDiff -- 0.00% +0.00%
pkg/app/piped/planpreview/kubernetesdiff.go loadKubernetesManifests -- 0.00% +0.00%
pkg/app/piped/planpreview/terraformdiff.go builder.terraformDiff -- 0.00% +0.00%
pkg/app/pipectl/cmd/planpreview/planpreview.go ReadableResult.String 100.00% 96.67% -3.33%
pkg/app/piped/planpreview/builder.go builder.Build 0.00% 0.00% +0.00%
pkg/app/piped/planpreview/builder.go builder.plan 0.00% 0.00% +0.00%
pkg/app/piped/planpreview/handler.go NewHandler 85.71% 87.50% +1.79%
pkg/app/piped/cloudprovider/kubernetes/manifest.go Diff 100.00% -- -100.00%
pkg/app/piped/driftdetector/kubernetes/detector.go NewDetector 0.00% -- +-0.00%
pkg/app/piped/driftdetector/kubernetes/detector.go detector.Run 0.00% -- +-0.00%
pkg/app/piped/driftdetector/kubernetes/detector.go detector.check 0.00% -- +-0.00%
pkg/app/piped/driftdetector/kubernetes/detector.go detector.checkApplication 0.00% -- +-0.00%
pkg/app/piped/driftdetector/kubernetes/detector.go detector.loadHeadManifests 0.00% -- +-0.00%
pkg/app/piped/driftdetector/kubernetes/detector.go detector.listGroupedApplication 0.00% -- +-0.00%
pkg/app/piped/driftdetector/kubernetes/detector.go detector.loadDeploymentConfiguration 0.00% -- +-0.00%
pkg/app/piped/driftdetector/kubernetes/detector.go detector.ProviderName 0.00% -- +-0.00%
pkg/app/piped/driftdetector/kubernetes/detector.go groupManifests 92.00% -- -92.00%
pkg/app/piped/driftdetector/kubernetes/detector.go makeSyncedState 0.00% -- +-0.00%
pkg/app/piped/driftdetector/kubernetes/detector.go makeOutOfSyncState 0.00% -- +-0.00%
pkg/app/piped/driftdetector/kubernetes/detector.go filterIgnoringManifests 0.00% -- +-0.00%

@nakabonne
Copy link
Member

There you go
/lgtm

@pipecd-bot pipecd-bot added the lgtm label Jul 5, 2021
@khanhtc1202
Copy link
Member

Way to go 🚀
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by khanhtc1202.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement planpreview plan.

5 participants