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

Rules: added option to update comment in update_rule command Fix #4116 #4471

Merged

Conversation

dynamic-entropy
Copy link
Contributor

@dynamic-entropy dynamic-entropy commented Mar 20, 2021

Rules: added option to update a comment in update_rule command Fix #4116

Modified CLI to allow users to update comment for a rule, with the "--comment" option.

update comment

@nsmith- Kindly review, if this is the desired behaviour.

@@ -1303,6 +1304,9 @@ def update_rule(rule_id, options, session=None):
if key == 'source_replica_expression':
rule.source_replica_expression = options['source_replica_expression']

if key == 'comment':
rule.comments = options['comment']
Copy link
Contributor

Choose a reason for hiding this comment

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

is this called 'comments' in the rule definition? hmmmm. that's a weird inconsistency. @bari12 what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes,

comments = Column(String(255))

And changing it to "comments" will demand changes in the "comment" option of add-rule command as well. But will surely be less involved than changing the rule definition to "comment".

Copy link
Contributor

Choose a reason for hiding this comment

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

One option is to change the client API to add comments as an alias of comment and eventually send a deprecation warning for the comment field name.

Copy link
Member

Choose a reason for hiding this comment

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

I think that is fine, to change it in the database is a bit more complicated obviously. But the alias is good.

@bari12 bari12 merged commit 22e8378 into rucio:master Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow updating rule comment
4 participants