-
Notifications
You must be signed in to change notification settings - Fork 724
Per-field GenericPackageDescription golden test
#11285
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
base: master
Are you sure you want to change the base?
Conversation
GenericPackageDescription golden test
I'm not quite convinced about this. Having an entire GPD in a single file is much more convenient than scattered across a dozen of them. If you wish to future-proof the test suite against future changes to GPD fields, you can serialise a tuple of |
|
I think it's fine to change this in a separate branch to keep other PRs smaller. |
|
I see, thanks for the review :) As Artem mentioned in the comment parser PR, if it's useful to rebase and reduce the test related commit to only one, let me know and I'll do it 👍 |
|
Rebase and preferably squash please, yes. |
340c4c7 to
17ca4bd
Compare
|
@leana8959 We can land this shortly but it would be good to address my two comments to future-proof this. |
17ca4bd to
2501347
Compare
|
I end up changing the |
2501347 to
ddb3f5c
Compare
test: check equality on each field test: improve import list test: use @? operator test: use a tuple to store all gpd fields test: define ToExpr tuple instance manually test: update expected test: use Rec constructor to annotate field names test: update expected test: remove comment not in scope for this PR test: use field equality in hackage tests
ddb3f5c to
1aa439d
Compare
|
I squashed everything into one commit so this should be ready for review! |
|
@jappeace, we have the reviews, we just need someone to mark the earlier comments as resolved if they are. |
|
Just resolved the earlier comments! Sorry that took a while, I thought you wanted someone from the review side to resolve them. |
|
In general we expect that you resolve them if you believe you have addressed them, and request further reviews if you think it might be needed. (I personally often re-request a review from the person who made the review comment.) One reason for this is that GitHub's UI can otherwise "lose" review comments: a change that removes the line commented on will make the review comment inaccessible, but GitHub will still consider the comment unresolved. In this case you need to (possibly get someone with access to) dismiss the review comment. |
|
Also I see two review comments from @Bodigrim that are still open. |
|
I see, that makes sense. Also oops I didn't scroll up far enough, I resolved everything now. |
|
I disagree with @geekosaur on how comment resolution should work. I prefer it when comments left by me are resolved by me as well. I guess we should decide what we want to do in the Cabal project and write it down in CONTRIBUTING.md. I saw a question from Matt that could use an explicit answer, not just code update: #11285 (comment) |
It would be most helpful to write it down indeed. My recent attempt to demistify the contribution process in #11232 (comment) left me absolutely baffled (and, more specifically, under an impression that a PR author is free to resolve comments themselves). |
We are making changes to the internal representation of
GenericPackageDescriptionin #11277 in order to retain common stanzas. Our current approach with the common stanza retention is done by adding aMap ImportName (CondTree ConfVar [Dependency] BuildInfo)intoGenericPackageDescription, and merging on demand withPatternSynonymsaccessors.The current golden test test suite doesn't handle this change well — we have one single golden file per
GenericPackageDescriptiondata. Adding fields to this data type creates huge amount of diffs, making bugs harder to spot for both me and the reviewers.To get out of this diff hell, we have split the golden tests of
GenericPackageDescriptionto write eachGenericPackageDescriptionfield into its own file. This way, we can quickly identify which behaviour has changed and for which file. New fields will simply be in new files.This is a separate PR because the diff is very big, which is caused by the golden test files changes. After merging this, #11277's diff would roughly drop from 24kloc to 1.8kloc. This would make the actual behaviour changes more reviewable.
This PR does not modify behaviour or interface
E.g. the PR only touches documentation or tests, does refactorings, etc.
Include the following checklist in your PR: