Skip to content

Automate our changelog generation - #885

Merged
Brett Cannon (brettcannon) merged 16 commits into
microsoft:masterfrom
brettcannon:automate-changelog
Feb 27, 2018
Merged

Brett Cannon (brettcannon) merged 16 commits into
microsoft:masterfrom
brettcannon:automate-changelog

Conversation

@brettcannon

Copy link
Copy Markdown
Member

This introduces a file-based format for changelog entries to progressively build up news entries rather than doing it at once just before release.

The announce script tries to balance any repetitive behaviours with not automating everything at the price of complicated configuration. It also isn't written to be generically suitable for other projects. The key reason for doing our own solution is (1) the npm-based ones all wanted to use git commit messages which are immutable, and (2) the file-based ones out of the Python community are all reST-based.

@codecov

codecov Bot commented Feb 26, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #885 into master will increase coverage by 0.54%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #885      +/-   ##
==========================================
+ Coverage   64.08%   64.62%   +0.54%     
==========================================
  Files         257      259       +2     
  Lines       11855    11980     +125     
  Branches     2110     2128      +18     
==========================================
+ Hits         7597     7742     +145     
+ Misses       4249     4229      -20     
  Partials        9        9
Impacted Files Coverage Δ
src/client/common/installer/pipInstaller.ts 80.76% <0%> (-6.74%) ⬇️
src/client/common/process/pythonProcess.ts 84% <0%> (-5.8%) ⬇️
src/client/common/installer/condaInstaller.ts 55.26% <0%> (-3.08%) ⬇️
src/client/common/installer/channelManager.ts 90.9% <0%> (-2.71%) ⬇️
src/client/interpreter/locators/index.ts 87.5% <0%> (-1.14%) ⬇️
src/client/common/application/types.ts 100% <0%> (ø) ⬆️
src/client/common/installer/types.ts 100% <0%> (ø) ⬆️
src/client/common/installer/serviceRegistry.ts 100% <0%> (ø) ⬆️
src/client/interpreter/contracts.ts 100% <0%> (ø) ⬆️
src/client/common/types.ts 100% <0%> (ø) ⬆️
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 136c78b...a2e4e82. Read the comment docs.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

I left a few minor comments that I do not consider blockers.

Comment thread news/announce.py Outdated
entry = path.read_text("utf-8")
if cleanup:
git_rm(path)
# I want dataclasses!

Choose a reason for hiding this comment

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

In the meantime namedtuple would probably still have a similar benefit:

class Entry(namedtuple('Entry', 'issue text')):
    ...

class Section(nametuple('Section', 'order name entries')):
    ...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nope, uh-huh, ain't going to do it. I can use types.SimpleNamespace until then. 😄

Comment thread news/announce.py


class RunType(enum.Enum):

Choose a reason for hiding this comment

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

delete

Comment thread news/announce.py Outdated
for path in directory.iterdir():
if not path.is_dir():
continue
if ' ' not in path.name:

Choose a reason for hiding this comment

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

or check sep 2 lines down...

Comment thread news/announce.py Outdated
issue = int(match.group('issue'))
entry = path.read_text("utf-8")
if cleanup:
git_rm(path)

Choose a reason for hiding this comment

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

Something feels off about doing this here as a side-effect of new_entries(). It's fine, but still feels out of place.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I guess I could walk the file system twice by having a custom walking generator which could be called both for getting the news entries and then called a second time to call git-rm on the path?

@brettcannon
Brett Cannon (brettcannon) merged commit cc5f954 into microsoft:master Feb 27, 2018
@brettcannon
Brett Cannon (brettcannon) deleted the automate-changelog branch February 27, 2018 23:01
@lock lock Bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants