Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tag to specify default value of config #2003

Merged
merged 1 commit into from May 26, 2021
Merged

Conversation

nghialv
Copy link
Member

@nghialv nghialv commented May 26, 2021

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #1392

Does this PR introduce a user-facing change?:

NONE

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.90%. This pull request decreases coverage by -0.03%.

File Function Base Head Diff
pkg/app/piped/cloudprovider/lambda/lambda.go LoadFunctionManifest 0.00% 0.00% +0.00%
pkg/config/config.go DecodeYAML 77.78% 72.73% -5.05%
pkg/config/deployment.go GenericDeploymentSpec.Validate 75.00% 66.67% -8.33%
pkg/config/control_plane.go ControlPlaneInsightCollector.UnmarshalJSON 83.33% -- -83.33%

@@ -41,8 +41,7 @@ func TestUnmarshalConfig(t *testing.T) {
}`,
wantSpec: &KubernetesDeploymentSpec{
Input: KubernetesDeploymentInput{
AutoRollback: true,
Copy link
Member

Choose a reason for hiding this comment

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

Should it be remained? 👀

Copy link
Member Author

@nghialv nghialv May 26, 2021

Choose a reason for hiding this comment

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

No. This test is for checking the UnmarshalJSON function of Config struct.
Our defaults assigning is done after that and not included in this test.

Copy link
Member

Choose a reason for hiding this comment

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

got it 👍 It addressed here pkg/config/deployment_kubernetes_test.go:76 already. Thanks for your clarification 🙏

@khanhtc1202
Copy link
Member

Nice
/lgtm

@nakabonne
Copy link
Member

Just a quick question, the remaining fields (like PipedGit) gonna be gradually updated to use the tags, right?

@nghialv
Copy link
Member Author

nghialv commented May 26, 2021

Yes. They will be gradually migrated in the future.

@nakabonne
Copy link
Member

got it. there you go!
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by nakabonne.

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.

Refactor where/how to define and load the default value of config
4 participants