-
Notifications
You must be signed in to change notification settings - Fork 156
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
Ensure to generate file creation URL #635
Conversation
The following ISSUES will be created once got merged. If you want me to skip creating the issue, you can use Details1. Allow users to specify git hostThis was created by todo plugin since "TODO:" was found in 45fe033 when #635 was merged. cc: @nakabonne. |
/todo skip |
/cc @cakecatz |
Code coverage for golang is
|
@@ -331,6 +332,8 @@ message DeploymentConfigTemplate { | |||
string name = 2 [(validate.rules).string.min_len = 1]; | |||
repeated DeploymentConfigTemplateLabel labels = 3; | |||
string content = 4 [(validate.rules).string.min_len = 1]; | |||
// An HTML link to create a new file under the git path, with template content as default value. | |||
string file_creation_link = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: file_creation_url
pkg/app/api/api/web_api.go
Outdated
} | ||
for _, t := range templates { | ||
g := app.GetGitPath() | ||
t.FileCreationLink, err = git.MakeFileCreationURL(g.GetRepo().GetRemote(), g.GetPath(), g.GetRepo().GetBranch(), ".pipe.yaml", t.Content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: g.Repo.Remote
, g.Repo.Branch
, g.Path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file name should be the specified one if config_file_name
was not nil.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly! thanks!
Very nice feature. |
Fixed |
Thank you. |
Code coverage for golang is
|
What this PR does / why we need it:
Each deployment config template comes with a file creation URL, which is for creating a new file under the git path, with template content as default value. Something like:
https://github.com/pipe-cd/debug/new/master/kubernetes/analysis-by-metrics?filename=.pipe.yaml&value=%23+This+configures+a+non-progressive+delivery.%0AapiVersion%3A+pipecd.dev%2Fv1beta1%0Akind%3A+KubernetesApp%0Aspec%3A%0A++input%3A%0A++++manifests%3A%0A++++++-+deployment.yaml%0A++++++-+service.yaml%0A++++kubectlVersion%3A+2.1.1
Whereas, I'm getting an issue about specifying filename: isaacs/github#1527. I'll be glad to address it later.
Which issue(s) this PR fixes:
Fixes #627
Does this PR introduce a user-facing change?: