Skip to content

Commit b3ffce1

Browse files
committed
Extend display of adjustments made during Acknowledgements generation
Assign a severity to the different kind of adjustments and list missing contributors due to missing Github author data.
1 parent bd39248 commit b3ffce1

1 file changed

Lines changed: 40 additions & 16 deletions

File tree

.github/workflows/generateAcknowledgements.yml

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
const contributorNames = new Map()
8080
const profileReplacements = new Set()
8181
const skippedBotAccounts = new Set()
82+
const missingAuthorData = new Set()
8283
for (const repo of allRepos) {
8384
let [organization, repository] = repo.split('/')
8485
let contributors = computeIfAbsent(orgaContributors, organization, () => new Set())
@@ -129,7 +130,8 @@ jobs:
129130
contributors.add(profile)
130131
computeIfAbsent(contributorNames, profile, () => new Set()).add(authorName)
131132
} else { // author is null for directly pushed commits, which happens e.g. for I-build submodule updates
132-
console.log("Skip commit of " + authorName)
133+
console.warn(`Skip commit of author ${authorName}`)
134+
missingAuthorData.add(`\`${authorName}\` in repository \`${repository}\``)
133135
}
134136
commitCount++
135137
}
@@ -211,9 +213,39 @@ jobs:
211213
fs.writeFileSync(acknowledgementsFile, lines.join('\n'), {encoding: 'utf8'})
212214
213215
// Set adjustments as outputs in order to append them to the PR message
214-
core.setOutput('profile-replacements', Array.from(profileReplacements).map(r => " - " + r).join("\n"));
215-
core.setOutput('skipped-bots', Array.from(skippedBotAccounts).map(b => " - @" + b).join("\n"));
216-
core.setOutput('name-inconsistencies', nameInconsistencies.map(l => " - " + l).join("\n"));
216+
let contributorAdjustments = ''
217+
if (nameInconsistencies.length) {
218+
contributorAdjustments += `
219+
> [!WARNING]
220+
> Profiles with inconsistent git author names:
221+
${nameInconsistencies.map(n => '> - ' + n).join('\n')}
222+
>
223+
> _To avoid name inconsistencies in the future, please ensure you use the same author names across all your local git repositories (e.g. by setting \`git config --global user.name "Your Name"\`) and across devices!
224+
> If the selected name, simply the longest one (and marked in bold), is incorrect, please let us know._
225+
`
226+
}
227+
if (missingAuthorData.size > 0) {
228+
contributorAdjustments += `
229+
> [!WARNING]
230+
> Authors skipped due to missing author data at GitHub (probably their email isn't connect to their Github account):
231+
${Array.from(missingAuthorData).map(a => '> - ' + a).join('\n')}
232+
`
233+
}
234+
if (profileReplacements.size > 0) {
235+
contributorAdjustments += `
236+
> [!IMPORTANT]
237+
> Replaced profiles:
238+
${Array.from(profileReplacements).map(r => '> - ' + r).join('\n')}
239+
`
240+
}
241+
if (skippedBotAccounts.size > 0) {
242+
contributorAdjustments += `
243+
> [!NOTE]
244+
> Excluded bot accounts:
245+
${Array.from(skippedBotAccounts).map(b => '> - @' + b).join('\n')}
246+
`
247+
}
248+
core.setOutput('contributor-adjustments', contributorAdjustments)
217249
218250
function isTagAvailable(tagName) {
219251
return github.rest.git.getRef({
@@ -230,7 +262,7 @@ jobs:
230262
231263
function isBot(author) {
232264
const email = author.email.toLowerCase()
233-
return email.endsWith("-bot@eclipse.org") || email.endsWith("[bot]@users.noreply.github.com") || author.name == 'eclipse-releng-bot'
265+
return email.endsWith("-bot@eclipse.org") || email.endsWith("[bot]@users.noreply.github.com")
234266
|| email.endsWith('+copilot@users.noreply.github.com')
235267
|| email.endsWith('+claude@users.noreply.github.com')
236268
}
@@ -255,15 +287,7 @@ jobs:
255287
body: |
256288
Update the list of contributors in the Acknowledgements for `${{ inputs.eclipse-version }}`.
257289
258-
Adjustments to the lists of contributors:
259-
- Replaced profiles:
260-
${{ steps.collect-contributors.outputs.profile-replacements && steps.collect-contributors.outputs.profile-replacements || 'None' }}
261-
- Profiles with inconsistent git author names:
262-
_To avoid this in the future, please ensure you use the same author names across all your local git repositories (e.g. by setting `git config --global user.name "Your Name"`) and across devices!
263-
If the selected name, simply the longest one (and marked in bold), is incorrect, please let us know._
264-
${{ steps.collect-contributors.outputs.name-inconsistencies && steps.collect-contributors.outputs.name-inconsistencies || 'None' }}
265-
- Excluded bot-accounts:
266-
${{ steps.collect-contributors.outputs.skipped-bots && steps.collect-contributors.outputs.skipped-bots || 'None' }}
267-
268-
Please verify these adjustments for correctness and grant those who are affected sufficient time to refine the adjustments.
290+
The list of contributors has been adjusted with the changes listed below.
291+
Verify them for correctness and, if necessary, grant the affected persons sufficient time to refine these adjustments.
292+
${{ steps.collect-contributors.outputs.contributor-adjustments }}
269293
delete-branch: true

0 commit comments

Comments
 (0)