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

setup_org_for_a_rh_repo fix #13970

Merged

Conversation

lhellebr
Copy link
Contributor

@lhellebr lhellebr commented Feb 1, 2024

Problem Statement

AttributeError: 'Manifest' object has no attribute 'path'

Solution

Follow idiom of creating a temporary file and into it, copying an in-memory object, then using it as a file.

I'm not sure how and when it got broken, I hit it when looking at the results of test_negative_without_attach_with_lce. I haven't yet tested extensively to make sure this doesn't break function _setup_org_for_a_rh_repo in other cases but it seems like it couldn't have worked.

@lhellebr lhellebr requested a review from a team as a code owner February 1, 2024 16:50
@lhellebr lhellebr added CherryPick PR needs CherryPick to previous branches 6.15.z Introduced in or relating directly to Satellite 6.15 labels Feb 1, 2024
@lhellebr
Copy link
Contributor Author

lhellebr commented Feb 2, 2024

Regression test, on a different test that uses setup_org_for_a_rh_repo and didn't crash with the AttributeError: 'Manifest' object has no attribute 'path' error before:

pytest tests/foreman/cli/test_activationkey.py::test_positive_create_content_and_check_enabled

It successfully fails the same way it fails without this PR, a few lines after a call for setup_org_for_a_rh_repo .

@Gauravtalreja1
Copy link
Collaborator

trigger: test-robottelo
pytest: tests/foreman/cli/test_activationkey.py::test_positive_add_redhat_and_custom_products tests/foreman/cli/test_host.py::test_negative_without_attach_with_lce tests/foreman/cli/test_reporttemplates.py::test_positive_generate_hostpkgcompare

@Gauravtalreja1
Copy link
Collaborator

@lhellebr Could you check the failing PRT results?

@lhellebr
Copy link
Contributor Author

First failure is unrelated error fixed by #13972 .
I very much suspect the second one to be the same case, two attempts to promote the CV. Either way, the test fails consistently in automation with the same error.

@lhellebr lhellebr requested a review from a team February 13, 2024 09:02
)
except CLIReturnCodeError as err:
raise CLIFactoryError(f'Failed to upload manifest\n{err.msg}') from err
self._satellite.upload_manifest(org_id, manifest.content)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@lhellebr I missed this earlier, similar changes are required for setup_org_for_a_rh_repo helper, could you update it too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we leave it for another PR? This PR is part of CE effort so I'm just doing what is required for that, changing as little as possible to minimize possibility of breaking stuff.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@lhellebr Sure, please make a note of it or create a issue for it for future, and when you raise a PR to fix it, let me know, thank you!

@Gauravtalreja1 Gauravtalreja1 added Easy Fix :) Easiest Fix to review and quick merge request. AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing labels Feb 14, 2024
@Gauravtalreja1 Gauravtalreja1 merged commit 0e1e489 into SatelliteQE:master Feb 14, 2024
7 of 8 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 14, 2024
* setup_org_for_a_rh_repo fix

* Use helper

(cherry picked from commit 0e1e489)
Gauravtalreja1 pushed a commit that referenced this pull request Feb 14, 2024
setup_org_for_a_rh_repo fix (#13970)

* setup_org_for_a_rh_repo fix

* Use helper

(cherry picked from commit 0e1e489)

Co-authored-by: Lukáš Hellebrandt <[email protected]>
shweta83 pushed a commit to shweta83/robottelo that referenced this pull request Apr 10, 2024
* setup_org_for_a_rh_repo fix

* Use helper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.15.z Introduced in or relating directly to Satellite 6.15 AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing CherryPick PR needs CherryPick to previous branches Easy Fix :) Easiest Fix to review and quick merge request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants