Debian Patching: Patch apply doesn't order patch ID's based on patch dependency

Bug #2003823 reported by Jessica Castelino
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Jessica Castelino

Bug Description

Brief Description
-----------------
When we apply a patch, it sorts the id list alphabetically and not based on the requires dependency.

Example:

If we have First_Patch, Second_Patch, Third_Patch and Fourth_Patch such that
Second_Patch requires First_Patch
Third_Patch requires Second Patch
Fourth_Patch requires Third_Patch

The patch apply ordering is [First_Patch, Fourth_Patch, Second_Patch, Third_Patch]

This will cause an error. The First_Patch will apply but the Fourth Patch will raise an error since the base commit wouldn't match (due to patch dependency on Third_Patch which hasn't yet been applied). As a result, we will be forced to apply one patch at a time.

This affects the "sw-patch apply --all" and vim that uses this API to apply patches.

The ideal ordering is [First_Patch, Second_Patch, Third_Patch, Fourth_Patch]

Severity
--------
Major

Steps to Reproduce
------------------
sw-patch upload First_Patch Second_Patch Third_Patch Fourth_Patch
sw-patch apply --all

Expected Behavior
------------------
Patches should be applied in the order [First_Patch, Second_Patch, Third_Patch, Fourth_Patch]

Actual Behavior
----------------
Patches are applied in the order [First_Patch, Fourth_Patch, Second_Patch, Third_Patch]

Reproducibility
---------------
100% reproducible

System Configuration
--------------------
All

Branch/Pull Time/Commit
-----------------------
24th January, 2022

Last Pass
---------
N/A

Timestamp/Logs
--------------
N/A

Test Activity
-------------
Developer Testing

Workaround
----------
N/A

Changed in starlingx:
assignee: nobody → Jessica Castelino (jcasteli)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to update (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/update/+/871745

Changed in starlingx:
status: New → In Progress
Ghada Khalil (gkhalil)
tags: added: stx.update
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to update (master)

Reviewed: https://review.opendev.org/c/starlingx/update/+/871745
Committed: https://opendev.org/starlingx/update/commit/305067a6e68eb3cfaecd6ab3a90d441c160d8a06
Submitter: "Zuul (22348)"
Branch: master

commit 305067a6e68eb3cfaecd6ab3a90d441c160d8a06
Author: Jessica Castelino <email address hidden>
Date: Wed Jan 25 17:24:48 2023 +0000

    Fix: Patch Apply Order

    When we apply a patch, we want the patch apply order to be
    such that the patch with the lowest dependency is applied first.
    For example:
    P2 requires P1
    P3 requires P2
    P4 requires P3
    Apply order: [P1, P2, P3, P4]
    Since P1 has the lowest dependency (None) followed by
    P2 (P1) followed by P3 (P2, P1) followed by P4 (P3, P2, P1).

    Test Plan:
    Tested different scenarios with unit test cases

    Closes-Bug: 2003823
    Signed-off-by: Jessica Castelino <email address hidden>
    Change-Id: Ic57d9e182179b1aa7c26028e941ede85b4b505f7

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Medium
tags: added: stx.8.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.