Skip to content

Commit

Permalink
docs: Update changelog
Browse files Browse the repository at this point in the history
Change-Id: I9d035ae7907a0a34392f0493f5bf9207b6fcf146
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/185259
Reviewed-by: Kayce Basques <kayce@google.com>
Reviewed-by: Taylor Cramer <cramertj@google.com>
Commit-Queue: Kayce Basques <kayce@google.com>
Reviewed-by: Chad Norvell <chadnorvell@google.com>
  • Loading branch information
Kayce Basques authored and CQ Bot Account committed Dec 15, 2023
1 parent 5b32d8d commit f8c7114
Show file tree
Hide file tree
Showing 4 changed files with 551 additions and 18 deletions.
19 changes: 11 additions & 8 deletions docs/_static/js/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ async function annotate(commits) {
return tmp.substring(0, end).trim();
}

function parseBugUrl(message) {
const bugLabel = 'Bug:';
function parseBugUrl(message, bugLabel) {
const start = message.indexOf(bugLabel);
const tmp = message.substring(start);
const end = tmp.indexOf('\n');
Expand Down Expand Up @@ -144,7 +143,7 @@ async function annotate(commits) {
// situation. The same commit gets duplicated to each module's section.
// The rationale for the duplication is that someone might only care about
// pw_tokenizer and they should be able to see all commits that affected
// that module at a glance.
// in a single place.
if (commit.preamble.indexOf('{') > -1) {
commit.topics = [];
const topics = commit.preamble
Expand All @@ -157,11 +156,15 @@ async function annotate(commits) {
} else {
commit.topics = [commit.preamble];
}
// TODO: b/309534703 - Detect the synonymous labels like "Fixes"
if (message.indexOf('Bug:') > -1) {
const bugUrl = parseBugUrl(message);
const bugId = bugUrl.substring(bugUrl.lastIndexOf('/') + 1);
commit.issue = { id: bugId, url: bugUrl };
const bugLabels = ['Bug:', 'Fixes:', 'Fixed:'];
for (let i = 0; i < bugLabels.length; i++) {
const bugLabel = bugLabels[i];
if (message.indexOf(bugLabel) > -1) {
const bugUrl = parseBugUrl(message, bugLabel);
const bugId = bugUrl.substring(bugUrl.lastIndexOf('/') + 1);
commit.issue = { id: bugId, url: bugUrl };
break;
}
}
}
return commits;
Expand Down
Loading

0 comments on commit f8c7114

Please sign in to comment.