-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[BEAM-1376] Move website jobs to main Beam repo to reduce duplication. #1897
Conversation
R: @davorbonaci |
|
||
// GitHub project. | ||
context.properties { | ||
githubProjectUrl('https://github.com/apache/beam/') | ||
githubProjectUrl(repo_link + '/') |
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.
brittle
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.
I'm not sure it's even necessary to append the '/'. I believe this just sets the url on the job description page.
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.
You are appending .git below, and '/' here. If the given link ends with a '/' neither is correct. One of them is certainly mandatory, so things will fail.
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.
Gave this another shot -- just specifying repo name, which should be less prone to people adding trailing slashes. Thoughts?
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.
Great resolution!
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
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.
Nice ;-)
@@ -23,11 +23,12 @@ class common_job_properties { | |||
// Sets common top-level job properties. | |||
static def setTopLevelJobProperties(def context, | |||
def default_branch = 'master', | |||
def default_timeout = 100) { | |||
def default_timeout = 100, | |||
def repo_name = 'beam') { |
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.
repo_name -> repository_name
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.
Done
@@ -23,11 +23,12 @@ class common_job_properties { | |||
// Sets common top-level job properties. | |||
static def setTopLevelJobProperties(def context, | |||
def default_branch = 'master', |
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.
order parameters more naturally: context, repo, branch, timeout.
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.
Params are ordered in terms of likelihood of overriding of parameter, to most effectively use groovy default values. Can reorder, but will introduce unnecessary verbosity into the method calls in all the jobs. Thoughts?
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.
Refactored into methods -- I think it's cleaner this way.
@@ -0,0 +1,48 @@ | |||
import common_job_properties |
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.
Separate PR?
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.
Sure - will revert in next commit.
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.
Done
@@ -0,0 +1,66 @@ | |||
import common_job_properties |
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.
This file could logically stay there too. Is it feasible?
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.
Not feasible without doing ugly things inside the seed job. Seed job builds by cloning this repo and running all jobs inside the .jenkins folder -- we could hypothetically also manually clone the website repo, have its groovy jobs reference (essentially) ../../beam/.jenkins/common... but that seems to me to be a fairly brittle and undesirable solution.
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.
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.
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.
I've had bad experiences with submodules relevant to the article I posted there -- if you really want to use them I'll give it a shot, but I think the downsides are way larger than having these two (eventually three) files live in a different repository.
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.
My experience matches too.
Another alternative to consider: another Jenkins step before the DSL step that clones the other repository?
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.
Yeah I'd thought of that but I'm pretty resistant to having the jobs be dependent on the configuration of their environment to succeed -- if something goes wrong with the clone it could adversely affect the jobs running in Jenkins. Having all of our jenkins jobs defined in one place seems like a better choice.
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.
Alright -- stays as is.
@@ -0,0 +1,51 @@ | |||
import common_job_properties |
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.
Same as above.
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.
See above.
PTAL: @davorbonaci |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Signed-off-by: Jason Kuster <jasonkuster@google.com>
Signed-off-by: Jason Kuster <jasonkuster@google.com>
Signed-off-by: Jason Kuster <jasonkuster@google.com>
Signed-off-by: Jason Kuster <jasonkuster@google.com>
…operties. Signed-off-by: Jason Kuster <jasonkuster@google.com>
Signed-off-by: Jason Kuster <jasonkuster@google.com>
011427e
to
3c383fe
Compare
Refer to this link for build results (access rights to CI server needed): |
@@ -155,6 +169,12 @@ class common_job_properties { | |||
setPullRequestBuildTrigger(context, comment) | |||
} | |||
|
|||
static def setPreCommitWithSuccessComment(def context, |
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.
This doesn't seem necessary -- you have just one default and it is the last parameter.
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.
Sure -- removed.
'projects based on Jenkins DSL groovy files checked into the ' + | ||
'code repository.') | ||
job('beam_SeedJob') { | ||
description('Automatically configures all Apache Beam Jenkins projects based' + |
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.
space between "based" and "on"
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.
Done
static def setTopLevelJobProperties(def context, | ||
def default_branch = 'master', | ||
def default_timeout = 100) { | ||
// Sets common top-level job properties for website repo jobs. |
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.
repo -> repository (everywhere)
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.
Done.
@@ -0,0 +1,66 @@ | |||
import common_job_properties |
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.
Signed-off-by: Jason Kuster <jasonkuster@google.com>
@@ -20,14 +20,27 @@ | |||
// common properties that are shared among all Jenkins projects. |
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.
This is a continuation of the sentence on the above line -- capitalizing seems wrong here?
static def setTopLevelJobProperties(def context, | ||
def default_branch = 'master', | ||
def default_timeout = 100) { | ||
// Sets common top-level job properties for website repo jobs. |
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.
Done.
'projects based on Jenkins DSL groovy files checked into the ' + | ||
'code repository.') | ||
job('beam_SeedJob') { | ||
description('Automatically configures all Apache Beam Jenkins projects based' + |
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.
Done
@@ -0,0 +1,66 @@ | |||
import common_job_properties |
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.
Yeah I'd thought of that but I'm pretty resistant to having the jobs be dependent on the configuration of their environment to succeed -- if something goes wrong with the clone it could adversely affect the jobs running in Jenkins. Having all of our jenkins jobs defined in one place seems like a better choice.
@@ -155,6 +169,12 @@ class common_job_properties { | |||
setPullRequestBuildTrigger(context, comment) | |||
} | |||
|
|||
static def setPreCommitWithSuccessComment(def context, |
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.
Sure -- removed.
Refer to this link for build results (access rights to CI server needed): |
@@ -0,0 +1,66 @@ | |||
import common_job_properties |
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.
Alright -- stays as is.
@@ -150,9 +164,11 @@ class common_job_properties { | |||
} | |||
|
|||
// Sets common config for PreCommit jobs. | |||
static def setPreCommit(def context, comment) { | |||
static def setPreCommit(def context, | |||
def comment, |
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.
comment
is very ambiguous. commitStatusName
might be better.
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.
Done.
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.
LGTM. Merging.
Refer to this link for build results (access rights to CI server needed): |
Signed-off-by: Jason Kuster jasonkuster@google.com
Be sure to do all of the following to help us incorporate your contribution
quickly and easily:
[BEAM-<Jira issue #>] Description of pull request
mvn clean verify
. (Even better, enableTravis-CI on your fork and ensure the whole test matrix passes).
<Jira issue #>
in the title with the actual Jira issuenumber, if there is one.
Individual Contributor License Agreement.