Skip to content

Allow RULE_EXEC_CONTEXT column access by GenQuery1 - #829

Open
d-w-moore wants to merge 3 commits into
irods:mainfrom
d-w-moore:823.m
Open

Allow RULE_EXEC_CONTEXT column access by GenQuery1#829
d-w-moore wants to merge 3 commits into
irods:mainfrom
d-w-moore:823.m

Conversation

@d-w-moore

Copy link
Copy Markdown
Collaborator

No description provided.

@trel trel changed the title Allow RULE_EXEC_CONTEXTZ column access by GenQuery1 Allow RULE_EXEC_CONTEXT column access by GenQuery1 Aug 28, 2026
Comment thread irods/test/rule_test.py
Comment on lines +443 to +445
if self.sess.server_version < (4, 3):
self.skipTest("""RuleExec's "context" attribute not available before 4.3.0""")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check isn't necessary since iRODS 4.2 is EOL.

Assume the iRODS server is 4.3.0 or later.

Comment thread irods/test/rule_test.py
random_int = random.randint(1<<30, (1<<31)-1)
r = Rule(
self.sess,
body=f'''delay("<PLUSET>{n_minutes}m</PLUSET>") {{writeLine("serverLog","{random_int}")}}'''

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
body=f'''delay("<PLUSET>{n_minutes}m</PLUSET>") {{writeLine("serverLog","{random_int}")}}'''
body=f'''delay("<PLUSET>{n_minutes}m</PLUSET>") {{ writeLine("serverLog","{random_int}") }}'''

Comment thread irods/test/rule_test.py
random_int = random.randint(1<<30, (1<<31)-1)
r = Rule(
self.sess,
body=f'''delay("<PLUSET>{n_minutes}m</PLUSET>") {{writeLine("serverLog","{random_int}")}}'''

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider specifying the value to <PLUSET> as seconds instead of using the minutes (m) suffix.

Comment thread irods/test/rule_test.py
rule_id = l[0][RuleExec.id]

# Assert context exists, is of string type, and is not empty.
self.assertGreater(l[0][RuleExec.context], "")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also assert that RULE_EXEC_CONTEXT is parsable as a JSON string since that is how it is stored in the database.

Comment thread irods/test/rule_test.py
self.assertRegex(lines[1], r"\[STRING\]\[A String\]")


def test_rule_exec_context(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use more words to describe what the test is about. For example:

def test_RULE_EXEC_CONTEXT_column_is_available_via_genquery1(self):

Comment thread irods/test/rule_test.py
self.assertRegex(lines[1], r"\[STRING\]\[A String\]")


def test_rule_exec_context(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing issue number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants