softwarefactory-project / rdopkg

power to the packagers
Apache License 2.0
29 stars 21 forks source link

patch: incorrect behavior on certain patches branch cases #81

Closed yac closed 7 years ago

yac commented 7 years ago

rdopkg patch fails to work in cases when new patches branch has the same amount or less patches then previous one. Refactoring of the patches handling code (which was extended lately) is required to properly solve this and related issues.

ktdreyer commented 7 years ago

In a specific instance of this bug, in ceph I've seen rdopkg patch skip writing %changelog entries when I delete patches and add patches in the same operation.

  1. Start with a patch series containing commits "1" through "5". (These are all set in ceph.spec).
  2. Switch to the patches branch, rebase it and drop commits "2" and "3".
  3. Add seven more commits to the patches branch.
  4. Run rdopkg patch

Expected results: All seven new commits are listed in %changelog

Actual results: rdopkg skips the first two of the seven commits, and then adds the rest to %changelog

booxter commented 7 years ago

Just hit a bug that may be similar to this one, not reporting separately.

In my case, it was neutron, where I introduced a small change to one of backported patches; I then issued 'rdopkg patch', but it said that there are no new patches to regenerate. It generated changelog and bumped the version for me though. Consequent call to 'rdopkg update-patches' correctly regenerated the patches including my small change.

-bash-4.2$ rdopkg patch
## get_package_env
RHOS package detected.
## ensure_patches_branch
## get_patches_branch
git update-ref refs/heads/rhos-8.0-patches refs/remotes/rhos/rhos-8.0-patches
## check_new_patches
No new patches detected in rhos/rhos-8.0-patches.

Do you want to continue anyway? [Ny] y 

## update_spec
## commit_distgit_update
...

-bash-4.2$ rdopkg update-patches
## get_package_env
RHOS package detected.
## update_patches
git checkout rhos-8.0-patches
git checkout rhos-8.0-rhel-7
No valid patch filtering regex found in the spec file.
...
14 patches on top of 7.2.0, 1 excluded by base, 0 filtered out by regex.
...