Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-42236

CV needs publish is reset after deleing Publish task

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 6.16.6
    • Content Views
    • 2
    • False
    • Artemis Prioritized Backlog
    • sat-artemis
    • None
    • None
    • None
    • None

      Description of problem:

      Satellite has a tiny feature "CV needs publish?". This solely relies on presence of the CV publish task - whenever the task is deleted, the status gets unknown. Despite there are other means to retrieve the status.

       

      How reproducible:

      100%

       

      Is this issue a regression from an earlier version:

      probably not

       

      Steps to Reproduce:

      1. create a custom product and repo, upload there one RPM

      2. create two CVs with the one repo, and publish them

      3. check both CVs have needs_publish as False (WebUI shows no icon at newest CV version, `"needs_publish": false` in API response to either CV, `cv.needs_publish?` is False in `foreman-rake console`)

      4. upload a new RPM to the custom repo

      5. publish a new version of one of the CVs

      6. repeat step 3

      7. Delete the tasks that published the repos, e.g. via `foreman-rake foreman_tasks:cleanup:run TASK_SEARCH="label = Actions::Katello::ContentView::Publish"

      8. repeat step 3

       

      Actual behavior:
      Step 3 shows "False" for both "needs update?" status.

      Step 6 shows True for one CV (published just once) and False for the other (published twice)

      Step 8 shows no status for either CV

       

      Expected behavior:
      Step 8 to show status, regardless tasks have been deleted.

       

      Business Impact / Additional info:

      See https://github.com/Katello/katello/blob/master/app/models/katello/content_view.rb#L830:

       

            return false if unpublishable?
            return true unless latest_version_object
            return nil unless last_publish_task_success?
            return composite_cv_components_changed? if composite?
            # return true if the audit records clearly show we have unpublished changes
            return true if audited_changes_present? 

      Deleting CV Publish task, the "return nil unless last_publish_task_success?" step is executed. While - when no CV publish task is present - we should continue in evaluation, and esp. check `audited_changes_present?`.

       

      Anyway, I can be wrong with the direction of the fix, since the method is evaluated for so many different CVs setups..

       

      Investigate

       

            return nil unless last_publish_task_success? || !audited_changes_present? 
      
      

       

              Unassigned Unassigned
              rhn-support-pmoravec Pavel Moravec
              Vijaykumar Sawant Vijaykumar Sawant
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: