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

Support for secret param in material #5991

Merged
merged 14 commits into from
Mar 26, 2019

Conversation

bdpiprava
Copy link
Contributor

@bdpiprava bdpiprava commented Mar 18, 2019

link to issue #6014

  • Enhanced UrlArgument to support originalValue, urlForCommandLine and forDisplay.
  • Add support for secret params in url and material password
  • Changed secret param template from #{SECRET[][]} to {{SECRET:[][]}}
  • Resolve secret params
    • Post-commit hook
    • MDU

@@ -140,7 +140,7 @@ private BuildCommand cleanWorkingDir(String workDir) {

private BuildCommand isRepoUrlChanged(String workDir) {
return test("-neq",
material.getUrlArgument().forCommandline(),
material.getUrlArgument().rawUrl(),
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be changed back to forCommandline()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -159,7 +159,7 @@ private BuildCommand cmdClone(String workDir, int cloneDepth) {
if (material.isShallowClone()) {
cloneArgs.add(format("--depth=%s", String.valueOf(cloneDepth)));
}
cloneArgs.add(material.getUrlArgument().forCommandline());
cloneArgs.add(material.getUrlArgument().rawUrl());
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be changed back to forCommandline()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@bdpiprava bdpiprava force-pushed the support_for_scret_param_in_material branch 4 times, most recently from 3843534 to bc026f8 Compare March 19, 2019 10:34
public String forDisplay() {
if (hasSecretParams()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We might have to change this, e.g https://#{SECRET[id][key]}:password@foo.com/bar.git how will this be handled?

@bdpiprava bdpiprava force-pushed the support_for_scret_param_in_material branch 5 times, most recently from 5a3c97e to a6c19ac Compare March 22, 2019 17:52
@bdpiprava bdpiprava force-pushed the support_for_scret_param_in_material branch from a6c19ac to e2dcab4 Compare March 26, 2019 04:38
@bdpiprava bdpiprava merged commit db5081f into gocd:master Mar 26, 2019
@bdpiprava bdpiprava deleted the support_for_scret_param_in_material branch March 26, 2019 12:22
naveenbhaskar pushed a commit to naveenbhaskar/gocd that referenced this pull request Mar 28, 2019
* Added method `rawUrl` in CommandArgument to get unresolved url.

* Updated usages of getUrl and forCommandLine

* Moving to use junit5. It was reverted back to junit4 in PR gocd#5964.

* Update UrlArgument to return appropraite value as part of rawUrl, forCommandLine, forDisplay for secret param

* Renamed rawUrl to originalArgument

* Use urlForCommandLine at appropreate places.

* Resolve secret params on post commit hook.

* Adding secret param support for material password.

* Resolve secret params for materials before build assignment to agent

* Changed secret param template to `${SECRET[][]}` from '#{SECRET[][]}`

* Removed deadcode.

* Changed Secrets params format to '{{SECRET:[][]}}'

* Always parse the password configured in  material

* Fixed few test failures
@maheshp maheshp mentioned this pull request Apr 2, 2019
12 tasks
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.

2 participants