Bug 1365495 - RPC interface to dump and load BRE rules
Summary: RPC interface to dump and load BRE rules
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Bugzilla
Classification: Community
Component: Internal Tools
Version: 4.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 4.4
Assignee: Matt Tyson 🤬
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-09 11:50 UTC by Romana Cadova
Modified: 2025-10-16 23:46 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-09-28 02:17:26 UTC
Embargoed:


Attachments (Terms of Use)

Description Romana Cadova 2016-08-09 11:50:17 UTC
Description of problem:
Would it be possible to export BRE rules somehow?

We would need this page with the name and other columns:
https://bugzilla.redhat.com/page.cgi?id=ruleengine/index.html

and the data under "Details" link of the above page for all the rules togehter in one file.

(Maybe the "Details" page from the top to "Add bugs to Rules Engine queue")

NOTE: Or please let us know if this is already possible and how to do it. We could not find it in bugzilla. Thanks.


Actual results: No export of BRE rules, as far as we know


Expected results: a file containing all BRE rules with "Details", something like this:

Name 	Active 	Run after 	Created 	Last modified 	Last hit 	Use Count 	Since Change 	
PEsubsysRHEL6 	Yes 	runs first 	2015-11-12 	6 days ago 	6 days ago 	355 	0

PEsubsysRHEL6 details
Rule name: 	PEsubsysRHEL6 (edit, clone)
Rule owner: 	
Rule description: 	Move PEsubsys release flags to the current release
Rule group: 	Red Hat
Run after: 	Runs first
Rule runs: 	periodically
Status: 	Enabled
Rule changes: 	9 (history)
Created: 	2015-11-12 16:46:01 EST by John Shortt <jshortt>
Last modified: 	2016-07-29 14:23:37 EDT by John Shortt <jshortt>
Last hit: 	2016-07-29 11:52:05 EDT
Total runs: 	355
Runs since last change: 	0
Total runs in last 7 days: 	0 (list *)
Total runs in last 24 hours: 	0 (list *)
Current rule

When:

    Classification is 'Red Hat'
    Product is 'Red Hat Enterprise Linux 6'
    Status is any of 'ASSIGNED' or 'NEW'
    Any Resolution
    Any Component
    Any Target Milestone
    Any Target Release
    Keywords is not 'Tracking'
    Any Group
    The 'rhel-6.0.0' flag is unset or '-'
    The 'rhel-6.1.0' flag is unset or '-'
    The 'rhel-6.2.0' flag is unset or '-'
    The 'rhel-6.3.0' flag is unset or '-'
    The 'rhel-6.4.0' flag is unset or '-'
    The 'rhel-6.4.z' flag is unset
    The 'rhel-6.5.0' flag is unset or '-'
    The 'rhel-6.5.z' flag is unset
    The 'rhel-6.6.0' flag is unset or '-'
    The 'rhel-6.7.0' flag is unset or '-'
    The 'rhel-6.8.0' flag is unset, '?', '+' or '-'
    The 'rhel-6.9.0' flag is unset or '?'
    'Assignee' 'is equal to any of the strings' 'acme, ahuang, arm-mgr, astone, bhu, brueckner, crose, dakershn, dbulkow, ddaney, ddutile, dledford, dmarlin, dmilburn, dnelson, dsowa, dzickus, earfvidso, framsay, gbeshers, gduarte, hpatil, hbrueckn, honli, hwkernel-mgr, isubrama, ivecera, jarod, Jes.Sorensen, jfeeney, jkacur, jkc, jkysela, jmcnicol, jmorgan, jmoebs, jogreene, jshortt, jsnitsel, jtakasha, kheib, knaru, lgoncalv, linville, lknipper, lszubowi, mjuszkie, mlangsdo, mpatelcz, msalter, mschmidt, mstowe, mwolf, ncroxon, nhorman, ohe, peterm, prarit, randerso, rrichter, ruwang, sassmann, sbest, sshwarts, sgruszka, srostedt, svemuri, tcamuso, torez, tvaden, vinschen, wefu, williams, xni, yanliu, yselkowi'

Then:

    No changes to the 'Status' value.
    No changes to the 'Resolution' value.
    No changes to the 'Target Milestone' value.
    No changes to the 'Target Release' value.
    No changes to the 'Keywords' value.
    No changes to the 'Group' value.
    No changes to the 'CC' value.
    Unset the 'rhel-6.8.0' flag
    Unset the 'rhel-6.5.0' flag
    Unset the 'rhel-6.7.0' flag
    Unset the 'rhel-6.2.0' flag
    Unset the 'rhel-6.3.0' flag
    Unset the 'rhel-6.6.0' flag
    Unset the 'rhel-6.4.0' flag
    Unset the 'rhel-6.1.0' flag
    Change the 'rhel-6.9.0' flag to '?' if it is currently unset
    No comment will be made.
    No notification will be sent.

QCI 1.0 auto set ack flags 	Yes 	PEsubsysRHEL6 	2016-07-21 	2016-07-21 	22 hours ago 	575 	44

QCI 1.0 auto set ack flags details
Rule name: 	QCI 1.0 auto set ack flags (edit, clone)
Rule owner: 	
Rule description: 	Set pm_ack, qa_ack, and devel_ack flags for all Red Hat Quickstart Installer (QCI) bugs that have milestone set to ga.
Rule group: 	Red Hat
Run after: 	PEsubsysRHEL6
Rule runs: 	on bug change
Status: 	Enabled
Rule changes: 	8 (history)
Created: 	2016-07-21 15:20:06 EDT by Ann Marie Rubin <arubin>
Last modified: 	2016-07-21 16:15:19 EDT by Ann Marie Rubin <arubin>
Last hit: 	2016-08-08 14:29:02 EDT
Total runs: 	592
Runs since last change: 	61
Total runs in last 7 days: 	18 (list *)
Total runs in last 24 hours: 	13 (list *)
Current rule

When:

    Classification is 'Red Hat'
    Product is 'Red Hat Quickstart Cloud Installer'
    Status is 'All open'
    Any Resolution
    Component is not 'Distribution'
    Target Milestone is 'ga'
    Any Target Release
    Keywords is not 'Tracking'
    Any Group
    The 'devel_ack' flag is unset or '?'
    The 'pm_ack' flag is unset or '?'
    The 'qa_ack' flag is unset or '?'
    The 'qci-1.0' flag is unset, '?' or '+'

Then:

    No changes to the 'Status' value.
    No changes to the 'Resolution' value.
    No changes to the 'Target Milestone' value.
    No changes to the 'Target Release' value.
    No changes to the 'Keywords' value.
    No changes to the 'Group' value.
    No changes to the 'CC' value.
    Change the 'devel_ack' flag to '+' if it is currently unset or '?'
    Change the 'qa_ack' flag to '+' if it is currently unset or '?'
    Change the 'qci-1.0' flag to '+' if it is currently unset or '?'
    Change the 'pm_ack' flag to '+' if it is currently unset or '?'
    Add a Private comment 'Since this issue was entered in bugzilla with the target milestone set to ga, the bug has been triaged and approved for inclusion in the QCI 1.0 release. The pm_ack, qa_ack, and devel_ack flags have been set to +. '
    No notification will be sent.

Comment 3 Matt Tyson 🤬 2016-09-07 00:48:15 UTC
We discussed this problem with Ludek in a bluejeans meeting yesterday.

The way to go here is to create an RPC interface that would allow you to download rules from one server and upload them to another.

Your team can then write scripts against this RPC interface to keep partner and production in sync.

You can create and test your rule on partner-bugzilla, and once you are satisfied with it, use the RPC interface to copy a rule from partner into production.

Proposed RPC calls:

- RuleEngine.list
Return a list of available rules, their IDs, names, enabled state etc.

- RuleEngine.create
Create a new rule.

- RuleEngine.update
Update the definition or name of an existing rule.  Also enable or disable a rule.

- RuleEngine.get
Fetch the definition of a rule.  The output of this RPC call can then be fed into the create or update functions, allowing rules to be copied between systems.


For the present I'm still envisioning rules being created through the web interface and then copied about via RPC.  Manually handcrafting rules through RPC might be possible.  It would require documenting the internal rule format, or creating a stable API to that format.  This could be done as a future task if required.

Romana, Would this solve the problems you are having?

Comment 4 Rony Gong 🔥 2016-09-21 03:22:13 UTC
QE can't verify this bug as pass, since exist bug 1377194 1377192

Comment 5 Matt Tyson 🤬 2016-09-21 23:37:32 UTC
> Actual results:
> xmlrpclib.Fault: <Fault 50: 'The function requires a rules argument, and that argument was not set.'>

The documentation for the RuleEngine.create function is wrong.


result = proxy.RuleEngine.update({'name':'test-qq', 'login': 'qgong', 'password': '******', 'id':262})

Actual results:
xmlrpclib.Fault: <Fault 50: 'The function requires a id argument, and that argument was not set.'>


The docs for the RuleEngine.update function is also telling lies.

Comment 6 Rony Gong 🔥 2016-09-22 06:27:25 UTC
Tested on QA environment(4.4.12059-2)
Result: Pass
Steps:
1.Could list, get, create and update rule engine by api now.

Comment 7 Matt Tyson 🤬 2016-09-28 02:17:26 UTC
This change is now live. If there are any issues, do not reopen this bug.
Instead, you should create a new bug and reference this bug.


Note You need to log in before you can comment on or make changes to this bug.