Commit Graph

12 Commits

Author SHA1 Message Date
Jan Stancek 3c3feefed9 redhat: drop Y issues from changelog
JIRA: INTERNAL
Upstream Status: RHEL-only

Signed-off-by: Jan Stancek <jstancek@redhat.com>
2025-03-26 13:58:00 +01:00
Jan Stancek b9e094da37 redhat: rewrite genlog and support Y- tags
Bugzilla: INTERNAL
Upstream Status: RHEL only

Rewrite genlog to make it easier to support different
tags used in downstream releases, and where applicable
also use same regexes as in CKI/kernel webhooks.

Goal is to make various parsers (genlog, kmt, KWF)
as similar as possible.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
2023-12-11 17:19:06 +01:00
Herton R. Krzesinski 3c8c801dd9 redhat: fix bug/zjira sort in the changelog
JIRA: INTERNAL
Upstream Status: RHEL only

Another small issue which I noted, even if it should become more rare as
time passes with Jira usage, is that if you have a mix of bugzilla and
jiras, it can list ystream bugs before zstream Jira issues.

Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2023-10-23 17:07:37 -03:00
Herton R. Krzesinski aa628b72c8 redhat: list Z-Jiras in the changelog before Y-Jiras
Bugzilla: INTERNAL
Upstream Status: RHEL only

A while back Scott Weaver reported that when you have a zstream backport
referencing both y-stream and z-stream Jira issues, it would list in
them in the reverse order of what happens with bugzilla entries, eg.:

[2216500 2160149]
[RHEL-2160149 RHEL-2216500]

Thus keep the same behaviour as before, we list first the z-stream
tickets and then the related y-stream tickets in the kernel changelog.

Reported-by: Scott Weaver <scweaver@redhat.com>
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2023-08-23 21:25:48 -03:00
Herton R. Krzesinski d7ce6487f7 redhat/genlog.py: add support to list/process zstream Jira tickets
Bugzilla: INTERNAL
Upstream Status: RHEL only

Even if we don't have the zstream process finalized yet for Jira, our
maintainer tooling already has some support for it and it can look for
Z-JIRA tags already. Also, we already have at least one case where
we have a Z-Stream bug with a Y-Stream Jira issue, and we need to make
sure the resolves line don't list the Y-Stream Jira issue.

This change adds support to list Z-Stream Jira issues in the changelog
while at the same time it also makes sure to avoid adding Y-Stream tickets
when we are doing Z-Stream work to the Resolves line.

Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2023-05-18 13:41:14 -03:00
Herton R. Krzesinski cb591aac6e redhat: fix duplicate jira issues in the resolves line
Bugzilla: INTERNAL
Upstream Status: RHEL only

The current genlog.py code does not check for duplicated jira issues
added to the resolves line. For bugzilla numbers, that check was present
when creating the resolved_bzs list.

To resolve it, convert everything to sets (which can't have duplicated
items), as such we don't need to do additional checks when printing the
resolves line. Also, make sure we sort not only the per changelog item
numbers, but also the items in the resolves line.

Fixes: a4f29a6648 ("redhat: add support for Jira issues in changelog")
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2023-02-22 17:04:43 -03:00
Herton R. Krzesinski a4f29a6648 redhat: add support for Jira issues in changelog
JIRA: https://issues.redhat.com/browse/RHEL-186
Upstream Status: RHEL only

RHEL will switch from Bugzilla to Jira for tickets. This adds support
for parsing and listing Jira issues in the changelog.

Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2023-01-16 16:06:59 -05:00
Herton R. Krzesinski 5c27bf1520 redhat: generate distgit changelog in genspec.sh as well
From: Jan Stancek <jstancek@redhat.com>

Bugzilla: INTERNAL
Upstream Status: RHEL only

Forward port of rhel-8 commit:

commit 924856ea3952cc52781d252be70f45c1231ee8ba
Author: Jan Stancek <jstancek@redhat.com>
Date:   Wed Mar 9 11:15:16 2022 +0100

    redhat: generate distgit changelog in genspec.sh as well

    Bugzilla: INTERNAL
    Upstream Status: RHEL only

    To break our dependence on ZSTREAM flag, make genlog.py generate
    also dist-git Resolves lines. Whether Resolves line uses ZBZs or YBZs,
    depends on whether genlog.py finds any ZBZs.

    After this change kernel.changelog* will start to contain also
    Resolves lines, which we need for dist-git changelog. For RPM changelog,
    we strip Resolves lines and use as before.

    Signed-off-by: Jan Stancek <jstancek@redhat.com>

Signed-off-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2022-03-11 14:01:37 -03:00
Herton R. Krzesinski b6e7bb5f9d redhat: make genspec prefer metadata from git notes
From: Jan Stancek <jstancek@redhat.com>

Bugzilla: INTERNAL
Upstream Status: RHEL only
Conflicts: rhel-9 genlog.py is using sets instead

Forward-port of rhel-8 commit:

commit fb48fa615c3e8ad4c613a4ae97caec9cabe6081f
Author: Jan Stancek <jstancek@redhat.com>
Date:   Wed Mar 9 09:58:53 2022 +0100

    redhat: make genspec prefer metadata from git notes

    Bugzilla: INTERNAL
    Upstream Status: RHEL only

    Rather than relying on ZSTREAM flag to choose between git notes and commit log,
    use both and make genlog.py prefer git notes.

    Signed-off-by: Jan Stancek <jstancek@redhat.com>

Signed-off-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2022-03-11 14:01:28 -03:00
Herton R. Krzesinski 1f6ceb992b redhat: use tags from git notes for zstream to generate changelog
From: Jan Stancek <jstancek@redhat.com>

Bugzilla: INTERNAL
Upstream Status: RHEL only

Conflicts: find_bz_in_line() is copied from rhel-8, because rhel-9 version
           didn't support BZ id without URL

Forward-port of rhel-8 patch:

commit cc89787cb88591e92c73a2b4ee432d50f36c5108
Author: Frantisek Hrbata <fhrbata@redhat.com>
Date:   Tue Mar 2 13:56:21 2021 +0100

    redhat: use tags from git notes for zstream to generate changelog

    Bugzilla: INTERNAL
    Upstream Status: RHEL only
    Tested: make rh-release for main and 8.3 branches and checked the
            generated changelog

    v2: - Use maj.min* notes ref for zstream. Previously only maj.min ref was
          used. This change allows kernel-rt to use their notes along with the
          zstream ones for rt specific patches.

    Previously for zstream we amended commit messages while applying patches from
    patchwork and we added tags: Bugzilla: ybzs, Z-Bugzilla: zbzs and CVE: cves
    if necessary. These were used by the genspec.sh to generate
    spec changelog for zstreams.

    Keeping the same approach with the gitlab workflow would mean to rebase
    commits in merge requests for zstream, which is something we probably
    don't want in the merge oriented workflow. Other approach would be to
    require these tags in the merge request commits. This would be fine for
    MRs created by maintainers, but could be confusing for others while
    creating zstream specific MRs. This would also require changes in
    bugzilla webhook.

    To avoid any additional requirements or changes in genlog.py, let's just
    use git notes to store zstream tags. The change is that zstream
    maintainer will not amend commit messages, but will be adding the
    required tags to git notes. With this change we will feed genlog.py with
    git notes instead of commit messages for zstreams. There should be no
    change for ystream.

    Each zstream is expected to have its own ref for notes based on the major
    and minor version. For example refs/notes/8.3 for 8.3.z. It's expected
    that maintainer makes sure the notes are presented and up-to-date.
    Fetching them automatically is IMHO not safe, because we cannot know the
    context.

    The format in git notes should be the same as expected by genlog.py.

     Bugzilla: ybzs
     Z-Bugzilla: zbzs
     CVE: cves

    Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>

Signed-off-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2022-03-11 13:55:57 -03:00
Mark Mielke 7542480366 Fix genlog.py to ensure that comments retain "%" characters. 2021-08-30 14:30:49 -04:00
Herton R. Krzesinski 9b733086a1 redhat: add genlog.py script
Upstream Status: RHEL only
Tested: verified changelog created after make rh-release

This change adds a separate python script that will generate changelog
items for the kernel RPM package, based on git log contents. It aims to
be a straight replacement of the current awk logic in redhat/genspec.sh.

I received review feedback from Jan Stancek, Frantisek Hrbata, Don
Zickus on an earlier version of the script, and this version contains
suggestions made by them.

Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2021-08-30 14:30:20 -04:00