- introduce capability of the action running 2 split

- first collect all pull requests and export to environment
  - second take exported data and continue generation of changelogs (makes it cheaper, by only collecting PRs once)
This commit is contained in:
Mike Penz
2023-05-26 13:41:59 +00:00
committed by GitHub
parent 66470e5f14
commit 0a80bc9a3b
12 changed files with 515 additions and 240 deletions
+42 -14
View File
@@ -19,7 +19,9 @@ it('Should match generated changelog (unspecified fromTag)', async () => {
false, // enable to fetch reviewers
false, // enable to fetch tag release information
false, // enable to fetch reviews
false,
false, // enable commitMode
false, // enable exportCollected
false, // enable exportOnly
configuration
)
@@ -49,7 +51,9 @@ it('Should match generated changelog (unspecified tags)', async () => {
false, // enable to fetch reviewers
false, // enable to fetch tag release information
false, // enable to fetch reviews
false,
false, // enable commitMode
false, // enable exportCollected
false, // enable exportOnly
configuration
)
@@ -74,7 +78,9 @@ it('Should use empty placeholder', async () => {
false, // enable to fetch reviewers
false, // enable to fetch tag release information
false, // enable to fetch reviews
false,
false, // enable commitMode
false, // enable exportCollected
false, // enable exportOnly
configuration
)
@@ -99,7 +105,9 @@ it('Should fill empty placeholders', async () => {
false, // enable to fetch reviewers
false, // enable to fetch tag release information
false, // enable to fetch reviews
false,
false, // enable commitMode
false, // enable exportCollected
false, // enable exportOnly
configuration
)
@@ -126,7 +134,9 @@ it('Should fill `template` placeholders', async () => {
false, // enable to fetch reviewers
false, // enable to fetch tag release information
false, // enable to fetch reviews
false,
false, // enable commitMode
false, // enable exportCollected
false, // enable exportOnly
configuration
)
@@ -153,7 +163,9 @@ it('Should fill `template` placeholders, ignore', async () => {
false, // enable to fetch reviewers
false, // enable to fetch tag release information
false, // enable to fetch reviews
false,
false, // enable commitMode
false, // enable exportCollected
false, // enable exportOnly
configuration
)
@@ -180,7 +192,9 @@ it('Uncategorized category', async () => {
false, // enable to fetch reviewers
false, // enable to fetch tag release information
false, // enable to fetch reviews
false,
false, // enable commitMode
false, // enable exportCollected
false, // enable exportOnly
configuration
)
@@ -207,7 +221,9 @@ it('Verify commit based changelog', async () => {
false, // enable to fetch reviewers
false, // enable to fetch tag release information
false, // enable to fetch reviews
true,
false, // enable commitMode
false, // enable exportCollected
false, // enable exportOnly
configuration
)
@@ -234,7 +250,9 @@ it('Verify commit based changelog, with emoji categorisation', async () => {
false, // enable to fetch reviewers
false, // enable to fetch tag release information
false, // enable to fetch reviews
true,
false, // enable commitMode
false, // enable exportCollected
false, // enable exportOnly
configuration
)
@@ -261,7 +279,9 @@ it('Verify default inclusion of open PRs', async () => {
false, // enable to fetch reviewers
false, // enable to fetch tag release information
false, // enable to fetch reviews
false, // commitMode
false, // enable commitMode
false, // enable exportCollected
false, // enable exportOnly
configuration // configuration
)
@@ -288,7 +308,9 @@ it('Verify custom categorisation of open PRs', async () => {
false, // enable to fetch reviewers
false, // enable to fetch tag release information
false, // enable to fetch reviews
false, // commitMode
false, // enable commitMode
false, // enable exportCollected
false, // enable exportOnly
configuration // configuration
)
@@ -315,7 +337,9 @@ it('Verify reviewers who approved are fetched and also release information', asy
true, // enable to fetch reviewers
true, // enable to fetch tag release information
false, // enable to fetch reviews
false, // commitMode
false, // enable commitMode
false, // enable exportCollected
false, // enable exportOnly
configuration // configuration
)
@@ -343,7 +367,9 @@ it('Fetch release information', async () => {
false, // enable to fetch reviewers
true, // enable to fetch tag release information
false, // enable to fetch reviews
false, // commitMode
false, // enable commitMode
false, // enable exportCollected
false, // enable exportOnly
configuration // configuration
)
@@ -369,7 +395,9 @@ it('Fetch release information for non existing tag / release', async () => {
false, // enable to fetch reviewers
true, // enable to fetch tag release information
false, // enable to fetch reviews
false, // commitMode
false, // enable commitMode
false, // enable exportCollected
false, // enable exportOnly
configuration // configuration
)
+20 -20
View File
@@ -25,9 +25,9 @@ it('Should have empty changelog (tags)', async () => {
fetchReviews: false,
commitMode: false,
configuration
})
}, false, false)
const changeLog = buildChangelog(data.diffInfo, data.mergedPullRequests, data.options)
const changeLog = buildChangelog(data!.diffInfo, data!.mergedPullRequests, data!.options)
console.log(changeLog)
expect(changeLog).toStrictEqual('- no changes')
})
@@ -46,9 +46,9 @@ it('Should match generated changelog (tags)', async () => {
fetchReviews: false,
commitMode: false,
configuration
})
}, false, false)
const changeLog = buildChangelog(data.diffInfo, data.mergedPullRequests, data.options)
const changeLog = buildChangelog(data!.diffInfo, data!.mergedPullRequests, data!.options)
console.log(changeLog)
expect(changeLog).toStrictEqual(`## 🧪 Tests
@@ -72,9 +72,9 @@ it('Should match generated changelog (refs)', async () => {
fetchReviews: false,
commitMode: false,
configuration
})
}, false, false)
const changeLog = buildChangelog(data.diffInfo, data.mergedPullRequests, data.options)
const changeLog = buildChangelog(data!.diffInfo, data!.mergedPullRequests, data!.options)
console.log(changeLog)
expect(changeLog).toStrictEqual(`## 🧪 Tests
@@ -106,9 +106,9 @@ it('Should match generated changelog and replace all occurrences (refs)', async
fetchReviews: false,
commitMode: false,
configuration
})
}, false, false)
const changeLog = buildChangelog(data.diffInfo, data.mergedPullRequests, data.options)
const changeLog = buildChangelog(data!.diffInfo, data!.mergedPullRequests, data!.options)
console.log(changeLog)
expect(changeLog).toStrictEqual(`## 🧪 Tests
@@ -142,9 +142,9 @@ it('Should match ordered ASC', async () => {
fetchReviews: false,
commitMode: false,
configuration
})
}, false, false)
const changeLog = buildChangelog(data.diffInfo, data.mergedPullRequests, data.options)
const changeLog = buildChangelog(data!.diffInfo, data!.mergedPullRequests, data!.options)
console.log(changeLog)
expect(changeLog).toStrictEqual(`## 🚀 Features\n\n22\n24\n25\n26\n28\n\n## 🐛 Fixes\n\n23\n\n`)
})
@@ -163,9 +163,9 @@ it('Should match ordered DESC', async () => {
fetchReviews: false,
commitMode: false,
configuration
})
}, false, false)
const changeLog = buildChangelog(data.diffInfo, data.mergedPullRequests, data.options)
const changeLog = buildChangelog(data!.diffInfo, data!.mergedPullRequests, data!.options)
console.log(changeLog)
expect(changeLog).toStrictEqual(`## 🚀 Features\n\n28\n26\n25\n24\n22\n\n## 🐛 Fixes\n\n23\n\n`)
})
@@ -184,9 +184,9 @@ it('Should match ordered by title ASC', async () => {
fetchReviews: false,
commitMode: false,
configuration
})
}, false, false)
const changeLog = buildChangelog(data.diffInfo, data.mergedPullRequests, data.options)
const changeLog = buildChangelog(data!.diffInfo, data!.mergedPullRequests, data!.options)
console.log(changeLog)
expect(changeLog).toStrictEqual(
`## 🚀 Features\n\nEnhanced action logs\nImprove README\nImproved configuration failure handling\nImproved defaults if no configuration is provided\nIntroduce additional placeholders [milestone, labels, assignees, reviewers]\n\n## 🐛 Fixes\n\nImproved handling for non existing tags\n\n`
@@ -207,9 +207,9 @@ it('Should match ordered by title DESC', async () => {
fetchReviews: false,
commitMode: false,
configuration
})
}, false, false)
const changeLog = buildChangelog(data.diffInfo, data.mergedPullRequests, data.options)
const changeLog = buildChangelog(data!.diffInfo, data!.mergedPullRequests, data!.options)
console.log(changeLog)
expect(changeLog).toStrictEqual(
`## 🚀 Features\n\nIntroduce additional placeholders [milestone, labels, assignees, reviewers]\nImproved defaults if no configuration is provided\nImproved configuration failure handling\nImprove README\nEnhanced action logs\n\n## 🐛 Fixes\n\nImproved handling for non existing tags\n\n`
@@ -230,9 +230,9 @@ it('Should ignore PRs not merged into develop branch', async () => {
fetchReviews: false,
commitMode: false,
configuration
})
}, false, false)
const changeLog = buildChangelog(data.diffInfo, data.mergedPullRequests, data.options)
const changeLog = buildChangelog(data!.diffInfo, data!.mergedPullRequests, data!.options)
console.log(changeLog)
expect(changeLog).toStrictEqual(`150\n\n`)
})
@@ -251,9 +251,9 @@ it('Should ignore PRs not merged into main branch', async () => {
fetchReviews: false,
commitMode: false,
configuration
})
}, false, false)
const changeLog = buildChangelog(data.diffInfo, data.mergedPullRequests, data.options)
const changeLog = buildChangelog(data!.diffInfo, data!.mergedPullRequests, data!.options)
console.log(changeLog)
expect(changeLog).toStrictEqual(`153\n\n`)
})