Skip to content

ci/github-script/bot: only look at commit subject when deciding if a package is new/updated; refine regex#483759

Merged
philiptaron merged 2 commits into
NixOS:masterfrom
mdaniels5757:fix-package-label-bot
Jan 26, 2026
Merged

ci/github-script/bot: only look at commit subject when deciding if a package is new/updated; refine regex#483759
philiptaron merged 2 commits into
NixOS:masterfrom
mdaniels5757:fix-package-label-bot

Conversation

@mdaniels5757

@mdaniels5757 mdaniels5757 commented Jan 25, 2026

Copy link
Copy Markdown
Member

PR #483755 was labelled incorrectly, because the commit messages (but not the subjects) contained matching text.

The fix is to only look at the subject line.

Also, I missed that the regex for package update wasn't quite right: (?<!nixos\/\S+): [\w.-]+ (->|→) [\w.-]+ matches "plfit: python -> withPython", but shouldn't. I fixed this too, and anchored both regexes to ensure they aren't matching on unintended portions of a line.

Things done

@mdaniels5757 mdaniels5757 requested a review from qweered January 25, 2026 21:04
@mdaniels5757 mdaniels5757 force-pushed the fix-package-label-bot branch from f9de8ef to 8b376d0 Compare January 25, 2026 21:05
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions backport release-25.11 labels Jan 25, 2026
qweered
qweered previously approved these changes Jan 25, 2026
@mdaniels5757 mdaniels5757 force-pushed the fix-package-label-bot branch from 8b376d0 to c717c98 Compare January 25, 2026 21:11
@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 25, 2026
@mdaniels5757 mdaniels5757 force-pushed the fix-package-label-bot branch from f5c526c to 31876b4 Compare January 26, 2026 01:19
@mdaniels5757 mdaniels5757 requested a review from qweered January 26, 2026 01:19
@mdaniels5757 mdaniels5757 dismissed qweered’s stale review January 26, 2026 01:20

substantial changes made

@nixpkgs-ci nixpkgs-ci Bot removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 26, 2026
Comment thread ci/github-script/bot.js
const updatePackagePattern = /(?<!nixos\/\S+): [\w.-]+ (->|→) [\w.-]+/
const commitsIndicateUpdate = commitMessages.some((msg) =>
const updatePackagePattern =
/^(?<!nixos\/)\S+: [\w.-]*\d[\w.-]* (->|→) [\w.-]*\d[\w.-]*$/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

eventially we want to do checks based on actully changed attrs of packages, but for now its good enough

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Totally. The motivation for this change was that it triggered on #474456, because of the "plfit: python -> withPython" commit. Since every valid version has a digit in it, checking for a digit fixes this particular issue.

@mdaniels5757 mdaniels5757 changed the title ci/github-script/bot: only look at commit subject when deciding if a package is new/updated ci/github-script/bot: only look at commit subject when deciding if a package is new/updated; refine regex Jan 26, 2026
@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 26, 2026
@philiptaron philiptaron added this pull request to the merge queue Jan 26, 2026
Merged via the queue into NixOS:master with commit 4b727f1 Jan 26, 2026
54 of 56 checks passed
@nixpkgs-ci

nixpkgs-ci Bot commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

@mdaniels5757 mdaniels5757 deleted the fix-package-label-bot branch January 26, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions 8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants