You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The dependabot PRs lack the normally required "sections" (category and summary). The utility function that needs to be updated is the getSections found here:
it('should extract the parts of a commit message',()=>{
constinput=stripIndent`
feat(tooltip): Fix OverflowTooltip with SVG icons in IE11 (#1234)
My summary
[category:Components]
Release Note:
My release notes
### BREAKING CHANGES
Some breaking changes
`
constexpected={
title: 'feat(tooltip): Fix OverflowTooltip with SVG icons in IE11',
pull_request: '1234',
category: 'Components',
'release note': 'My release notes',
'breaking change': 'Some breaking changes',
}
expect(getCommitParts(input)).toEqual(expected)
})
it('should remove the breaking indicator from the title',()=>{
constinput=stripIndent`
feat(tooltip)!: Fix OverflowTooltip with SVG icons in IE11 (#1234)
`
constexpected={
title: 'feat(tooltip): Fix OverflowTooltip with SVG icons in IE11',
pull_request: '1234',
category: 'Components',
}
expect(getCommitParts(input)).toEqual(expected)
})
it('should guess that "ci:" is infrastructure',()=>{
constinput=stripIndent`
ci: Upgrade to Github Actions (#1234)
My summary
`
constexpected={
title: 'ci: Upgrade to Github Actions',
pull_request: '1234',
category: 'Infrastructure',
}
expect(getCommitParts(input)).toEqual(expected)
})
})
The tests are set up the following way:
input: The PR body. The contents of a Dependabot PR could be copy/pasted into the test
expected: The sections that will be passed to create a merge title and body
For example, the linked PR should produce an expected sections like the following:
constexpected={summary: 'Bumps [prismjs](https://github.com/PrismJS/prism) from 1.25.0 to 1.27.0.','release category': 'Dependencies',}
No other code needs to be updated other than utils.ts and utils.test.ts which means the code should be 100% unit tested without worry our CI will crash!
The text was updated successfully, but these errors were encountered:
it('should parse dependabot pull requests',()=>{constinput=stripIndent` Bumps [prismjs](https://github.com/PrismJS/prism) from 1.25.0 to 1.27.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/PrismJS/prism/releases">prismjs's releases</a>.</em></p> <blockquote> <h2>v1.27.0</h2> <p>Release 1.27.0</p> <h2>v1.26.0</h2> <p>Release 1.26.0</p> </blockquote> </details> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=prismjs&package-manager=npm_and_yarn&previous-version=1.25.0&new-version=1.27.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting \`@dependabot rebase\`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/Workday/canvas-kit/network/alerts). </details> `constexpected={summary: 'Bumps [prismjs](https://github.com/PrismJS/prism) from 1.25.0 to 1.27.0.','release category': 'Dependencies',}expect(getSections(input)).toEqual(expected)})
We ignore PR lint rules for dependabot PRs because they are autogenerated, but this causes empty releases because this causes empty merge messages.
For example, the release notes are empty: https://github.com/Workday/canvas-kit/releases/tag/v7.0.13
Here's the PR: Workday/canvas-kit#1492
The dependabot PRs lack the normally required "sections" (category and summary). The utility function that needs to be updated is the
getSections
found here:canvas-kit-actions/src/utils.ts
Lines 101 to 153 in 79d637f
The tests for
getSections
are unit tests found here:canvas-kit-actions/src/utils.test.ts
Lines 182 to 290 in 79d637f
The tests are set up the following way:
For example, the linked PR should produce an expected sections like the following:
No other code needs to be updated other than
utils.ts
andutils.test.ts
which means the code should be 100% unit tested without worry our CI will crash!The text was updated successfully, but these errors were encountered: