Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct renderChangelogLine hook usage #1607

Merged
merged 1 commit into from
Oct 26, 2020
Merged

Conversation

hipstersmoothie
Copy link
Collaborator

@hipstersmoothie hipstersmoothie commented Oct 26, 2020

Release notes

We were implementing the renderChangelogLine in a way that was more complex than needed

Previously the hook took a tuple and had to return a tuple

auto.hooks.onCreateChangelog.tapPromise('Stars', changelog =>
  changelog.hooks.renderChangelogLine.tapPromise(
    'Stars',
    async ([commit, line]) =>
      [commit, `${line.replace('-', ':star:')}\n`]
  );
);

Now it can just return the rendered changelog line

auto.hooks.onCreateChangelog.tapPromise('Stars', changelog =>
  changelog.hooks.renderChangelogLine.tapPromise(
    'Stars',
    async (line, commit) => `${line.replace('-', ':star:')}\n`
  );
);

Why

Simplifies hook usage

Todo:

  • Add tests
  • Add docs

Change Type

Indicate the type of change your pull request is:

  • documentation
  • patch
  • minor
  • major
📦 Published PR as canary version: under canary scope @auto-canary@9.60.2-canary.1607.19710.0

✨ Test out this PR locally via:

npm install @auto-canary/bot-list@9.60.2-canary.1607.19710.0
npm install @auto-canary/auto@9.60.2-canary.1607.19710.0
npm install @auto-canary/core@9.60.2-canary.1607.19710.0
npm install @auto-canary/all-contributors@9.60.2-canary.1607.19710.0
npm install @auto-canary/brew@9.60.2-canary.1607.19710.0
npm install @auto-canary/chrome@9.60.2-canary.1607.19710.0
npm install @auto-canary/cocoapods@9.60.2-canary.1607.19710.0
npm install @auto-canary/conventional-commits@9.60.2-canary.1607.19710.0
npm install @auto-canary/crates@9.60.2-canary.1607.19710.0
npm install @auto-canary/docker@9.60.2-canary.1607.19710.0
npm install @auto-canary/exec@9.60.2-canary.1607.19710.0
npm install @auto-canary/first-time-contributor@9.60.2-canary.1607.19710.0
npm install @auto-canary/gem@9.60.2-canary.1607.19710.0
npm install @auto-canary/gh-pages@9.60.2-canary.1607.19710.0
npm install @auto-canary/git-tag@9.60.2-canary.1607.19710.0
npm install @auto-canary/gradle@9.60.2-canary.1607.19710.0
npm install @auto-canary/jira@9.60.2-canary.1607.19710.0
npm install @auto-canary/maven@9.60.2-canary.1607.19710.0
npm install @auto-canary/npm@9.60.2-canary.1607.19710.0
npm install @auto-canary/omit-commits@9.60.2-canary.1607.19710.0
npm install @auto-canary/omit-release-notes@9.60.2-canary.1607.19710.0
npm install @auto-canary/pr-body-labels@9.60.2-canary.1607.19710.0
npm install @auto-canary/released@9.60.2-canary.1607.19710.0
npm install @auto-canary/s3@9.60.2-canary.1607.19710.0
npm install @auto-canary/slack@9.60.2-canary.1607.19710.0
npm install @auto-canary/twitter@9.60.2-canary.1607.19710.0
npm install @auto-canary/upload-assets@9.60.2-canary.1607.19710.0
# or 
yarn add @auto-canary/bot-list@9.60.2-canary.1607.19710.0
yarn add @auto-canary/auto@9.60.2-canary.1607.19710.0
yarn add @auto-canary/core@9.60.2-canary.1607.19710.0
yarn add @auto-canary/all-contributors@9.60.2-canary.1607.19710.0
yarn add @auto-canary/brew@9.60.2-canary.1607.19710.0
yarn add @auto-canary/chrome@9.60.2-canary.1607.19710.0
yarn add @auto-canary/cocoapods@9.60.2-canary.1607.19710.0
yarn add @auto-canary/conventional-commits@9.60.2-canary.1607.19710.0
yarn add @auto-canary/crates@9.60.2-canary.1607.19710.0
yarn add @auto-canary/docker@9.60.2-canary.1607.19710.0
yarn add @auto-canary/exec@9.60.2-canary.1607.19710.0
yarn add @auto-canary/first-time-contributor@9.60.2-canary.1607.19710.0
yarn add @auto-canary/gem@9.60.2-canary.1607.19710.0
yarn add @auto-canary/gh-pages@9.60.2-canary.1607.19710.0
yarn add @auto-canary/git-tag@9.60.2-canary.1607.19710.0
yarn add @auto-canary/gradle@9.60.2-canary.1607.19710.0
yarn add @auto-canary/jira@9.60.2-canary.1607.19710.0
yarn add @auto-canary/maven@9.60.2-canary.1607.19710.0
yarn add @auto-canary/npm@9.60.2-canary.1607.19710.0
yarn add @auto-canary/omit-commits@9.60.2-canary.1607.19710.0
yarn add @auto-canary/omit-release-notes@9.60.2-canary.1607.19710.0
yarn add @auto-canary/pr-body-labels@9.60.2-canary.1607.19710.0
yarn add @auto-canary/released@9.60.2-canary.1607.19710.0
yarn add @auto-canary/s3@9.60.2-canary.1607.19710.0
yarn add @auto-canary/slack@9.60.2-canary.1607.19710.0
yarn add @auto-canary/twitter@9.60.2-canary.1607.19710.0
yarn add @auto-canary/upload-assets@9.60.2-canary.1607.19710.0

@codecov
Copy link

codecov bot commented Oct 26, 2020

Codecov Report

Merging #1607 into next will increase coverage by 0.18%.
The diff coverage is 80.58%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #1607      +/-   ##
==========================================
+ Coverage   80.95%   81.13%   +0.18%     
==========================================
  Files          54       60       +6     
  Lines        3948     4516     +568     
  Branches      809      973     +164     
==========================================
+ Hits         3196     3664     +468     
- Misses        540      580      +40     
- Partials      212      272      +60     
Impacted Files Coverage Δ
packages/bot-list/src/index.ts 0.00% <ø> (ø)
packages/cli/src/bin/auto.ts 17.64% <0.00%> (ø)
packages/cli/src/parse-args.ts 97.29% <ø> (ø)
packages/core/src/match-sha-to-pr.ts 93.10% <ø> (ø)
packages/core/src/utils/get-lerna-packages.ts 33.33% <0.00%> (ø)
packages/core/src/utils/load-plugins.ts 81.18% <ø> (ø)
packages/core/src/utils/logger.ts 70.00% <ø> (ø)
packages/core/src/utils/make-hooks.ts 100.00% <ø> (ø)
plugins/chrome/src/index.ts 8.10% <0.00%> (-0.12%) ⬇️
plugins/maven/src/index.ts 87.15% <ø> (+1.25%) ⬆️
... and 48 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 c9aa70d...bfddc45. Read the comment docs.

@hipstersmoothie hipstersmoothie merged commit ea4e0b5 into next Oct 26, 2020
@hipstersmoothie hipstersmoothie deleted the renderChangelogLine branch October 26, 2020 23:08
@hipstersmoothie hipstersmoothie added the major Increment the major version when merged label Oct 26, 2020
@adierkens adierkens added the prerelease This change is available in a prerelease. label Oct 26, 2020
@adierkens adierkens mentioned this pull request Oct 26, 2020
@adierkens
Copy link
Collaborator

🚀 PR was released in v10.0.0 🚀

@adierkens adierkens added released This issue/pull request has been released. and removed prerelease This change is available in a prerelease. labels Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Increment the major version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants