Skip to content

Change infarred to make it possible to serialize parsed args for every plugin #14

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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 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
xlsxwriter
Loading