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

VariableOrderWrong: Enforce skel.ebuild variable order #645

Closed
wants to merge 1 commit into from

Conversation

anthonyryan1
Copy link
Contributor

@anthonyryan1 anthonyryan1 commented Jan 7, 2024

Gentoo developers are rejecting routine version bumps for ebuild variables being defined in a different order than skel.ebuild.
This new lint ensures pkgcheck identifies these problems before we waste developer time.

The following pkgcore pull request was submitted as a prerequisite: pkgcore/pkgcore#425

Specifically to address false positives in the following tests:
tests/scripts/test_pkgcheck_scan.py::TestPkgcheckScan::test_filter_latest FAILED
tests/scripts/test_pkgcheck_scan.py::TestPkgcheckScan::test_scan_quiet FAILED

Regarding tests, in spite of the massive diff, all that's been done is re-ordering the variables to avoid introducing new style warnings into existing tests.

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.

Thank you for your work.

I see the formatting failed, can you run make format to autofix all instances?

Gentoo developers are rejecting routine version bumps for ebuild variables being defined in a different order than skel.ebuild. This new lint ensures pkgcheck identifies these problems before we waste developer time.

Since this is outside of normal enforcement levels, I've requested QA team input on the check idea. Therefore approval of the idea might take time.

TODO

Both of the following tests have regressions that need a new solution: tests/scripts/test_pkgcheck_scan.py::TestPkgcheckScan::test_filter_latest FAILED tests/scripts/test_pkgcheck_scan.py::TestPkgcheckScan::test_scan_quiet FAILED

The conflict here stems from: pkgcore/pytest/plugin.py create_ebuild() which creates ebuilds that don't match the same skel.ebuild variable order that Gentoo developers are enforcing on the tree.

I'm requesting feedback on how we should fix those tests. Should create_ebuild() be updated to enforce variable order? Or, should we rewrite those two tests to try and stop assuming there's a precisely defined number of errors shown or supressed (which will continue to change in the future as new lints are added or removed).

let's change the origin at pkgcore if it is simple, otherwise we should take deeper look at why it is hard.

Regarding tests, in spite of the massive diff, all that's been done is re-ordering the variables to avoid introducing new style warnings into existing tests.

src/pkgcheck/checks/codingstyle.py Outdated Show resolved Hide resolved
src/pkgcheck/checks/codingstyle.py Outdated Show resolved Hide resolved
src/pkgcheck/checks/codingstyle.py Outdated Show resolved Hide resolved
src/pkgcheck/checks/codingstyle.py Outdated Show resolved Hide resolved
anthonyryan1 added a commit to anthonyryan1/pkgcore that referenced this pull request Jan 13, 2024
Better matches the order defined in skel.ebuild

A pre-requisite for pkgcore/pkgcheck#645
anthonyryan1 added a commit to anthonyryan1/pkgcore that referenced this pull request Jan 13, 2024
Better matches the order defined in skel.ebuild

A prerequisite for pkgcore/pkgcheck#645
@anthonyryan1
Copy link
Contributor Author

Requested changes have been incorporated, and a pull request against pkgcore opened here: pkgcore/pkgcore#425 to resolve the problems with the last two tests.

@ferringb
Copy link
Contributor

Gentoo developers are rejecting routine version bumps for ebuild variables being defined in a different order than skel.ebuild.
This new lint ensures pkgcheck identifies these problems before we waste developer time.

@anthonyryan1 for my own knowledge, can you link an example?

@anthonyryan1
Copy link
Contributor Author

Certainly!

gentoo/gentoo#34284 (comment)

anthonyryan1 added a commit to anthonyryan1/pkgcore that referenced this pull request Jan 15, 2024
Better matches the order defined in skel.ebuild

A prerequisite for pkgcore/pkgcheck#645

Signed-off-by: Anthony Ryan <[email protected]>
gentoo-bot pushed a commit to pkgcore/pkgcore that referenced this pull request Jan 15, 2024
Better matches the order defined in skel.ebuild

A prerequisite for pkgcore/pkgcheck#645

Signed-off-by: Anthony Ryan <[email protected]>
Closes: #425
Signed-off-by: Arthur Zamarin <[email protected]>
@anthonyryan1
Copy link
Contributor Author

Tests are green now that pkgcore is updated.

Since I know discussion takes a while, I'll rebase this (and remove the now unnecessary changes to *DEPEND order in tests) after the discussion is complete. Just let me know once we have a verdict on it.

@arthurzam
Copy link
Member

arthurzam commented Jan 24, 2024

OK, we've got enough agreements, so I think we can merge it. Can you please rebase over master (sorry, for adding conflicts for you)

Edit: please also add a sign off to the commit

@anthonyryan1
Copy link
Contributor Author

anthonyryan1 commented Jan 27, 2024

Ready for CI approval to ensure nothing regressed during the rebase.

Update: Will figure out what regressed and get this fixed shortly.

Update 2: Fixed. Had to add some extra boilerplate for compatibility after #656

Gentoo developers are rejecting routine version bumps for ebuild
variables being defined in a different order than skel.ebuild.
This new lint ensures pkgcheck identifies these problems before
we waste developer time.

Regarding tests, in spite of the massive diff, all that's been done
is re-ordering the variables to avoid introducing new style warnings
into existing tests.

Signed-off-by: Anthony Ryan <[email protected]>
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.

Thank you. I'll fix formatting on merge (new black got out not long ago)

@kuraga
Copy link

kuraga commented Mar 2, 2024

You improved the Perfectionist World 😄

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.

4 participants