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

persistent-template: Use the stock strategy when deriving Show/Read f… #1106

Merged
merged 3 commits into from
Sep 28, 2020

Conversation

MaxGabriel
Copy link
Member

@MaxGabriel MaxGabriel commented Aug 9, 2020

…or keys

This closes #1104

If people are amenable to this PR, thoughts on the version for it? This could be a breaking change, as described in the Changelog (idk how people feel about that though—if changing the content of a Show/Read instance is considered to be a breaking change)

Before submitting your PR, check that you've:

After submitting your PR:

  • Update the Changelog.md file with a link to your PR
  • Bumped the version number if there isn't an (unreleased) on the Changelog
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)

Copy link
Collaborator

@parsonsmatt parsonsmatt left a comment

Choose a reason for hiding this comment

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

Great catch! Thanks!

@MaxGabriel
Copy link
Member Author

Cool, do you have thoughts on what the version number should be?

@parsonsmatt
Copy link
Collaborator

well, it's a breaking change, but since it fixes a bug that is also a breaking change that came in a non-breaking manner, I think we're fine to release a patch version and deprecate the versions that contained the breaking behavior.

@MaxGabriel
Copy link
Member Author

Sounds good

@lf-
Copy link
Contributor

lf- commented Sep 4, 2020

Hi, as someone whose software has been broken by this, and not because we were relying on the output of the show instance in our code that I'm aware of, but due to something in persistent itself breaking, requiring manual database hacking (I will double check later today but a LTS update from 14.27->16.11 did break our data), this should be a minor release number change, so people who assumed it was an intentional change and migrated their data accordingly already can see it more easily since a new minor release will likely break compilation on the next LTS update.

Here's what happened to https://github.com/Carnap/Carnap, specifically Carnap-Server:

signal-2020-09-04-091936

Update: I may have been mistaken, and we might have been keying on the output of show.

@gleachkr
Copy link

gleachkr commented Sep 4, 2020

Yes, that's right from @lf-: our issue is that one of the constructors for a datatype that we're using derivePersistField with has a String field that carries a serialization of a key (roughly because the key needs to be passed to a client and back again). This PR fixes our issue.

There does still seem to be a potential worry that derivePersistField marshalling would be affected by this change for data that actually includes keys.

@MaxGabriel
Copy link
Member Author

Ah ok, I think this is a strong case to do a breaking version bump for this

@parsonsmatt
Copy link
Collaborator

@MaxGabriel I'm confused by what you mean - it seems to me that @lf- and @gleachkr so far is saying a minor version bump is appropriate, which is my intuition as well.

@MaxGabriel
Copy link
Member Author

Ok I'm kinda confused, this is how I was reading people:

@parsonsmatt

well, it's a breaking change, but since it fixes a bug that is also a breaking change that came in a non-breaking manner, I think we're fine to release a patch version and deprecate the versions that contained the breaking behavior.

I am taking that to mean, in the PVP versioning schema (A.B.C.D/MAJOR.MAJOR.MINOR.PATCH), you were saying to just bump PATCH.

@lf-

this should be a minor release number change, so people who assumed it was an intentional change and migrated their data accordingly already can see it more easily since a new minor release will likely break compilation on the next LTS update

This part confuses me. LTS Haskell automatically picks up minor version bumps (https://github.com/commercialhaskell/lts-haskell#how-it-works), but it sounds like what @lf- wanted was for this new version to not be picked up until the next LTS version (where people would assume breaking changes). But for that to happen, it needs a major (either A or B in A.B.C.D)

@lf-
Copy link
Contributor

lf- commented Sep 23, 2020

@MaxGabriel: What I meant is that I wanted it to cause version bounds to break, encouraging reading the changelog, but I was not aware of the implications for LTS Haskell users as I primarily work with Nix. I believe the fix should require a major upgrade, even though it would delay LTS availability since, for example, if an app already on the buggy version newly introduces one of the affected use cases, thereby becoming affected by this bug, it would only have data needing migration following the fix release. Regardless of our choice, migrations/fixes will need to happen for all apps using show that have used the affected version, so our role is to most effectively notify people that these migrations are needed.

@MaxGabriel
Copy link
Member Author

Ok cool, so I think I’m in favor of a major (B in A.B.C.D to be specific) bump. That said, I am more open to making lots of major version bumps than most people.

Now that it’s clear there is a disagreement, can the people who prefer C or D version bumps weigh in? I am inclined to agree with @lf-

@parsonsmatt
Copy link
Collaborator

I don't have a strong preference. We can put this in with 2.11, or we can get it out-the-door quicker with a 2.10 minor release.

@MaxGabriel
Copy link
Member Author

Ok cool, let's just do 2.11. I'll update the PR accordingly

@MaxGabriel
Copy link
Member Author

Ok, updated to 2.9 (persistent template's versions aren't synced with persistent proper's)

@MaxGabriel MaxGabriel merged commit be49c1b into master Sep 28, 2020
@MaxGabriel
Copy link
Member Author

Ok cool this is released. The big caveat is: the previous version of persistent-template depends on 2.11, which isn't release, so this isn't available yet in practice

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.

Regression: Show instance for keys no longer includes the name of the key
4 participants