Skip to content

packagekit: link Red Hat issue references in changelogs - #23117

Open
tarunvashishth wants to merge 3 commits into
cockpit-project:mainfrom
tarunvashishth:packagekit-changelog-issue-links
Open

packagekit: link Red Hat issue references in changelogs#23117
tarunvashishth wants to merge 3 commits into
cockpit-project:mainfrom
tarunvashishth:packagekit-changelog-issue-links

Conversation

@tarunvashishth

Copy link
Copy Markdown

closes #17748

  • Linkify rhbz# and jira# references in update changelogs.
  • Apply linkification only on Red Hat-family distros (RHEL/Fedora/CentOS).
  • Add a mock update entry to make manual verification easy.

@Venefilyn Venefilyn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! In short I like it but atm I'm skeptical about how the Jira linking is supposed to work. The RHBZ can be made non-distro specific too

Comment thread pkg/packagekit/updates.jsx Outdated
Comment on lines +146 to +149
if (!text || !isRedHatBasedDistribution())
return text;

const issuePattern = /(rhbz|jira)#(\d+)/g;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can check for rhbz no matter the distro tbh. I don't think anyone else refers to their trackers as rhbz and it is quite normal to link to in regards to CVEs etc.

However, with Jira I agree that we should only link to it within RHEL-sphere, but is it common to write jira#1234? That feels very strange to me as it doesn't include the namespace at all like RHEL-1234.

Do you have links to where the jira#1234 syntax is used?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn’t find solid evidence that jira#1234 is being used; most Red Hat references I found are RHEL-1234. Should I drop the Jira part and add something like RHEL-1234?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if we use RHEL-1234 there are many many other projects in Jira, not to mention other Jira instances from other companies might have similar naming. Could you give the RH refs you found for RHEL-1234?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack. Then lets go with that for now.

So I'd request to make

  1. RHBZ linking not specific to Fedora-based distros
  2. Add checking for RHEL-\d+ for Fedora-based distros

At some point we change to an object with keys to a list with all the
objects in it and looking at ID instead. To make it work during manual
testing we need to update the syntax from object to array.

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
Comment thread pkg/packagekit/updates.jsx Outdated
const [, tracker, issueId] = match;
const href = tracker === "rhbz"
? `https://bugzilla.redhat.com/show_bug.cgi?id=${issueId}`
: `https://issues.redhat.com/browse/${issueId}`;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should now be https://redhat.atlassian.net

@Venefilyn
Venefilyn self-requested a review June 10, 2026 15:01
Comment on lines 381 to +383
} else {
description = <div className="changelog">{info.description}</div>;
descriptionFirstLine = renderChangelogWithIssueLinks(descriptionFirstLine);
description = <div className="changelog">{renderChangelogWithIssueLinks(info.description)}</div>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was checking this out now to see how it would look. There is one issue that makes me think we need to modify description for entries with markdown as well since these otherwise don't get changes. Which does create a bit of a jarring experience where some has links and some don't, or right out doesn't work at all as all changelog entries are markdown for the distro (feels like it on Fedora based on the results I get)

Image

While we can't change everything to markdown as it would break for some packages that are supposed to be plaintext, we could modify the markdown or the HTML generated from markdown as long as it doesn't match

  • [rhbz#1234](http...)
  • [rhbz#1234 'aria label'](http...)
  • <a href="http..." aria-label="aria label">rhbz#1234</a>

Probably the easiest is to detect if it's DOM in renderChangelogWithIssueLinks and in that case check that the text matched isn't directly within an anchor element. Then again matching wouldn't be that easy without converting to DOM first and searching for it I think..

@mvollmer WDYT?

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

Successfully merging this pull request may close these issues.

Clickable BZ links in update changelog

3 participants