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

compare unified job deployments to DFG job deployments #12

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Packages
run: |
apk add findutils git python3 py3-pip shellcheck
pip3 install tox
pip3 install tox<4
- name: Checkout
uses: actions/checkout@v3
- name: Tox
Expand Down
11 changes: 10 additions & 1 deletion EoD-stuff/find-zuul-jobs-failures.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ def get_builds() -> list:
for pipeline in PIPELINES:
for job in JOBS:
build = get_last_build(project, branch, pipeline, job)
date = build.get('start_time', '')

if date and (datetime.now()
- datetime.fromisoformat(date)).days > 14:
build['result'] = '---'
build['log_url'] = ''

builds.append(Build(
project=project,
Expand Down Expand Up @@ -191,6 +197,8 @@ def find_failure_reason(url: str):


def get_bad_results(builds: list[Build]) -> dict:
successes = sum([build.result == 'SUCCESS' for build in builds])

builds = [build for build in builds
if (build.result not in ('SUCCESS', '---')
and build.log_url != '')]
Expand All @@ -216,7 +224,8 @@ def get_bad_results(builds: list[Build]) -> dict:
i += 1
progress(i, end)

print('Number of failed builds:', len(results))
failures = len(results)
print('Number of failed builds:', failures, '/', failures + successes)

return results

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### <span stype="color:blue">[gerrit-rechecks](gerrit-rechecks/README.md): Scripts to get the last comment in Gerrit by Data, Submit Changes to Gerrit Projects with "Depends-On" and Reverify Gerrit Changes.</span>
### <span stype="color:blue">[EoD-stuff](EoD-stuff/README.md): Scripts for making life easier to the Engineer on Duty :)</span>
### <span stype="color:blue">[provision](provision/README.md): Different implementation of ansible roles and playbooks to automate things.</span>
### <span stype="color:blue">[similarity-comparison](similarity-comparison/README.md): Scripts for comparison of infrared based jenkins jobs</span>
Engineer on Duty


![](https://github.com/RedHatCRE/toolbox/workflows/tests/badge.svg)
3 changes: 3 additions & 0 deletions similarity-comparison/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
jjs.db
jjs.xlsx
venv/**
9 changes: 9 additions & 0 deletions similarity-comparison/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
HOWTO
-----
virtualenv venv
. ./venv/bin/activate
pip install -r requirements.txt
python similarity-comparison.py



36 changes: 36 additions & 0 deletions similarity-comparison/infrared_agrs_patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/infrared/api.py b/infrared/api.py
index e88b2949..6fc7f77a 100644
--- a/infrared/api.py
+++ b/infrared/api.py
@@ -116,6 +116,12 @@ class InfraredPluginsSpec(SpecObject):
# unpack parsed arguments
nested_args, control_args, custom_args = parsed_args

+ # print to stdout and serialize nested agruments. Finally, terminate.
+ import pickle
+ print (nested_args)
+ with open('nested_args.pkl', 'wb') as f:
+ pickle.dump(nested_args, f)
+ exit(0)
if control_args.get('debug', None):
logger.LOG.setLevel(logging.DEBUG)

@@ -198,12 +204,18 @@ class SpecManager(object):

def run_specs(self, args=None):
spec_args = vars(self.parser.parse_args(args))
+ print(spec_args)
subcommand = spec_args.get('subcommand', '')
if not spec_args.get('no_log_commands'):
if self.execution_logger is None:
self.execution_logger = CoreServices.execution_logger_manager()
self.execution_logger.command()

+ # serialize subcommand
+ import pickle
+ with open('subcommand.pkl', 'wb') as f:
+ pickle.dump(subcommand, f)
+
if subcommand in self.spec_objects:
return self.spec_objects[subcommand].spec_handler(
self.parser, args=args)
4 changes: 4 additions & 0 deletions similarity-comparison/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
gitpython
requests
scikit-learn
dsariel marked this conversation as resolved.
Show resolved Hide resolved
xlsxwriter
Loading