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

Implement the DSL for commentFilePath to fix #514 #709

Merged
merged 8 commits into from
Oct 21, 2018

Conversation

hibes
Copy link
Contributor

@hibes hibes commented Sep 13, 2018

No description provided.

Henry and others added 7 commits April 6, 2018 13:08
Changelog

Swapped two lines back that were swapped by accident.

Constructor use of commentFilePath

Add the GhprbCommentFile extension to the list of extensions
If the comment file was completely empty it was still read, surrounded
with a header and a footer, and posted as a comment on the pull request.
This is just noise IMHO.

This commit makes it so that the message stays empty if the file was empty.
@hibes
Copy link
Contributor Author

hibes commented Sep 13, 2018

@samrocketman, had some issues with the other PR (#637). This one has the collection of changes and is up to date with master.

samrocketman
samrocketman previously approved these changes Sep 14, 2018
Copy link
Member

@samrocketman samrocketman left a comment

Choose a reason for hiding this comment

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

code-wise looks ok to me. I'm not sure how to test this.

@Kentalot
Copy link

Maybe make a seed job and have it try to process a dsl with this option on?

@samrocketman
Copy link
Member

I don't have time to work on testing this at the moment since I'm preparing for Jenkins World next week where I'm presenting.

@Kentalot
Copy link

Oh, looking at your test infrastructure, it doesn't use groovy, which dsl requires, so unless testing can support groovy, that wouldn't be a good way to test. Looks like none of the other DSL gets tested. Just looking at the code of this merge, it looks reasonable.

README.md Outdated
@@ -144,6 +144,7 @@ job('upstreamJob') {
permitAll()
autoCloseFailedPullRequests()
displayBuildErrorsOnDownstreamBuilds()
commentFilePath("relative/path/to/file")

Choose a reason for hiding this comment

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

Actually, isn't this changed now according to this: #637 (comment)

@bjoernhaeuser ?

@samrocketman
Copy link
Member

Yeah, the job dsl testing happens manually at this time.

@hibes
Copy link
Contributor Author

hibes commented Sep 15, 2018

@samrocketman

Merging is blocked
Merging can be performed automatically with 1 approving review.

I pushed the README update requested by @Kentalot.

@samrocketman
Copy link
Member

I'm not working on this (or any open source projects) until after Jenkins World next week.

@Kentalot
Copy link

Kentalot commented Oct 8, 2018

@samrocketman Any updates on this one? 👍

@samrocketman
Copy link
Member

Not available for coding. Traveling on vacation at the moment.

@samrocketman
Copy link
Member

I will be back home Oct 17th. If you see no action in the week following that date feel free to ping me again to remind me.

Copy link
Contributor

@bjoernhaeuser bjoernhaeuser left a comment

Choose a reason for hiding this comment

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

I vote for merging.

@samrocketman
Copy link
Member

@bjoernhaeuser feel free to merge LGTM

@bjoernhaeuser bjoernhaeuser merged commit a438acd into jenkinsci:master Oct 21, 2018
@bjoernhaeuser bjoernhaeuser deleted the keymux-master branch October 21, 2018 19:18
@bjoernhaeuser
Copy link
Contributor

@samrocketman thanks for approving.

@Kentalot
Copy link

Awesome now that this is merged, any way we could get #682 merged? :)

@Kentalot
Copy link

Kentalot commented Nov 2, 2018

@bjoernhaeuser I tested this on my DSL job and it seems to not work as it somehow does not seem to find commentFilePath method that takes in a closure. Not sure what's happening. Your #664 update also fails with a similar error. I checked to make sure i have the latest ghprb plugin version (1.42.0). commitStatus and buildStatus extensions work just fine. I don't see anything wrong with your code and the only difference I could see between the working ones (commitStatus and buildStatus) and the non-working ones (commentFilePath and cancelBuildsOnUpdate) is the latter ones have their methods public. I doubt that's the issue, but I couldn't see any other difference.

Here's the error:

Processing DSL script PipelineJob.groovy
ERROR: (PullRequestTrigger.groovy, line 110) No signature of method: javaposse.jobdsl.dsl.helpers.triggers.TriggerContext.cancelBuildsOnUpdate() is applicable for argument types: (jobs.utils.builders.pipelines.scripts.PullRequestTrigger$_addTriggerTo_closure1$_closure2$_closure3$_closure6) values: [jobs.utils.builders.pipelines.scripts.PullRequestTrigger$_addTriggerTo_closure1$_closure2$_closure3$_closure6@6052ddc2]

and the code snippet:

extensions {
                    commitStatus {
                        context(gitStatus.toString())
                        triggeredStatus('Triggering Jenkins...')
                        startedStatus("Running $gitStatus on Jenkins...")
                        addTestResults(true)
                        completedStatus('SUCCESS', 'Tests passed')
                        completedStatus('FAILURE', 'Tests failed')
                        completedStatus('PENDING', 'Testing in progress...')
                        completedStatus('ERROR', 'Pipeline crashed')
                    }
                    buildStatus {
                        completedStatus('SUCCESS', successMessage)
                        completedStatus('FAILURE', failureMessage)
                        completedStatus('ERROR',
                                'There was an error in the infrastructure, please contact the Jenkins maintainer.')
                    }
                    cancelBuildsOnUpdate {
                        overrideGlobal(true)
                    }
                    commentFilePath {
                            commentFilePath(extraCommentFilePath)
                    }                    
                }

nosmo pushed a commit to nosmo/ghprb-plugin that referenced this pull request Dec 12, 2018
Implement the DSL for commentFilePath to fix jenkinsci#514
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants