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 trigger a parameterized Pipeline in PipelineRun reconciler #210

Merged

Conversation

JohnNiang
Copy link
Member

@JohnNiang JohnNiang commented Aug 30, 2021

What this PR dose

Make parameters in PipelineRunSpec available.

Why we need it

This PR is part of #41

Special notes

Upstream PR: jenkins-zh/jenkins-client#14

TODO

/kind feature

@ks-ci-bot ks-ci-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Aug 30, 2021
@ks-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: JohnNiang
To complete the pull request process, please assign linuxsuren after the PR has been reviewed.
You can assign the PR to them by writing /assign @linuxsuren in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ks-ci-bot ks-ci-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 30, 2021
@LinuxSuRen
Copy link
Member

One more checklist item might be: support trigger a parameterized Pipeline in CLI

@JohnNiang JohnNiang changed the title WIP: Make parameters in PipelineRunSpec available Make parameters in PipelineRunSpec available Aug 31, 2021
@ks-ci-bot ks-ci-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 31, 2021
@codecov
Copy link

codecov bot commented Aug 31, 2021

Codecov Report

Merging #210 (81ac8f8) into master (0fe858f) will increase coverage by 0.02%.
The diff coverage is 46.15%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #210      +/-   ##
=========================================
+ Coverage    5.56%   5.59%   +0.02%     
=========================================
  Files          79      79              
  Lines       21383   21392       +9     
=========================================
+ Hits         1190    1196       +6     
- Misses      20120   20123       +3     
  Partials       73      73              
Flag Coverage Δ
unittests 5.59% <46.15%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...lers/jenkins/pipelinerun/pipelinerun_controller.go 0.00% <0.00%> (ø)
controllers/jenkins/pipelinerun/utils.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0fe858f...81ac8f8. Read the comment docs.

@LinuxSuRen
Copy link
Member

hi @JohnNiang , could you provide an image for this PR?

@JohnNiang
Copy link
Member Author

hi @JohnNiang , could you provide an image for this PR?

Of course. Please test with docker image: johnniang/ks-devops-controller:trigger-with-params.

@JohnNiang JohnNiang changed the title Make parameters in PipelineRunSpec available Support trigger a parameterized Pipeline in PipelineRun reconciler Aug 31, 2021
@@ -127,7 +127,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
}

// first run
pipelineBuild, err := r.triggerJenkinsJob(devopsProjectName, pipelineName)
pipelineBuild, err := r.triggerJenkinsJob(devopsProjectName, pipelineName, &pr.Spec)
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Please consider adding a condition for this case.

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean, if an error is returned, add a condition into status.conditions, is that right?

Copy link
Member

Choose a reason for hiding this comment

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

Yes

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we can skip this error handling since the handling won't block this PR. And I'll fire another PR to handle it. What do you reckon?

Copy link
Member

Choose a reason for hiding this comment

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

OK.

@JohnNiang JohnNiang changed the title Support trigger a parameterized Pipeline in PipelineRun reconciler WIP: Support trigger a parameterized Pipeline in PipelineRun reconciler Sep 1, 2021
@ks-ci-bot ks-ci-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 1, 2021
@JohnNiang JohnNiang changed the title WIP: Support trigger a parameterized Pipeline in PipelineRun reconciler Support trigger a parameterized Pipeline in PipelineRun reconciler Sep 2, 2021
@ks-ci-bot ks-ci-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 2, 2021
Copy link
Member

@LinuxSuRen LinuxSuRen left a comment

Choose a reason for hiding this comment

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

/lgtm

@ks-ci-bot ks-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Sep 2, 2021
@LinuxSuRen LinuxSuRen merged commit db19554 into kubesphere:master Sep 2, 2021
@JohnNiang JohnNiang deleted the feat/trigger-pipeline-with-param branch September 2, 2021 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants