-
Notifications
You must be signed in to change notification settings - Fork 897
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
Deprecate invalid custom attribute names #18538
Deprecate invalid custom attribute names #18538
Conversation
add_custom_attribute/miq_custom_set will now log a deprecation if we try to define or add a custom attribute name that is an invalid column name. https://bugzilla.redhat.com/show_bug.cgi?id=1662319 From: https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS SQL identifiers and key words must begin with a letter (a-z, but also letters with diacritical marks and non-Latin letters) or an underscore (_). Subsequent characters in an identifier or key word can be letters, underscores, digits (0-9), or dollar signs ($). Note that dollar signs are not allowed in identifiers according to the letter of the SQL standard, so their use might render applications less portable. The SQL standard will not define a key word that contains digits or starts or ends with an underscore, so identifiers of this form are safe against possible conflict with future extensions of the standard. Similar to https://bugzilla.redhat.com/show_bug.cgi?id=1558618
Checked commit jrafanie@eaad9fb with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 spec/models/mixins/custom_attribute_mixin_spec.rb
|
Adding @agrare and @tinaafitz to review since this will now log deprecations on refreshes/automate that try to create custom attributes with "non-column" characters such as spaces. We will eventually want automate/providers refreshes to either reject these or clean them up so they can be used in reporting, expressions, UI, like any other column. Currently, custom attributes coming from refresh/automate with spaces do not work in all areas of the product. |
@tinaafitz @agrare please review, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jrafanie Looks good.
Looks good to me, refresh doesn't use these accessors so we'll need to check these, cc @Ladas |
…s_in_custom_attributes Deprecate invalid custom attribute names
@jrafanie if this can be backported, can you add the hammer/yes label. |
…s_in_custom_attributes Deprecate invalid custom attribute names (cherry picked from commit a26aa9d) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1693722
Hammer backport details:
|
add_custom_attribute/miq_custom_set will now log a deprecation if we try
to define or add a custom attribute name that is an invalid column name.
https://bugzilla.redhat.com/show_bug.cgi?id=1662319
From:
https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
SQL identifiers and key words must begin with a letter (a-z, but also
letters with diacritical marks and non-Latin letters) or an underscore
(_). Subsequent characters in an identifier or key word can be letters,
underscores, digits (0-9), or dollar signs ($). Note that dollar signs
are not allowed in identifiers according to the letter of the SQL
standard, so their use might render applications less portable. The SQL
standard will not define a key word that contains digits or starts or
ends with an underscore, so identifiers of this form are safe against
possible conflict with future extensions of the standard.
Similar to https://bugzilla.redhat.com/show_bug.cgi?id=1558618