Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .jenkins/common_job_properties.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,15 @@ class common_job_properties {

// Sets the pull request build trigger.
static def setPullRequestBuildTrigger(def context,
def branchWhitelist,
def commitStatusContext,
def successComment = '--none--') {
context.triggers {
githubPullRequest {
admins(['asfbot'])
useGitHubHooks()
orgWhitelist(['apache'])
whiteListTargetBranches(branchWhitelist)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should have a default. Optimally, this default would be defined outside of this method, branchWhitelist would be set to it in the method definition, and the default would be commented. Please investigate doing so.

allowMembersOfWhitelistedOrgsAsAdmin()
permitAll()

Expand Down Expand Up @@ -140,9 +142,9 @@ class common_job_properties {
}

// Sets common config for PreCommit jobs.
static def setPreCommit(def context, comment) {
static def setPreCommit(def context, branches, comment) {
// Set pull request build trigger.
setPullRequestBuildTrigger(context, comment)
setPullRequestBuildTrigger(context, branches, comment)
}

// Sets common config for PostCommit jobs.
Expand Down
2 changes: 1 addition & 1 deletion .jenkins/job_beam_PreCommit_Java_MavenInstall.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mavenJob('beam_PreCommit_Java_MavenInstall') {
common_job_properties.setMavenConfig(delegate)

// Sets that this is a PreCommit job.
common_job_properties.setPreCommit(delegate, 'Jenkins: Maven clean install')
common_job_properties.setPreCommit(delegate, ['master'], 'Jenkins: Maven clean install')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pull ['master'] out into its own var, called something like 'build_branches' and commented. Investigate whether the standard precommit should run on any branch other than master as well.


// Maven goals for this job.
goals('-B -e -Prelease,include-runners,jenkins-precommit,direct-runner,dataflow-runner,spark-runner,flink-runner,apex-runner help:effective-settings clean install')
Expand Down
38 changes: 38 additions & 0 deletions .jenkins/job_beam_PreCommit_Python_MavenInstall.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import common_job_properties

// This job defines the Python precommit which runs a maven install on python-sdk branch.
mavenjob('beam_PreCommit_Python_MavenInstall') {
description('Runs an maven install on the python-sdk branch.')

previousNames('beam_PreCommit_MavenVerify')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove. This job no longer exists.


// Execute concurrent builds if necessary.
concurrentBuild()

// Set common parameters.
common_job_properties.setTopLevelJobProperties(delegate, 'python-sdk')

// Sets that this is a PreCommit job.
common_job_properties.setPreCommit(delegate, ['python-sdk'], 'Jenkins: Python PreCommit')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As above, refactor ['python-sdk'] out into a commented var.


// Maven goals for this job.
goals('-B -e help:effective-settings clean install')
}