Skip to content

Fixes #38484 - Incremental CCV updates no longer update all components to latest version #11411

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qcjames53
Copy link
Contributor

@qcjames53 qcjames53 commented Jun 10, 2025

What are the changes introduced in this pull request?

When running an update on a content view inside of a composite content view with the --propagate-all-composites flag set to true, we include all un-overridden child components in the new composite content view. When this is a major update (e.g. 1.0 -> 2.0) these components follow the `always update to latest version' checkbox. When this is a minor update (e.g. 1.0 -> 1.1), these components now maintain their original version.

Considerations taken when implementing this change?

This change in behavior is being introduced because users were applying one or two errata and finding that large swaths of otherwise unaffected products were being updated. Users will now have to manually create a major version if they would like to update other repositories after applying errata.

What are the testing steps for this pull request?

  1. Publish content view A so it has a missing erratum (A v1.0).
  2. Publish content view B (B v1.0).
  3. Publish composite content view X so that it contains A and B (X v1.0). Both A and B should have the 'always update to latest version' checkbox selected. Leave the 'auto-publish' setting on X off.
  4. Publish B again (B v2.0).
  5. Using hammer, run an incremental update on A v1.0 with --propagate-all-composites. This will create A v1.1 and X v1.1. If the bug still exists, X v1.1 will contain A v1.1 and B v2.0. If the bug is fixed, X v1.1 will contain A 1.1 and B v1.0.
  6. Run a full update on X v1.1 and update it to v2.0. A should be v1.1 and B should be v2.0.
  7. Test edge cases.

Copy link

sourcery-ai bot commented Jun 10, 2025

Reviewer's Guide

Refactors component override inclusion in content view publishing to respect incremental updates—restricting component upgrades to the previous version’s components for minor bumps rather than always using the latest.

Sequence Diagram for Conditional Component Fetching in include_other_components

sequenceDiagram
    participant Plan as "Actions_Katello_ContentView_Publish.plan()"
    participant IOC as "Actions_Katello_ContentView_Publish.include_other_components()"
    participant CV as "ContentView"
    participant CVPV as "ContentViewVersion (previous)"

    Plan->>IOC: call(override_components, content_view, major, minor)
    activate IOC

    IOC->>IOC: if override_components.present?
    alt override_components is present
        IOC->>IOC: is_incremental = (major && minor && minor > 0)
        alt Incremental Update (is_incremental is true)
            IOC->>CV: get_version(major, minor - 1)
            activate CV
            CV-->>CVPV: (lookup specific version)
            deactivate CV
            activate CVPV
            CVPV-->>IOC: components
            deactivate CVPV
            Note right of IOC: components_to_test = CVPV.components
        else Major or New Update (is_incremental is false)
            IOC->>CV: components (latest from current CV)
            activate CV
            CV-->>IOC: components
            deactivate CV
            Note right of IOC: components_to_test = CV.components
        end
        IOC->>IOC: Process components_to_test with override_components
    end
    IOC-->>Plan: updated_override_components
    deactivate IOC
Loading

Class Diagram: Changes to Actions::Katello::ContentView::Publish

classDiagram
  class Actions_Katello_ContentView_Publish {
    +plan(content_view, description, options)
    -include_other_components(override_components, content_view, major, minor)
  }
Loading

File-Level Changes

Change Details Files
Forward version parameters to include_other_components in the publish plan
  • Pass options[:major] and options[:minor] when calling include_other_components
app/lib/actions/katello/content_view/publish.rb
Enhance include_other_components to support incremental update semantics
  • Add major and minor arguments to the method signature
  • Determine components_to_test: use previous version’s components when minor > 0
  • Default to current components for initial or major publishes
  • Introduce inline documentation explaining the new logic
app/lib/actions/katello/content_view/publish.rb

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

@qcjames53
Copy link
Contributor Author

I still need to fill in the PR description and create a test case. I needed to move this issue to review ASAP so this PR is going up tonight.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @qcjames53 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Documentation: all looks good

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.

@qcjames53 qcjames53 force-pushed the 38484 branch 3 times, most recently from b0ee5ed to 1895e98 Compare June 10, 2025 20:43
@qcjames53
Copy link
Contributor Author

This PR is ready for review. I can't locate the trailing whitespace Rubocop is talking about; why is it not returning the problematic file?

@qcjames53
Copy link
Contributor Author

React test failures unrelated. Please re-run when reviewing as they will probably be fixed by then.

Copy link

@damoore044 damoore044 left a comment

Choose a reason for hiding this comment

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

Looks good to me and useful comments.
I wonder why assertions are seeing the new unfiltered CVV (B-v2.0), showing in the Composite (v1.1) after incremental update, but before publishing the Composite again (v2.0).

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.

2 participants