Skip to content

Conversation

@Szarny
Copy link
Contributor

@Szarny Szarny commented May 25, 2022

What this PR does / why we need it:

Add feature to show piped config on Web UI with masked style

スクリーンショット 2022-05-26 19 01 47

スクリーンショット 2022-05-26 19 01 55

Which issue(s) this PR fixes:

Fixes #3649

Does this PR introduce a user-facing change?:

Able to check current piped config on the web console

@Szarny Szarny self-assigned this May 25, 2022
@Szarny Szarny changed the title Add feature to show piped config on Web UI with masked form Add feature to show piped config on Web UI with masked style May 25, 2022
Co-authored-by: Khanh Tran <[email protected]>
Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

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

Go bold 🙌

@khanhtc1202
Copy link
Member

@Szarny Even though I approved this pull, we will not merge this until the version v0.32.1 can be released, so please be informed.

@Szarny
Copy link
Contributor Author

Szarny commented May 31, 2022

until the version v0.32.1 can be released

/hold

@khanhtc1202
Copy link
Member

/hold cancel

Comment on lines 808 to 815
func deepcopy(dst interface{}, src interface{}) error {
b, err := json.Marshal(src)
if err != nil {
return err
}

return json.Unmarshal(b, dst)
}
Copy link
Member

Choose a reason for hiding this comment

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

How about making it less generic?
For example, adding a Clone function to the config package.

func (c *Config) Clone() (*Config, error) {
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I implement Clone method to *PipedSpec with this commit based on the following reasons

  • Config has many fields, and there are many things to consider, such as whether it is initialized or not or what kind it is, therefore, the complexity of this PR will increase if we try to implement it in this PR.
  • currently, there is no need to generate clones other than PipedSpec

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! That is fine.

if s.SecretManagement != nil {
s.SecretManagement.Mask()
}
}
Copy link
Member

@nghialv nghialv Jun 1, 2022

Choose a reason for hiding this comment

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

I wish a function could iterate all fields to execute the Mask function on them.
But I understand it can be done like this for now. So it is ok.

@nghialv
Copy link
Member

nghialv commented Jun 1, 2022

@Szarny Just a nit comment. After that, we can merge this. Great work!

Copy link
Member

@nghialv nghialv left a comment

Choose a reason for hiding this comment

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

Well done. Thank you.

@Szarny Szarny merged commit 6f722eb into pipe-cd:master Jun 1, 2022
knanao added a commit that referenced this pull request Jun 2, 2022
knanao added a commit that referenced this pull request Jun 2, 2022
@github-actions github-actions bot mentioned this pull request Jun 3, 2022
khanhtc1202 added a commit that referenced this pull request Jun 3, 2022
khanhtc1202 added a commit that referenced this pull request Jun 3, 2022
@github-actions github-actions bot mentioned this pull request Jun 8, 2022
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.

Better UI that helps users to know if the piped has been updated successfully or not

4 participants