Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mgorny
Copy link
Contributor

@mgorny mgorny commented Jul 12, 2025

Add a check that reports if a given package clobbers a package from the master repository. Since this only applies to some repositores (e.g. ::guru), it is optional (disabled by default).

Closes: #745

@mgorny mgorny requested a review from arthurzam July 12, 2025 13:47
@mgorny
Copy link
Contributor Author

mgorny commented Jul 12, 2025

@arthurzam, any idea how we could make it configured inside repository? I suppose that for the time being we can just explicitly add it to ::guru's CI.

@mgorny mgorny force-pushed the master-repo-clobber branch from 276314d to 9b5e01f Compare July 12, 2025 13:48
Copy link
Member

@arthurzam arthurzam left a comment

Choose a reason for hiding this comment

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

@arthurzam, any idea how we could make it configured inside repository? I suppose that for the time being we can just explicitly add it to ::guru's CI.

Look what we used for AcctCheck::load_ids_from_configuration. If current repo doesn't have it enabled, just raise SkipCheck

return f"package from repository ::{self.repository} clobbered"


class MasterPackageClobberedCheck(OverlayRepoCheck, OptionalCheck):
Copy link
Member

Choose a reason for hiding this comment

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

If you read qa-policy.conf and decide by it, you can drop OptionalCheck

@mgorny
Copy link
Contributor Author

mgorny commented Jul 12, 2025

Look what we used for AcctCheck::load_ids_from_configuration. If current repo doesn't have it enabled, just raise SkipCheck

Yeah, but I don't want ad-hoc design for now. Perhaps it would be better to have some kind of optional_pkgcheck_checks there. Anyway, I'm too tired to pursue this further.

@mgorny
Copy link
Contributor Author

mgorny commented Jul 13, 2025

Thinking about it further:

  1. We should skip packages if all versions in the master repository are masked (i.e. the package is being moved from ::gentoo to ::guru). Not sure how to test that, @arthurzam — perhaps a fix.patch that adds it to package.mask?
  2. I think this should be controlled via layout.conf — perhaps as new-packages-only = true. We could then also block them from clobbering master from package manager level. I'll mail gentoo-dev later.

@arthurzam
Copy link
Member

Thinking about it further:

1. We should skip packages if all versions in the master repository are masked (i.e. the package is being moved from `::gentoo` to `::guru`). Not sure how to test that, @arthurzam — perhaps a `fix.patch` that adds it to `package.mask`?

You can just add another package to ::master which is package.masked, and have it at ::guru, and nothing in expected.json. If you remove your code which checks masks - you should see result - and fail (since unexpected result), and with your code, everything passes.

@mgorny
Copy link
Contributor Author

mgorny commented Jul 14, 2025

Oh nice. Because of previous failures I've been hitting, I thought PN must match an actual keyword — but apparently not.

@mgorny mgorny force-pushed the master-repo-clobber branch from 4f86641 to ac44b4a Compare July 14, 2025 04:39
@mgorny
Copy link
Contributor Author

mgorny commented Jul 14, 2025

Updated.

@mgorny mgorny force-pushed the master-repo-clobber branch 2 times, most recently from deb36bd to d680cf0 Compare July 15, 2025 18:29
Add a check that reports if a given package clobbers a package from
the master repository.  Since this only applies to some repositores
(e.g. ::guru), it is optional (disabled by default).

Closes: pkgcore#745
Co-authored-by: Arthur Zamarin <[email protected]>
Signed-off-by: Michał Górny <[email protected]>
@mgorny mgorny force-pushed the master-repo-clobber branch from d680cf0 to 0a46565 Compare July 15, 2025 18:30
@mgorny mgorny deleted the master-repo-clobber branch July 15, 2025 18:32
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.

[New Check]: Packages from master repository clobbered

2 participants