pact-foundation / pact-specification

Describes the pact format and verification specifications
MIT License
292 stars 28 forks source link

V4 Pact Specification Metadata format changed #103

Open PogopunkXIII opened 1 year ago

PogopunkXIII commented 1 year ago

Previous Pact Specification versions all follow A.B.C format, even if both B and C were just 0. 4.0 specification breaks this. Now I recognize that a semantic version parser should be able to handle such a thing, but shouldn't the version be 4.0.0 regardless to main consistency with past versions?

Unfortunately the sem ver library I have access to fails to parse this :(

EDIT: upon further investigation, proper semantic version format must include the patch version: https://semver.org/

mefellows commented 1 year ago

It's not actually a server string, or at least it shouldn't be treated as one.

I'd suggest just parsing it as a number.

What are you trying to do with it?

On Thu, May 25, 2023, 22:20 PogopunkXIII @.***> wrote:

Previous Pact Specification versions all follows A.B.C format, even if both B and C were just 0. 4.0 specification breaks this. Now I recognize that a semantic version parser should be able to handle such a thing, but shouldn't the version be 4.0.0 regardless to main consistency with past versions?

Unfortunately the sem ver library I have access to fails to parse this :(

— Reply to this email directly, view it on GitHub https://github.com/pact-foundation/pact-specification/issues/103, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAANFDBJVXADADQPNZQS2XTXH5E7XANCNFSM6AAAAAAYOYIKI4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

PogopunkXIII commented 1 year ago

well it's not me specifically, we have a library we use to pull pact files from elsewhere and read them into memory, and that library tries to read the PactSpecification as a semantic version, which up until 4.0 has been a fine thing to do.

The library is also third party, so it's not something I have direct access to.

mefellows commented 1 year ago

Thanks, I'm keen to know the use case more.

Are you preprocessing them? You may also like https://github.com/pactflow/pact-schemas which is linked from the spec now.

But the assumption that it was semver is incorrect I believe. It's never stated it is a semver scheme

On Thu, May 25, 2023, 22:58 PogopunkXIII @.***> wrote:

well it's not me specifically, we have a library we use to pull pact files from elsewhere and read them into memory, and that library tries to read the PactSpecification as a semantic version, which up until 4.0 has been a fine thing to do.

— Reply to this email directly, view it on GitHub https://github.com/pact-foundation/pact-specification/issues/103#issuecomment-1562864116, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAANFDDGKCLNJWMNETYTXNDXH5JP7ANCNFSM6AAAAAAYOYIKI4 . You are receiving this because you commented.Message ID: @.***>