def print_steps_for_failing_jobs(build_number):
    build_info = get_build_info(build_number)
    failing_jobs = get_failing_jobs(build_info)
    incompatible_flags = list(bazelci.fetch_incompatible_flags().keys())
    pipeline_steps = []
    for incompatible_flag in incompatible_flags:
        for job in failing_jobs:
            label = "%s: %s" % (incompatible_flag, job["name"])
            command = list(job["command"])
            command[
                1] = command[1] + " --incompatible_flag=" + incompatible_flag
            pipeline_steps.append(
                bazelci.create_step(label, command, job["platform"]))
    print(yaml.dump({"steps": pipeline_steps}))
Ejemplo n.º 2
0
def print_steps_for_failing_jobs(build_number):
    build_info = get_build_info(build_number)
    failing_jobs = get_failing_jobs(build_info)
    incompatible_flags = list(bazelci.fetch_incompatible_flags().keys())
    pipeline_steps = []
    for incompatible_flag in incompatible_flags:
        for job in failing_jobs:
            command = list(job["command"])
            command[
                1] = command[1] + " --incompatible_flag=" + incompatible_flag
            pipeline_steps.append({
                "label":
                "%s: %s" % (incompatible_flag, job["name"]),
                "command":
                command,
                "agents":
                job["agents"].copy(),
            })
    print(yaml.dump({"steps": pipeline_steps}))
def print_steps_for_failing_jobs(build_info):
    failing_jobs = get_failing_jobs(build_info)
    incompatible_flags = list(bazelci.fetch_incompatible_flags().keys())
    pipeline_steps = []
    counter = 0
    for incompatible_flag in incompatible_flags:
        for job in failing_jobs:
            counter += 1
            if counter > BUILDKITE_MAX_JOBS_LIMIT:
                continue
            label = "%s: %s" % (incompatible_flag, job["name"])
            command = list(job["command"])
            command[
                1] = command[1] + " --incompatible_flag=" + incompatible_flag
            pipeline_steps.append(
                bazelci.create_step(label, command, job["platform"]))
    if counter > BUILDKITE_MAX_JOBS_LIMIT:
        bazelci.eprint("We only allow " + str(BUILDKITE_MAX_JOBS_LIMIT) +
                       " jobs to be registered at once, skipping " +
                       str(counter - BUILDKITE_MAX_JOBS_LIMIT) + " jobs.")
    print(yaml.dump({"steps": pipeline_steps}))
#    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 argparse
import collections
import sys
import threading

import bazelci

INCOMPATIBLE_FLAGS = bazelci.fetch_incompatible_flags()

BUILDKITE_ORG = "bazel"

PIPELINE = "bazelisk-plus-incompatible-flags"


class LogFetcher(threading.Thread):
    def __init__(self, job, client):
        threading.Thread.__init__(self)
        self.job = job
        self.client = client
        self.log = None

    def run(self):
        self.log = self.client.get_build_log(self.job)