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

Update connexion to v3.0.6 #1776

Closed

Conversation

thearifismail
Copy link
Contributor

Overview

This Draft PR is being created to address RHINENG-8854. 11 tests still fail and need fixing.

PR Checklist

  • Keep PR title short, ideally under 72 characters
  • Descriptive comments provided in complex code blocks
  • Tests: validate optimal/expected output
  • Tests: validate exceptions and failure scenarios
  • Tests: edge cases
  • Recovers or fails gracefully during potential resource outages (e.g. DB, Kafka)
  • Uses type hinting, if convenient
  • Documentation, if this PR changes the way other services interact with host inventory
  • Links to related PRs

Secure Coding Practices Documentation Reference

You can find documentation on this checklist here.

Secure Coding 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

@thearifismail thearifismail requested a review from a team as a code owner June 4, 2024 20:49
@thearifismail thearifismail marked this pull request as draft June 4, 2024 21:22
@kruai
Copy link
Collaborator

kruai commented Jun 10, 2024

Regarding the tests that are still failing...

  • test_api_auth.py: Following the example set here, change this line to raise OAuthProblem("Invalid token"). Doing that resolves the auth issues.

  • test_culling.py: These 4 failing tests are returning 200 instead of 400 because strict_validation is now set to False (in this change). We either need to set it back to True and resolve the issue with Connexion's parsing of deep objects in query params, or we need to change the requirements and tests. IMO the first option is correct, though I personally don't know the best way to solve it.

  • test_custom_staleness.py: I'm having trouble narrowing down why the hosts aren't being deleted. It seems like the account-level custom staleness settings aren't factoring in, and it's using the system default values. @jpramos123 can you please take a look at the tests failing in this file and see if anything stands out to you?

@thearifismail
Copy link
Contributor Author

thearifismail commented Jun 10, 2024

Regarding the tests that are still failing...

* `test_api_auth.py`: Following the example set [here](https://github.com/spec-first/connexion/blob/main/examples/apikey/app.py#L16), change [this line](https://github.com/RedHatInsights/insights-host-inventory/blob/master/app/auth/__init__.py#L20) to `raise OAuthProblem("Invalid token")`. Doing that resolves the auth issues.

Done!

* `test_culling.py`: These 4 failing tests are returning 200 instead of 400 because `strict_validation` is now set to False ([in this change](https://github.com/RedHatInsights/insights-host-inventory/pull/1776/files#diff-9cec7b11237bc29d77a439e81c9b7acfac003d8e8855731eb6bc130b5a8ce602L213-R208)). We either need to set it back to True and resolve the issue with Connexion's parsing of deep objects in query params, or we need to change the requirements and tests. IMO the first option is correct, though I personally don't know the best way to solve it.

For now we should the requirements and tests and see if it has any ill-effects and file a defect to fix the problem correctly. One area of concern is how it affects iqe-tests.
I had a filed an issue with the connexion project and was asked to provide the exact and code and steps to reproduce the problem. Before telling them that host-iventory is an open source project, I wanted to look into trimming down the project and steps. That said, we should circle back to it after meeting the deadline.

* `test_custom_staleness.py`: I'm having trouble narrowing down why the hosts aren't being deleted. It seems like the account-level custom staleness settings aren't factoring in, and it's using the system default values. @jpramos123 can you please take a look at the tests failing in this file and see if anything stands out to you?

yes

@thearifismail
Copy link
Contributor Author

@jpramos123 Can you please check why querying the Staleness table does not find any record when there is one in the table. The test fails here https://github.com/thearifismail/insights-host-inventory/blob/5e83f619dd08a8329bb1dbfb2148be176a61046f/api/staleness_query.py#L18.
I am wondering if updating the flask_sqlalchemy version is causing the problem

thearifismail and others added 8 commits June 20, 2024 11:29
…atInsights#1772)

rh-pre-commit.version: 2.2.0
rh-pre-commit.check-secrets: ENABLED
…tion (RedHatInsights#1779)

* Add mechanism to remove cached keys by prefix using the org_id prefix
* Add decorator to get/list host APIs
* Add delete keys step to host APIs that alter/delete host data for cache invalidation
* Add delete keys step to MQ processing flow for cache invalidation
* Add delete keys step to host reaper flow for cache invalidation
@kruai
Copy link
Collaborator

kruai commented Jul 16, 2024

@thearifismail Please close this PR when you get the chance, since we upgraded in a different PR.

@kruai
Copy link
Collaborator

kruai commented Jul 16, 2024

oh wait, I can close it. never mind!

@kruai kruai closed this Jul 16, 2024
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.

4 participants