ploigos/ploigos-software-factory-operator

"DRY violations" with the TsscPipeline CR: Config/Helm repo

hatmarch opened this issue · 3 comments

(related to #133)

There are some "don't repeat yourself" / brittle double coding issues when defining a software pipeline (for jenkins, but this probably applies to any pipeline).

Consider the attached TsscPipeline resource. As coded it will run into an issue since the name of the pipeline's config repo COMES FROM THE PLATFORMS config.yml configmap (see deployment-config-repo line here).

There should not be this kind of tight (and transparent) coupling between the Pipeline CR and the Platform CR.

BUG: The deploy step(runner) in the pipeline fails with:

Error deploying to environment '
                                                       '(TEST): Error cloning repository '
                                                       '(http://gitea.devsecops.svc.cluster.local:3000/platform/reference-quarkus-mvn-cloud-resources_jenkins_workflow-standard.git): \n'

With Ploigos operator 0.2.2 and Ploigos jenkins library 0.17.0

EXPECTED: Pipeline attempts to clone the repo specified in destinationRepoName in the pipeline CR, in this case upstream-reference-app-config

tsscpipeline-tsscpipeline-jenkins-issue-git.yaml.zip

I would assume that at minimum the Platform should not be specifying a helm/config repo at the platform level in its platform config map. If however the config repo must ALWAYS be called that, then this should not be made available to the user via the TsscPipeline CR.

See also my comments in #133

@andykrohg considering the thread in the ploigos gchat, I would think at minimum the platform operator should not specify both the gitserver and the repo (url) as this is not a sensible default.

If we're going to "leave it to the devs" then that should be a value that is blank and must be provided in the ploigos config of the project of the pipeline. Ideally the pipeline would error out early if there is no deploy git repo specified

Sorted this out @hatmarch it never occurred to me to simply specify http://gitea:3000 as the git server url in the reference app, so we don't need to know the TsscPlatform's namespace to construct the url for the helm repo. I removed the platform-level property in v0.2.7 👍