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

[RHCLOUD-27273] Maintenance Endpoint to fix resourceDefinitions #1448

Merged

Conversation

mjholder
Copy link
Contributor

@mjholder mjholder commented Jan 20, 2025

BLOCKING: #1418

Link(s) to Jira

Description of Intent of Change(s)

The what, why and how.
This end point will correct any existing ResourceDefinitions with bad attributeFilters. In this case it's list values having an equal operation and string values having an in operation.

Local Testing

How can the feature be exercised?
How can the bug be exploited and fix confirmed?
Is any special local setup required?
Unit Tests cover the possible scenarios.

Checklist

  • if API spec changes are required, is the spec updated?
  • are there any pre/post merge actions required? if so, document here.
  • are theses changes covered by unit tests?
  • if warranted, are documentation changes accounted for?
  • does this require migration changes?
    • if yes, are they backwards compatible?
  • is there known, direct impact to dependent teams/components?
    • if yes, how will this be handled?

Secure Coding Practices Checklist Link

Secure Coding Practices Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

Copy link
Contributor

@astrozzc astrozzc left a comment

Choose a reason for hiding this comment

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

LGTM

for id in result:
resource_definition = ResourceDefinition.objects.get(id=id[0])
resource_definition.attributeFilter["operation"] = "equal"
resource_definition.save()
Copy link
Contributor

Choose a reason for hiding this comment

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

There shouldn't be a ton of these cases, so performance should be acceptable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did check our DB's for these cases and there were only 2 or 3 that would need a change.

@lpichler lpichler changed the title Maintenance Endpoint to fix resourceDefinitions [RHCLOUD-27273] Maintenance Endpoint to fix resourceDefinitions Jan 21, 2025
@mjholder mjholder merged commit 35d0da3 into RedHatInsights:master Jan 21, 2025
11 checks passed
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.

3 participants