Semantic-Release-Notes icon indicating copy to clipboard operation
Semantic-Release-Notes copied to clipboard

Support metadata

Open laedit opened this issue 10 years ago • 8 comments
trafficstars

Proposal for the support of metadata and specifically commits (Fix #14).

All metadata can be preceded by its name (case insensitive) followed by a colon, but each supported metadata have it's own syntax.

Example For commits it's the first and last commits of the release separated by three dots and can be included in a link.

Input:

  • 56af25a...d3fead4
  • Commits: [56af25a...d3fead4](https://github.com/Glimpse/Semantic-Release-Notes/compare/56af25a...d3fead4)

Result:

{
    "metadata" : [ {
            "name" : "Commits",
            "data" : "56af25a...d3fead4"
        }, {
            "name" : "Commits",
            "data" : "[56af25a...d3fead4](https://github.com/Glimpse/Semantic-Release-Notes/compare/56af25a...d3fead4)"
        } ],
    "summary" : ""
}

Html:

Commits: 56af25a...d3fead4 Commits: 56af25a...d3fead4

laedit avatar Mar 05 '15 18:03 laedit

To clarify, in the above case, are you proposing that metadata can work in two ways:

  • Firstly, that the parser can be extended to look for special cases and pull that data out as metadata
  • Secondly, that one can provide a "list" at the bottom of each release that allows for arbitrary metadata to be defined without the need for an extension

avanderhoorn avatar Mar 06 '15 20:03 avanderhoorn

I was proposing only the first way, each supported metadata must be understanded by the parser.

It is possible to support the second, but in that case it means that the summary of the release must be at the top.

I don't know if it's a good thing.

laedit avatar Mar 06 '15 21:03 laedit

Makes sense and I agree, lets see if any others have some feedback.

avanderhoorn avatar Mar 06 '15 22:03 avanderhoorn

I have added the missing metadata contributors, source, binaries and generated at. The metadata name is mandatory for contributors, source and binaries since the content is not sufficient to recognize the metadata. @avanderhoorn, @jakeginnivan, is it ok for you?

laedit avatar May 05 '15 17:05 laedit

Just checking, the metadata itself is optional? Just the keys have to match for them to be recognized, right?

From: Jérémie Bertrand [mailto:[email protected]] Sent: 05 May 2015 18:24 To: Glimpse/Semantic-Release-Notes Cc: Jake Ginnivan Subject: Re: [Semantic-Release-Notes] Support metadata (#19)

I have added the missing metadata contributors, source, binaries and generated at. The metadata name is mandatory for contributors, source and binaries since the content is not sufficient to recognize the metadata. @avanderhoornhttps://github.com/avanderhoorn, @jakeginnivanhttps://github.com/jakeginnivan, is it ok for you?

— Reply to this email directly or view it on GitHubhttps://github.com/Glimpse/Semantic-Release-Notes/pull/19#issuecomment-99149029.

JakeGinnivan avatar May 12 '15 08:05 JakeGinnivan

All metadata are optionals. For certain metadata like commits and generated at, the data itself is sufficient on its own (but they have to be on their own line) to be recognized as metadata. Or do you prefer that the key is always mandatory?

laedit avatar May 12 '15 08:05 laedit

I think the metadata should be 100% optional and that any combination of keys (if you do choose to use metadata) is possible - i.e. you can choose to use any 1 or 2. Does that match up with others thinking?

avanderhoorn avatar May 12 '15 15:05 avanderhoorn

Yep, it is done that way in the PR.

laedit avatar May 12 '15 15:05 laedit