chore(*): cleanup unused code
Signed-off-by: Raito Bezarius <raito@lix.systems>
This commit is contained in:
parent
2a7b42ef6b
commit
914c28af91
|
@ -3,7 +3,6 @@ import multiprocessing
|
|||
import os
|
||||
import sys
|
||||
import graphlib
|
||||
from collections import defaultdict
|
||||
from collections.abc import Generator
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
@ -13,34 +12,23 @@ from buildbot.configurators import ConfiguratorBase
|
|||
from buildbot.plugins import reporters, schedulers, secrets, steps, util, worker
|
||||
from buildbot.process import buildstep, logobserver, remotecommand
|
||||
from buildbot.process.project import Project
|
||||
from buildbot.process.properties import Interpolate, Properties
|
||||
from buildbot.process.properties import Properties
|
||||
from buildbot.process.results import ALL_RESULTS, statusToString
|
||||
from buildbot.steps.trigger import Trigger
|
||||
from buildbot.util import asyncSleep
|
||||
from buildbot.www.authz.endpointmatchers import EndpointMatcherBase, Match
|
||||
from buildbot.www.oauth2 import OAuth2Auth
|
||||
from buildbot.changes.gerritchangesource import GerritChangeSource
|
||||
from buildbot.reporters.utils import getURLForBuild
|
||||
from buildbot.reporters.utils import getURLForBuildrequest
|
||||
from buildbot.process.buildstep import CANCELLED
|
||||
from buildbot.process.buildstep import EXCEPTION
|
||||
from buildbot.process.buildstep import SUCCESS
|
||||
from buildbot.process.results import worst_status
|
||||
from buildbot_nix.binary_cache import LocalSigner
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from buildbot.process.log import Log
|
||||
|
||||
from twisted.internet import defer, threads
|
||||
from twisted.internet import defer
|
||||
from twisted.logger import Logger
|
||||
from twisted.python.failure import Failure
|
||||
|
||||
from .binary_cache import S3BinaryCacheConfig
|
||||
|
||||
from .github_projects import (
|
||||
slugify_project_name,
|
||||
)
|
||||
|
||||
log = Logger()
|
||||
|
||||
class LixSystemsOAuth2(OAuth2Auth):
|
||||
|
@ -162,7 +150,6 @@ class BuildTrigger(steps.BuildStep):
|
|||
def run(self):
|
||||
self.running = True
|
||||
build_props = self.build.getProperties()
|
||||
source = f"nix-eval-lix"
|
||||
logs: Log = yield self.addLog("build info")
|
||||
|
||||
builds_to_schedule = list(self.jobs)
|
||||
|
@ -316,7 +303,6 @@ class NixEvalCommand(buildstep.ShellMixin, steps.BuildStep):
|
|||
msg = f"Failed to parse line: {line}"
|
||||
raise BuildbotNixError(msg) from e
|
||||
jobs.append(job)
|
||||
build_props = self.build.getProperties()
|
||||
filtered_jobs = []
|
||||
for job in jobs:
|
||||
system = job.get("system")
|
||||
|
@ -343,12 +329,14 @@ class NixEvalCommand(buildstep.ShellMixin, steps.BuildStep):
|
|||
all_deps = dict()
|
||||
for drv, info in drv_info.items():
|
||||
all_deps[drv] = set(info.get("inputDrvs").keys())
|
||||
|
||||
def closure_of(key, deps):
|
||||
r, size = set([key]), 0
|
||||
while len(r) != size:
|
||||
size = len(r)
|
||||
r.update(*[ deps[k] for k in r ])
|
||||
return r.difference([key])
|
||||
|
||||
job_set = set(( drv for drv in ( job.get("drvPath") for job in filtered_jobs ) if drv ))
|
||||
all_deps = { k: list(closure_of(k, all_deps).intersection(job_set)) for k in job_set }
|
||||
|
||||
|
@ -710,44 +698,6 @@ def gerritReviewCB(builderName, build, result, master, arg):
|
|||
|
||||
return dict(message=message, labels=labels)
|
||||
|
||||
def gerritStartCB(builderName, build, arg):
|
||||
message = "Buildbot started compiling your patchset\n"
|
||||
message += "on configuration: %s\n" % builderName
|
||||
message += "See your build here: %s" % build['url']
|
||||
|
||||
return dict(message=message)
|
||||
|
||||
def gerritSummaryCB(buildInfoList, results, status, arg):
|
||||
success = False
|
||||
failure = False
|
||||
|
||||
msgs = []
|
||||
|
||||
for buildInfo in buildInfoList:
|
||||
msg = "Builder %(name)s %(resultText)s (%(text)s)" % buildInfo
|
||||
link = buildInfo.get('url', None)
|
||||
if link:
|
||||
msg += " - " + link
|
||||
else:
|
||||
msg += "."
|
||||
|
||||
msgs.append(msg)
|
||||
|
||||
if buildInfo['result'] == util.SUCCESS:
|
||||
success = True
|
||||
else:
|
||||
failure = True
|
||||
|
||||
if success and not failure:
|
||||
verified = 1
|
||||
else:
|
||||
verified = -1
|
||||
|
||||
return dict(message='\n\n'.join(msgs),
|
||||
labels={
|
||||
'Verified': verified
|
||||
})
|
||||
|
||||
class GerritNixConfigurator(ConfiguratorBase):
|
||||
"""Janitor is a configurator which create a Janitor Builder with all needed Janitor steps"""
|
||||
|
||||
|
|
Loading…
Reference in a new issue