Skip to content

Add fixes for new inc update dep solving default: false - #22280

Merged
ianballou merged 1 commit into
SatelliteQE:masterfrom
ianballou:SAT-46503
Jul 28, 2026
Merged

Add fixes for new inc update dep solving default: false#22280
ianballou merged 1 commit into
SatelliteQE:masterfrom
ianballou:SAT-46503

Conversation

@ianballou

@ianballou ianballou commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Problem Statement

Incremental updates no longer use dependency solving by default.

Solution

Adds testing for the new incremental update default for no dependency solving. Also fixes test_positive_incremental_update_apply_to_envs_cvs which would fail due to a lack of dependency solving.

Related Issues

https://redhat.atlassian.net/browse/SAT-46503

Summary by Sourcery

Add API tests verifying incremental content view updates honor the resolve_dependencies flag and server default, and update existing errata incremental update test to explicitly enable dependency solving.

Tests:

  • Add a parametrized incremental update test covering resolve_dependencies=True, False, and default behavior for content view versions.
  • Update the incremental errata apply-to-envs-and-CVs test to set resolve_dependencies=True so dependency packages are included as expected.

@ianballou
ianballou requested a review from a team as a code owner July 27, 2026 19:15
@sourcery-ai

sourcery-ai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds API tests to verify the behavior of incremental content view updates with dependency solving enabled, disabled, and by default, and updates an existing incremental update test to explicitly enable dependency solving so it continues to pass under the new default (False).

File-Level Changes

Change Details Files
Add parametrized test to verify incremental content view update behavior with resolve_dependencies True, False, and omitted (default).
  • Introduce test_positive_inc_update_resolve_dependencies using pytest parametrization over resolve_dependencies values True, False, and None.
  • Create and sync a dedicated yum_9 repository, build a content view with an erratum inclusion filter, publish it, and perform incremental updates adding FAKE_9_YUM_SECURITY_ERRATUM.
  • Assert that the incremental update result is successful and that all 3 security errata were added regardless of resolve_dependencies.
  • Define expected direct errata packages vs. transitive dependency packages and assert the correct set is added depending on the resolve_dependencies setting.
tests/foreman/api/test_contentview.py
Ensure an existing incremental update test explicitly opts into dependency solving to remain compatible with the new default of disabled dependency solving.
  • Update the incremental_update payload in test_positive_incremental_update_apply_to_envs_cvs to include resolve_dependencies set to True so dependency packages are still pulled in as before.
tests/foreman/api/test_errata.py

Possibly linked issues

  • #[Failed-AutoCherryPick] - Fix incremental update errata test: PR implements the incremental update errata test fixes that the failed auto-cherry-pick issue refers to.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@ianballou ianballou added the No-CherryPick PR doesnt need CherryPick to previous branches label Jul 27, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The new test_positive_inc_update_resolve_dependencies hardcodes the expected RPM NEVRA names for direct and dependency packages; consider deriving these from the FAKE_9 fixtures or a shared helper so the test is less brittle to future fixture/content changes.
  • The test currently relies on response['output']['changed_content'][0] always referring to the CVV under test; if the API ever returns multiple entries or changes ordering, this could become flaky—consider filtering changed_content by content_view_version_id instead of indexing.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `test_positive_inc_update_resolve_dependencies` hardcodes the expected RPM NEVRA names for direct and dependency packages; consider deriving these from the FAKE_9 fixtures or a shared helper so the test is less brittle to future fixture/content changes.
- The test currently relies on `response['output']['changed_content'][0]` always referring to the CVV under test; if the API ever returns multiple entries or changes ordering, this could become flaky—consider filtering `changed_content` by `content_view_version_id` instead of indexing.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ianballou

Copy link
Copy Markdown
Contributor Author
* The new `test_positive_inc_update_resolve_dependencies` hardcodes the expected RPM NEVRA names for direct and dependency packages; consider deriving these from the FAKE_9 fixtures or a shared helper so the test is less brittle to future fixture/content changes.

The FAKE_9_YUM_UPDATED_PACKAGES constant has 8 packages (includes kangaroo), not the 7 security errata packages. There's no existing constant for "packages belonging to the 3 security errata" or "dependency packages of those errata."

* The test currently relies on `response['output']['changed_content'][0]` always referring to the CVV under test; if the API ever returns multiple entries or changes ordering, this could become flaky—consider filtering `changed_content` by `content_view_version_id` instead of indexing.

This is only a worry for composite content view versions.

@ianballou

Copy link
Copy Markdown
Contributor Author
trigger: test-robottelo
pytest: tests/foreman/api/test_contentview.py::TestContentViewPublishPromote::test_positive_inc_update_resolve_dependencies

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 16265
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_contentview.py::TestContentViewPublishPromote::test_positive_inc_update_resolve_dependencies --external-logging
Test Result : ================= 3 passed, 56 warnings in 1085.59s (0:18:05) ==================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Jul 27, 2026
Comment thread tests/foreman/api/test_contentview.py Outdated
assert set(added_errata) == set(FAKE_9_YUM_SECURITY_ERRATUM)

# Packages listed directly in the 3 security errata
direct_packages = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same as prev comment.

You could prob use FAKE_0_CUSTOM_PACKAGE_GROUP constants/_init__.py

@sambible sambible left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Aiden's suggestion is solid, good otherwise.

@aidenfine

Copy link
Copy Markdown
Contributor
* The new `test_positive_inc_update_resolve_dependencies` hardcodes the expected RPM NEVRA names for direct and dependency packages; consider deriving these from the FAKE_9 fixtures or a shared helper so the test is less brittle to future fixture/content changes.

The FAKE_9_YUM_UPDATED_PACKAGES constant has 8 packages (includes kangaroo), not the 7 security errata packages. There's no existing constant for "packages belonging to the 3 security errata" or "dependency packages of those errata."

* The test currently relies on `response['output']['changed_content'][0]` always referring to the CVV under test; if the API ever returns multiple entries or changes ordering, this could become flaky—consider filtering `changed_content` by `content_view_version_id` instead of indexing.

This is only a worry for composite content view versions.

I just saw your previous comment about the constants, after I posted my comments. Maybe add a comment making it more clear why you hard coded the package names and didn't you anything from the constants.

@aidenfine aidenfine left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@ianballou

Copy link
Copy Markdown
Contributor Author

I'm going to put the packages into constants, test locally, and then merge.

@ianballou
ianballou requested a review from a team as a code owner July 28, 2026 14:29
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Jul 28, 2026
@ianballou

Copy link
Copy Markdown
Contributor Author

Passed locally and comments settled!

@ianballou
ianballou merged commit 2464042 into SatelliteQE:master Jul 28, 2026
10 checks passed
@ianballou
ianballou deleted the SAT-46503 branch July 28, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No-CherryPick PR doesnt need CherryPick to previous branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants