Skip to content
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

Unretired packages loose changelog between initial rpmautospec conversion and retirement #232

Open
hroncok opened this issue Feb 5, 2025 · 0 comments

Comments

@hroncok
Copy link
Contributor

hroncok commented Feb 5, 2025

From https://pagure.io/fedora-infra/rpmautospec/issue/313

Consider this scenario involving a Fedora package:

  1. the package exists in dist-git with classic changelog in spec
  2. the package is converted to rpmautospec, a changelog file is created
  3. new commits happen, new automatic changelog entries
  4. the package is retired, and the changelog file is deleted
  5. the package is unretired, and the changelog file is restored

Now, the entire changelog from 3 is gone.

To reproduce, I chose the python-nbconvert package.

First, I ensured I was on a custom branch set to track my fork, to avoid actual retirement.

[python-nbconvert (rawhide)]$ fedpkg fork
[python-nbconvert (rawhide)]$ git switch -c nope
[python-nbconvert (nope)]$ git push -u churchyard nope
...
branch 'nope' set up to track 'churchyard/nope'.

Observe the changelog file:

$ head changelog 
* Fri Jan 21 2022 Fedora Release Engineering <[email protected]> - 6.4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Wed Jan 12 2022 Miro Hrončok <[email protected]> - 6.4.0-2
- Drop outdated unused BuildRequires of python3-mock
...

And the actual changelog:

$ rpmautospec generate-changelog | head
* Fri Jul 21 2023 Fedora Release Engineering <[email protected]> - 7.2.5-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Mon Jul 10 2023 Python Maint <[email protected]> - 7.2.5-7
- Rebuilt for Python 3.12
...

Notice they are a year and a half apart.

Now retire the package (safe to ^C after the commit is created):

[python-nbconvert (nope)]$ fedpkg retire "test retirement on custom branch"
rm '.gitignore'
rm 'changelog'
rm 'python-nbconvert.spec'
rm 'sources'
[nope 1157014] test retirement on custom branch
 5 files changed, 1 insertion(+), 291 deletions(-)
 delete mode 100644 .gitignore
 delete mode 100644 changelog
 create mode 100644 dead.package
 delete mode 100644 python-nbconvert.spec
 delete mode 100644 sources
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 8 threads
Compressing objects: 100% (1/1), done.
Writing objects: 100% (3/3), 297 bytes | 297.00 KiB/s, done.
^C

And unretire it as would releng:

[python-nbconvert (nope)]$ git revert HEAD
[nope 4f4377a] Revert "test retirement on custom branch"
 5 files changed, 291 insertions(+), 1 deletion(-)
 create mode 100644 .gitignore
 create mode 100644 changelog
 delete mode 100644 dead.package
 create mode 100644 python-nbconvert.spec
 create mode 100644 sources

Observe the git log:

[python-nbconvert (nope)]$ git log
commit 4f4377aed58641a3ee67a1606e681a1714706687 (HEAD -> nope)
Author: Miro Hrončok <[email protected]>
Date:   Tue Oct 10 12:27:54 2023 +0200

    Revert "test retirement on custom branch"
    
    This reverts commit 115701493506ff5ff0fb2611b4f3279b79cce3d4.

commit 115701493506ff5ff0fb2611b4f3279b79cce3d4
Author: Miro Hrončok <[email protected]>
Date:   Tue Oct 10 12:27:24 2023 +0200

    test retirement on custom branch

commit 02e04a536142a8d49155a82e29b50c400a7d8937 (origin/f39, churchyard/nope, rawhide)
Author: Fedora Release Engineering <[email protected]>
Date:   Fri Jul 21 11:37:43 2023 +0000

    Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
    
    Signed-off-by: Fedora Release Engineering <[email protected]>

commit 98bca7dc814b353938ae42d5118386e542e5ef81
Author: Python Maint <[email protected]>
Date:   Tue Jul 11 00:47:02 2023 +0200

    Rebuilt for Python 3.12
...

And the changelog:

[python-nbconvert (nope)]$ rpmautospec generate-changelog | head
* Fri Jan 21 2022 Fedora Release Engineering <[email protected]> - 6.4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Wed Jan 12 2022 Miro Hrončok <[email protected]> - 6.4.0-2
- Drop outdated unused BuildRequires of python3-mock
...

Notice how the last entry is from Jan 2022? It's the changelog file that has been just created by the unretirement.

Now commits won't restore anything:

[python-nbconvert (nope)]$ git commit --allow-empty -m "test"
[nope bf8a6e9] test
[python-nbconvert (nope)]$ rpmautospec generate-changelog | head
* Tue Oct 10 2023 Miro Hrončok <[email protected]> - 7.2.5-10
- test

* Fri Jan 21 2022 Fedora Release Engineering <[email protected]> - 6.4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
...
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

No branches or pull requests

1 participant