GithubHelp home page GithubHelp logo

changelog-maker's People

Contributors

aduh95 avatar bengl avatar binarymuse avatar chavacava avatar codebytere avatar dependabot[bot] avatar fhemberger avatar jamsyoung avatar jimniels avatar kikobeats avatar maboiteaspam avatar mylesborins avatar ralphtheninja avatar rstacruz avatar rvagg avatar semantic-release-bot avatar targos avatar trott avatar vespasianvs avatar xhmikosr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

changelog-maker's Issues

Occasionally commit.summary is undefined

I haven't had much time to debug this properly, so I dunno if the root is something in the repo I'm using (hope not, it's private so I can't share access), or the lib this util is using, but it can be protected against.

Here is my usage (on io.js):

IWhitfieldMBPR:master iwhitfield$ changelog-maker --start-ref=f3f513790f71eaffe23d18efb790b234ef88328c <redacted-org> <redacted-repo>
/Users/iwhitfield/.nvm/versions/io.js/v2.3.1/lib/node_modules/changelog-maker/changelog-maker.js:97
  var summary = commit.summary.replace(revertRe, '')
                              ^
TypeError: Cannot read property 'replace' of undefined
    at commitToGroup (/Users/iwhitfield/.nvm/versions/io.js/v2.3.1/lib/node_modules/changelog-maker/changelog-maker.js:97:31)
    at commitToOutput (/Users/iwhitfield/.nvm/versions/io.js/v2.3.1/lib/node_modules/changelog-maker/changelog-maker.js:162:18)
    at Array.map (native)
    at Immediate._onImmediate (/Users/iwhitfield/.nvm/versions/io.js/v2.3.1/lib/node_modules/changelog-maker/changelog-maker.js:210:17)
    at processImmediate [as _immediateCallback] (timers.js:371:17)

So I dug a little, and put in some logging and it somehow appears that this commit is being passed in:

{ sha: 'eb27d2e12431656b6725ff665c9c2babbc59ab39',
  author: 
   { name: 'Isaac Whitfield',
     email: '[email protected]' },
  prUrl: 'eoptimize distinct queries' }

But of course... no summary property. It appears something has gone wrong with the parsing somewhere - the summary was initially Preoptimize distinct queries, which explains the pr in the field name, and why the value makes no sense.

Regardless of whether this is a lib issue or not, I think it's pretty safe to add some protection to changelog-maker. In my case, I edited the blocks in question to:

function commitToGroup (commit) {
  if (commit.summary !== undefined) {
    var summary = commit.summary.replace(revertRe, '')
      , m       = summary.match(groupRe)
  }
  return m && m[1]
}

and

data.summary = commit.summary && commit.summary.replace(revertRe, '').replace(/"$/, '').replace(groupRe, '') || ''

I just want to make sure that there are no adverse effects of this and whether this is deemed something which should be protected against in the first place.

As I said, haven't narrowed down the root cause but I'll keep looking when I get a chance.

Make it work on Windows

Not sure how much work will this be, but currently this doesn't work on Windows.

I'll add more info later.

Getting an error with latest version

$ changelog-maker --group --start-ref v5.4.1
/usr/local/lib/node_modules/changelog-maker/changelog-maker.js:44
  return name[0] === '@' && name.indexOf('/') > 0 ? name.split('/')[1] : name
             ^

TypeError: Cannot read property '0' of undefined
    at stripScope (/usr/local/lib/node_modules/changelog-maker/changelog-maker.js:44:14)
    at Object.<anonymous> (/usr/local/lib/node_modules/changelog-maker/changelog-maker.js:30:30)
    at Module._compile (module.js:397:26)
    at Object.Module._extensions..js (module.js:404:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:429:10)
    at startup (node.js:139:18)
    at node.js:999:3

Some warnings

Just noting a few warnings I got while preparing the v9.9.0 release:

$ NODE_OPTIONS="--trace-warnings" changelog-maker --group --start-ref v9.8.0
(node:10896) [DEP0005] DeprecationWarning: The Buffer() and new Buffer() constructors are not recommended for use due to security and usability concerns. Please use the new Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() construction methods instead.
    at showFlaggedDeprecation (buffer.js:139:13)
    at new Buffer (buffer.js:160:3)
    at BufferList.copy (/home/mzasso/.nvm/versions/node/v9.8.0/lib/node_modules/changelog-maker/node_modules/gitexec/node_modules/bl/bl.js:108:19)
    at BufferList.slice (/home/mzasso/.nvm/versions/node/v9.8.0/lib/node_modules/changelog-maker/node_modules/gitexec/node_modules/bl/bl.js:99:15)
    at BufferList.end (/home/mzasso/.nvm/versions/node/v9.8.0/lib/node_modules/changelog-maker/node_modules/gitexec/node_modules/bl/bl.js:89:31)
    at Socket.onend (_stream_readable.js:602:10)
    at Object.onceWrapper (events.js:272:13)
    at Socket.emit (events.js:185:15)
    at endReadableNT (_stream_readable.js:1101:12)
    at process._tickCallback (internal/process/next_tick.js:114:19)
Your GitHub username: targos
Your GitHub password: XXXXXX

(node:10896) TimeoutOverflowWarning: 4294967296000 does not fit into a 32-bit signed integer.
Timer duration was truncated to 2147483647.
    at Object.exports.enroll (timers.js:407:13)
    at TLSSocket.Socket.setTimeout (net.js:369:12)
    at TLSSocket.<anonymous> (_http_client.js:725:14)
    at Object.onceWrapper (events.js:272:13)
    at TLSSocket.emit (events.js:185:15)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1157:10)
Your GitHub OTP/2FA Code (optional): XXXXXX
(node:10896) TimeoutOverflowWarning: 4294967296000 does not fit into a 32-bit signed integer.
Timer duration was truncated to 2147483647.
    at Object.exports.enroll (timers.js:407:13)
    at TLSSocket.Socket.setTimeout (net.js:369:12)
    at TLSSocket.<anonymous> (_http_client.js:725:14)
    at Object.onceWrapper (events.js:272:13)
    at TLSSocket.emit (events.js:185:15)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1157:10)

` instead of ' break the execution

I suppose that you are using a real UNIX SO instead of Mac :P

changelog-maker joyent/node

/usr/local/lib/node_modules/changelog-maker/changelog-maker.js:25
          configName : `changelog-maker`
                       ^
SyntaxError: Unexpected token ILLEGAL
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:929:3

Add link to github task

Maybe add task number parser and add link to it?

git commit -m"fix: #212"

to:

* [[`20f8e7f17a`](https://github.com/user/repo/commit/20f8e7f17a)] -
  **fix**: [#212](https://github.com/user/repo/issues/212) (LestaD)

Weird git log parsing issue

Run on master in Node core:

$ changelog-maker --start-ref=66cb4bcf0 --end-ref=66cb4bcf0
* [[`66cb4bcf0c`](https://github.com/nodejs/node/commit/66cb4bcf0c)] - Event emitters support symbols as event names. The process object (cjihrig) [#4798](https://github.com/nodejs/node/pull/4798)

$ git log 66cb4bcf0c | head
commit 66cb4bcf0c032adc0f6abf7452150875c8a82243
Author: cjihrig <[email protected]>
Date:   Thu Jan 21 13:07:25 2016 -0500

    process: support symbol events

    Event emitters support symbols as event names. The process object
    assumes that the event name is a string, and examines the first
    three characters to check for signals. This causes an exception
    if the event name is a symbol. This commit ensures that the

i.e. it's not picking up process: support symbol events as the summary of this commit

package broken

I'm getting this error when trying to run changelog-maker command:

/usr/lib/node_modules/changelog-maker/changelog-maker.js:75
          console.error(`Error fetching issue #${commit.ghIssue}: ${err.messag
                        ^
SyntaxError: Unexpected token ILLEGAL
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:935:3

coloring is broken

#98 has broken coloring of changelog entries in a terminal.

e.g. with current v14.x-staging
image

expected (with [email protected])
image

It looks like the formatting is corrupting the ansi escape codes. Both @BethGriggs and I ran into this preparing the most recent releases and we had to manually remove the corrupted ansi when pasting into the changelogs.

I guess we could stripAnsi() before formatting but then we'd lose the coloring completely.

cc @Trott

Document the requirements to get this running

What's needed to make tests work locally with exact steps like the config path, the token permissions, etc.

Note that for me on Windows, running node changelog-maker.js I don't get asked for credentials or anything. So, when I do npm t it just fails.

bug: incorrect author attribution when base branch is force pushed

When a changelog is generated, there is an instance when the incorrect author is listed.

Steps for reproduction:

  • commit author opens a pull request against a base branch
  • a second person force pushes to base branch
  • commit author rebases on base branch
  • second person is added as a co-author on the commit
  • when the changelog is generated, the second person that has been added as co-author is listed as the author

Expected result:

When the changelog is generated, the commit author should be listed as the author.

unexpected error

$ changelog-maker --group --start-ref=1.0.0 --end-ref=1.0.1 Kikobeats/acho
/usr/local/lib/node_modules/changelog-maker/commit-stream.js:25
        throw new Error('wut?')
              ^
Error: wut?
    at addLine (/usr/local/lib/node_modules/changelog-maker/commit-stream.js:25:15)
    at DestroyableTransform.onLine [as _transform] (/usr/local/lib/node_modules/changelog-maker/commit-stream.js:54:18)
    at DestroyableTransform.Transform._read (/usr/local/lib/node_modules/changelog-maker/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/usr/local/lib/node_modules/changelog-maker/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/usr/local/lib/node_modules/changelog-maker/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:237:10)
    at writeOrBuffer (/usr/local/lib/node_modules/changelog-maker/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:227:5)
    at DestroyableTransform.Writable.write (/usr/local/lib/node_modules/changelog-maker/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:194:11)
    at write (/usr/local/lib/node_modules/changelog-maker/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/usr/local/lib/node_modules/changelog-maker/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
    at DestroyableTransform.pipeOnReadable (/usr/local/lib/node_modules/changelog-maker/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)

and:

iojs -v
v1.5.1

Add usage info on calling --help/-h

There are no errors on passing wrong arguments or in wrong order or passing unknown flags, params.

Can we implement something?

--usage (for short) and --help/-? for more detailed help would be enough.

Markdown issues in 1.4.0 release

I noticed this difference in the upgrade from 1.3.10 to 1.4.0

1.4.0 outputs this:

* [[e09e75b338](https://github.com/organization/private-repo/commit/e09e75b338) - subsystem: summary (James Young) #220
  • [e09e75b338 - subsystem: summary (James Young) #220

1.3.10 would output this:

* [[`361ac84d97`](https://github.com/organization/private-repo/commit/361ac84d97)] - **subsystem**: summary (James Young) [#214](https://github.com/organization/private-repo/pull/214)

I haven't had a chance to look at the changes yet, but wanted to go ahead and log the issue.

markdown special symbols in commit description should be escaped

The commit messages are initially in text, so rendering them as Markdown can cause errors.

To reproduce, in node, do:

$ changelog-maker --start-ref=9eddaebb --end-ref=9eddaebb
* [[`9eddaebb79`](https://github.com/nodejs/node/commit/9eddaebb79)] - **assert**: remove unnecessary use of __proto__ (Nathan Rajlich) 

If a changelog includes __proto__, we don't want it to render as «proto», we want to render it as «__proto__» or «__proto__». Without knowing more if that is code block or not, it would make sense to just escape some symbols like `_*~\, prefixing those with \.

Refs: nodejs/node#a58b48bc3bc, nodejs/node#7637, nodejs/node#12756 (comment).

Has weird issues when trying to get changes based on refs.

Sometimes it will drop commits, add to many commits, not get anything at all, etc, when using --start-ref= and/or --end-ref= on io.js.

For example, to get the commits in nodejs/node#1383 (comment) I ran changelog-maker --start-ref=b8310cb --end-ref=08e89b1 iojs io.js, but it gets commits well before b8310cb also.

(This is the same issue I had trying to use this to make the 1.6.4 release before it was properly re-tagged.)

Add url for nongithub repositories

I have repositories in bitbucket and gitlab.
I want:

changelog-maker --url=http://git.lestad.net game src

and in result:

* [[`123abc456`](http://git.lestad.net/game/src/commit/123abc456)] - **label**: commit text (lestad)

Fetch labels from backport-pr-url if available

Currently labels are fetched from original PR. sometimes we backport a semver-patch version of a semver-major change.

We should check for backport-pr-url and fetch appropriate labels

What about templating, or deep configuration, or simple API?

I'm going to try http://keepachangelog.com/ and need some tiny improvements for autogenerating CHANGELOG.md.

As I see:

  • Need to parse somehow CHANGELOG.md to get sections with commits list;
  • Remove already added commit from import;
  • Split commits list to different sections;
  • Generate new release section for unreleased section since last tag (or since passed --start-ref).
  • Replace old unreleased with the new one.

Also it can be an option to finalize unreleased section with some tag (in that way we need to fetch 2 tags: previous and the last, and use them as start and end refs).

Bad commit summary line parse

nodejs/node@f856234

Something's bad about this one:

    process: internal/process/stdio.js cleanup / modernization

    Avoid using deprecated getter syntax plus other
    miscellaneous updates.

    PR-URL: https://github.com/nodejs/node/pull/6766
    Reviewed-By: Colin Ihrig <[email protected]>

Comes out as Avoid using deprecated getter syntax plus other

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.