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

Support annotations to silence warnings in ebuilds #478

Open
thesamesam opened this issue Oct 20, 2022 · 8 comments · May be fixed by #535
Open

Support annotations to silence warnings in ebuilds #478

thesamesam opened this issue Oct 20, 2022 · 8 comments · May be fixed by #535

Comments

@thesamesam
Copy link
Member

thesamesam commented Oct 20, 2022

I thought we had a bug for this, huh.

We need a way to annotate ebuilds to disable warnings where there's either a policy exemption for something (think e.g. toolchain ebuilds which often do something gnarly), or the warning is a false positive (see #359 for TarballAvailable, #214 for MissingUnpackerDep).

In previous discussions, we've agreed it'd be best to have it be ebuild-wide (so any annotations would affect the whole ebuild) instead of trying to do it per-line (given it's hard to then restrict for all checks, it'd be ugly if you had to place it on a specific line above or so, and it's not worth the complexity).

@kuraga
Copy link

kuraga commented Jan 29, 2023

So, #pragma-like statements .ebuild files.

...and: per-package, per-atom (and per-category?) configuration of pkgcheck (#533).

@thesamesam
Copy link
Member Author

thesamesam commented Jan 29, 2023

Per-atom would be covered if they were within the ebuild itself.

I don't know if I see the need to do it per-package or per-category if you can put a small set of statements at the e.g. top of an ebuild to silence relevant warnings. I suspect it would not be worth the effort to implement a new config file for it and standardise it. Example use cases would help if you're really keen on the idea of per-package or per-category.

@kuraga
Copy link

kuraga commented Jan 29, 2023

@thesamesam, but a maintainer turns off warnings in .ebuild meanwhile pkgcheck's config is used by an end-user.

@thesamesam
Copy link
Member Author

thesamesam commented Jan 29, 2023

Again, could you give a more specific use case? You can already disable warnings on the command line if you want. I don't see it as being a very common use case to scan a repo where you have no control over its contents (=> can't fix the issues or add annotations), and then to want to ignore specific warnings but still see them for other packages.

I get that it's something one might want to do, but I'm not getting why this is a common or normal thing someone would want to do (and hence worth spending time on).

@kuraga
Copy link

kuraga commented Jan 29, 2023

Well, of this, I think a such control would be much easier to implement. And we will able to reduce/make an "acceptable" version of https://qa-reports.gentoo.org/output/gentoo-ci/output.html (how do people read it?).

@thesamesam
Copy link
Member Author

I'm just asking why you think it'd be useful. What use case would it enable?

You would scan your own packages anyway? There's really not that many one would need to silence.

Note that qa-reports.gentoo.org already lets you request per-maintainer output (it's just not advertised very well, try ;maintainer=...).

arthurzam added a commit to arthurzam/pkgcheck that referenced this issue Jan 29, 2023
Add support for an ebuild to declare a skip annotation for a class of
*version* results. This skip annotation must be declared before any
non-comment non-empty line (most of the times it would be before the
EAPI declaration). Empty lines between the copyright and the annotation
are allowed.
The annotation line must be precise, only one class per line and every
space is required.

For example, it would look like:

  # Copyright 2023 Gentoo Authors
  # Distributed under the terms of the GNU General Public License v2

  # pkgcheck skip: PythonCompatUpdate

  EAPI=8

Resolves: pkgcore#478
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
@arthurzam arthurzam linked a pull request Jan 29, 2023 that will close this issue
4 tasks
@radhermit
Copy link
Contributor

radhermit commented Jan 29, 2023

Does gentoo-ci still use the XML reporter format? If it moved to the JSON stream version instead one could use pkgcheck replay to replay the entire CI stream for a given tree snapshot, filtering it how you'd like (per package, per category, etc). Obviously if this is done then it's probably also a good idea to start versioning the JsonStream format (for compatibility purposes when loading old files) and tracking Result object changes that break compat.

Anyway, I implemented the JsonStream reporter support especially for CI usage. As an example see how the pkgcheck-action github action works and Gentoo's official CI could support the same functionality if it wanted for archived result records.

Alternatively it's possible to add deserialization support for some type of XML record format (so pkgcheck replay could replay xml result files), but that would probably require using a separate XML record format output (similar to how there are JsonStream and JsonReporter reporters).

@mgorny
Copy link
Contributor

mgorny commented Jan 30, 2023

Apparently it does but it's not really relevant, as CI has its own filtering pipeline.

arthurzam added a commit to arthurzam/pkgcheck that referenced this issue Mar 7, 2023
Add support for an ebuild to declare a skip annotation for a class of
*version* results. This skip annotation must be declared before any
non-comment non-empty line (most of the times it would be before the
EAPI declaration). Empty lines between the copyright and the annotation
are allowed.
The annotation line must be precise, only one class per line and every
space is required.

For example, it would look like:

  # Copyright 2023 Gentoo Authors
  # Distributed under the terms of the GNU General Public License v2

  # pkgcheck skip: PythonCompatUpdate

  EAPI=8

Resolves: pkgcore#478
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
arthurzam added a commit to arthurzam/pkgcheck that referenced this issue May 13, 2023
Add support for an ebuild to declare a skip annotation for a class of
*version* results. This skip annotation must be declared before any
non-comment non-empty line (most of the times it would be before the
EAPI declaration). Empty lines between the copyright and the annotation
are allowed.
The annotation line must be precise, only one class per line and every
space is required.

For example, it would look like:

  # Copyright 2023 Gentoo Authors
  # Distributed under the terms of the GNU General Public License v2

  # pkgcheck skip: PythonCompatUpdate

  EAPI=8

Resolves: pkgcore#478
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants