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

[BEAM-1376] Move website jobs to main Beam repo to reduce duplication. #1897

Closed
wants to merge 8 commits into from

Conversation

jasonkuster
Copy link
Contributor

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:

  • Make sure the PR title is formatted like:
    [BEAM-<Jira issue #>] Description of pull request
  • Make sure tests pass via mvn clean verify. (Even better, enable
    Travis-CI on your fork and ensure the whole test matrix passes).
  • Replace <Jira issue #> in the title with the actual Jira issue
    number, if there is one.
  • If this contribution is large, please file an Apache
    Individual Contributor License Agreement.

@jasonkuster
Copy link
Contributor Author

R: @davorbonaci


// GitHub project.
context.properties {
githubProjectUrl('https://github.com/apache/beam/')
githubProjectUrl(repo_link + '/')
Copy link
Member

Choose a reason for hiding this comment

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

brittle

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

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

Great resolution!

@asfbot
Copy link

asfbot commented Feb 2, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/6986/
--none--

@asfbot
Copy link

asfbot commented Feb 2, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/6987/
--none--

@asfbot
Copy link

asfbot commented Feb 2, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/6989/
--none--

@asfbot
Copy link

asfbot commented Feb 2, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/6991/
--none--

Copy link
Member

@davorbonaci davorbonaci left a 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') {
Copy link
Member

Choose a reason for hiding this comment

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

repo_name -> repository_name

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

@@ -23,11 +23,12 @@ class common_job_properties {
// Sets common top-level job properties.
static def setTopLevelJobProperties(def context,
def default_branch = 'master',
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Contributor Author

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
Copy link
Member

Choose a reason for hiding this comment

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

Separate PR?

Copy link
Contributor Author

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.

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

@@ -0,0 +1,66 @@
import common_job_properties
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above.

@jasonkuster
Copy link
Contributor Author

PTAL: @davorbonaci

@asfbot
Copy link

asfbot commented Feb 2, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/7016/
--none--

@asfbot
Copy link

asfbot commented Feb 2, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/7017/
--none--

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>
@asfbot
Copy link

asfbot commented Feb 2, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/7026/
--none--

@@ -155,6 +169,12 @@ class common_job_properties {
setPullRequestBuildTrigger(context, comment)
}

static def setPreCommitWithSuccessComment(def context,
Copy link
Member

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.

Copy link
Contributor Author

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' +
Copy link
Member

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"

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

static def setTopLevelJobProperties(def context,
def default_branch = 'master',
def default_timeout = 100) {
// Sets common top-level job properties for website repo jobs.
Copy link
Member

Choose a reason for hiding this comment

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

repo -> repository (everywhere)

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.

@@ -0,0 +1,66 @@
import common_job_properties
Copy link
Member

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.
Copy link
Contributor Author

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.
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.

'projects based on Jenkins DSL groovy files checked into the ' +
'code repository.')
job('beam_SeedJob') {
description('Automatically configures all Apache Beam Jenkins projects based' +
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

@@ -0,0 +1,66 @@
import common_job_properties
Copy link
Contributor Author

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,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure -- removed.

@asfbot
Copy link

asfbot commented Feb 3, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/7038/
--none--

@@ -0,0 +1,66 @@
import common_job_properties
Copy link
Member

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,
Copy link
Member

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.

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.

Signed-off-by: Jason Kuster <jasonkuster@google.com>
Copy link
Member

@davorbonaci davorbonaci left a comment

Choose a reason for hiding this comment

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

LGTM. Merging.

@asfgit asfgit closed this in 1533d70 Feb 3, 2017
@asfbot
Copy link

asfbot commented Feb 3, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/7044/
--none--

@jasonkuster jasonkuster deleted the website-jobs branch February 3, 2017 01:19
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.

None yet

3 participants