add changelog from directory builder#186
Conversation
|
So how does this change http://wiki.dlang.org/DMD_Release_Building#Build_steps ? I don't understand how the changes in |
8ed255f to
cef6a79
Compare
Would be sth. like run
Currently the bug issues just gets copy-pastied to the bottom - see e.g. http://dlang.org/changelog/2.071.0.html I updated the script to build from one file only to add the relative links between the entries - it will be rather easy (just two lines) to change it to "pure github" messages. |
|
Would be nicer to integrate both tools. |
Sure, but please don't forget the people who just want to test their changelog - they don't need to download all bugzilla fixes.
|
Is that a problem? I've never run The goal is to run it as part of the dlang.org build anyway, to preview the upcoming changelog. |
The idea was to make the bugzilla part optional/toggleable, s.t.
|
|
Yep, it needs to be moved out of the installer repository if it is to be used in day-to-day builds. How long does the bugzilla query take? |
Script takes about 15s to run. |
Could be cached, but the query itself should already be very efficient (just querying some rows by primary key). |
|
Yeah, 15 seconds isn't too bad. I suggest merging it with
I had misunderstood where the "installer" requirement came from. Making the git/Bugzilla query optional would resolve it. |
cef6a79 to
0466196
Compare
0466196 to
a18ebc0
Compare
| It stores its result in DDoc form to a text file. | ||
|
|
||
| Copyright: Dmitry Olshansky 2013. | ||
| Copyright: D Language Foundation 2016. |
There was a problem hiding this comment.
@DmitryOlshansky are you okay with moving the copyright to the D Language Foundation?
There was a problem hiding this comment.
Sure whatever. When I started this script it was a brutal hack to show that automation is possible and easy.
| It is also possible to directly preview the generated changelog file: | ||
|
|
||
| --- | ||
| rdmd changed.d --start=2013-01-01 --end=2013-04-01 |
There was a problem hiding this comment.
This wasn't supported anymore.
| std.getopt.config.passThrough, | ||
| "output|o", &outputFile, | ||
| "date", &nextVersionDate, | ||
| "version", &nextVersionString, |
There was a problem hiding this comment.
@MartinNowak is passing a CLI flag okay for you?
(Otherwise the new version is only written once in the file - at the Macro section)
There was a problem hiding this comment.
Sure, already have the version everywhere.
changed.d
Outdated
| if (args.length != 2) | ||
| auto outputFile = "./changelog.dd"; | ||
| auto nextVersionString = "LATEST"; | ||
| auto nextVersionDate = "September 19, 2016"; |
There was a problem hiding this comment.
Is there a nice way to get this with Vanilla D? I couldn't find one :/
Ok I finally got around doing this. It now checks the
If no arguments are passed, Bugzilla isn't queried (but a friendly message about this is shown). @CyberShadow If you still want to integrate the pending changelog into DAutoTest something like this will work then: |
Can this be a dlang.org Makefile target, part of the default target? |
Yes of course :) |
MartinNowak
left a comment
There was a problem hiding this comment.
Looks mostly good.
Can you summarize the changelog format again here for reference? It was ddoc with meta header, correct?
| changedRepos.each!(x => x.changes.writeTextChangesHeader(w, x.headline)); | ||
|
|
||
| if (revRange.length) | ||
| w.put("$(BR)$(BIG $(RELATIVE_LINK2 bugfix-list, List of all bug fixes and enhancements in D $(VER).))\n\n"); |
There was a problem hiding this comment.
👏 having to add $(VER) myself everytime, started to become really annoying.
changed.d
Outdated
| // print the overview headers | ||
| changedRepos.each!(x => x.changes.writeTextChangesHeader(w, x.headline)); | ||
|
|
||
| if (revRange.length) |
There was a problem hiding this comment.
revRange.length reads confusing (range + length), how about !revRange.empty?
| revRange.getBugzillaChanges.writeBugzillaChanges(w); | ||
| } | ||
|
|
||
| w.formattedWrite("$(CHANGELOG_NAV_LAST %s)\n", previousVersion); |
There was a problem hiding this comment.
There is a small script to fix all the navigation.
https://github.com/dlang/dlang.org/blob/cb4129cb40b430ba5fcb508a8fe2f87fa9fbc2ac/changelog/update_nav.sh
Don't need to fully integrate that functionality for now though.
There was a problem hiding this comment.
Ok let's go with the most simple, working version for now and then continue to extend it :)
changed.d
Outdated
| { | ||
| // search for raw change files | ||
| alias Repo = Tuple!(string, "path", string, "headline"); | ||
| auto repos = [Repo("dmd", "Language changes"), |
There was a problem hiding this comment.
We had a distinction for compiler and language changes.
Examples for noteworthy compiler changes would be a huge speedup or fixed template emission.
Any idea how to support those?
There was a problem hiding this comment.
Well initially I suggested to use sth. like YAML for the entries, then we could have our own attribute and use sth. like:
title: Foo Bar
category: language-change
priority: 4
description: >
a long description
Now we already have two attributes category and priority, so I am seriously reconsidering to use YAML. Any opinions on this @MartinNowak @CyberShadow?
| bool hideTextChanges = false; | ||
| string revRange; | ||
|
|
||
| auto helpInformation = getopt( |
There was a problem hiding this comment.
Please use and provide option help.
See https://dlang.org/phobos/std_getopt.html#.getopt.
There was a problem hiding this comment.
(done - see below)
changed.d
Outdated
| .map!(repo => Repo(buildPath("..", repo.path, "changelog"), repo.headline)) | ||
| .filter!(x => x.path.exists) | ||
| .map!(x => tuple!("headline", "changes")(x.headline, x.path.readTextChanges.array)) | ||
| .filter!(x => !x.changes.empty); |
There was a problem hiding this comment.
Please keep a literal and understandable lambda argument name instead of using x, r for repo would be fine.
Can live w/ the x, but missing names are usually a code smell, b/c it requires the code reader to extract a mental model from raw code, instead of having the writer present one.
changed.d
Outdated
| ChangelogEntry entry = { | ||
| title: (cast(string) fileRead[0..firstLineBreak]).strip, | ||
| description: (cast(string) fileRead[firstLineBreak..$]).strip, | ||
| basename: filename.baseName.stripExtension // let's be safe here |
There was a problem hiding this comment.
What does safe mean here? Remove comment?
changed.d
Outdated
| break; | ||
|
|
||
| case "enhancement": | ||
| case "enhancement": |
|
One design problem came to my mind. There is no defined order/priority of changelog entries, right now it will just use the folders default order (which is alphabetically on my OS+FS, not sure about others). We can leave this as a final manual polish step for now. For the future we might adopt some P1_20161231235959_slug-name.dd scheme. With P1-P5 matching Bugzilla's highest to least priority system. It's a bit too complex to begin with and our changelogs shouldn't be that big in the beginning. |
Let's adopt a color/font-style scheme for the changelog priority instead. |
|
Ping, any interest to continue the work on this? Didn't found time for the prioritization, feel free to propose any scheme. |
| } | ||
|
|
||
| return result.data; | ||
| string toString(Month month){ |
There was a problem hiding this comment.
While not necessary, hardcoding the Date seemed lame. Unfortunately Phobos doesn't know anything about the mapping of Dates to Month (at least I couldn't find anything).
Thanks for the ping.
Added it to the header of the file too.
I already commented about this in a comment as it seems to me that we need some meta information per entry, so using a slightly "more complex" file format might be better, e.g. YAML is pretty easy to write & parse:
Yep let's go step by step and go with the simplest working version and then extend it gradually :) |
|
Ping @MartinNowak @CyberShadow @aG0aep6G @JackStouffer as mentioned above we seem to need some meta information per entry, so using a slightly "more complex" file format might be better, e.g. YAML. |
|
That sounds like a grossly overcomplicated design. Why not just put each entry in its own file and use the filenames for sorting? |
That would be too simple ;-)
Probably it would be even |
(just for the record: that's exactly what at the moment this PR does) |
But not chronological? Then why the timestamp in the filename? And I don't see a timestamp in your proposed YAML format. |
IMHO that's preferable to using a serialization language (of which we need a small % of features anyway). Less code is better. But I defer the decision completely to Martin. |
Sorry, didn't got to that, and didn't clearly state the simpler idea.
Nothing people ever say is set in stone, unless they say so. Sometimes it's hard to tell from a written messages whether sth. is just an idea or a well thought through concept, which is a mistake of the writter trying to save time. If things seem unclear, at best get in direct contact to people for clarifications. |
Okay, then this means we stick with the plain "github commit message" format :) So is there anything else blocking this PR?
I like this idea! The changelog builder didn't check |
|
Changelog directory PRs for the repos: DMD: dlang/dmd#6325 |
|
Ping @wilzbach @MartinNowak, what's blocking this PR? |
Ehm not much - I guess @MartinNowak needs to flip the switch for the initial version? |
|
Will do a final review (and merge) later today before branching and building 2.073.0-b0. |
|
See wilzbach#1 |
MartinNowak
left a comment
There was a problem hiding this comment.
Will merge the followup myself.
|
see #211 |
As discussed in the phobos PR this adds the changelog builder to the tools repo.
I also modified the
changedtool to accept an additional output flag.