ai assisted
Build on RHEL9 docker image / build (push) Successful in 4m13s
Build on RHEL8 docker image / build (push) Successful in 5m7s
Run Simulator Tests on local RHEL9 / build (push) Failing after 10m12s
Run Simulator Tests on local RHEL8 / build (push) Successful in 23m28s

This commit is contained in:
maliakal_d committed 2026-09-16 16:19:39 +02:00
1 parent 3e0c794a3b
commit 11afc4ed5a
1 file changed
+32 -9
+32 -9
View File
@@ -67,6 +67,35 @@ jobs:
return section;
};
/**
* Upserts AI assisted notes subsection under ## Release notes.
*/
const upsertAiAssistedReleaseNotes = (body = '') => {
const releaseNotesSectionPattern =
/(^|\n)(##\s*Release notes\s*\n)([\s\S]*?)(?=\n##\s+\S|\s*$)/i;
const aiSubsectionPattern =
/(^|\n)###\s*AI Assisted Release Notes\s*\n([\s\S]*?)(?=\n###\s+\S|\n##\s+\S|\s*$)/gi;
return body.replace(
releaseNotesSectionPattern,
(fullMatch, prefix, heading, sectionBody) => {
const cleanedSectionBody = (sectionBody || '')
.replace(aiSubsectionPattern, '\n')
.trimEnd();
const aiSubsection =
'### AI Assisted Release Notes\n\n' +
'**This section will be populated with AI-assisted release notes.**\n';
const updatedSectionBody =
(cleanedSectionBody ? `${cleanedSectionBody}\n\n` : '') +
aiSubsection;
return `${prefix}${heading}${updatedSectionBody}`;
}
);
};
/**
* Parses a list of PR numbers from the given text.
*/
@@ -143,7 +172,7 @@ jobs:
core.info('Only developing detector labels: ' + hasOnlyDevelopingDetectors);
const releaseNotes = findReleaseNotesSection(pr.body || '');
core.info('Release notes in current PR: ' + (releaseNotes ? 'true' : 'false'));
core.info('Release notes in current PR: ' + (releaseNotes ? 'true\n' : 'false\n'));
if (hasInfrastructure || hasOnlyDevelopingDetectors) {
if (releaseNotes) {
@@ -152,7 +181,7 @@ jobs:
);
return;
}
core.info('\nNo release notes found, which is valid for Infrastructure or only developing Detector PRs.');
core.info('No release notes found, which is valid for Infrastructure or only developing Detector PRs.');
return;
}
@@ -161,13 +190,7 @@ jobs:
* Add AI assisted release notes and return
*/
if (releaseNotes) {
// Remove any existing details section with heading "AI Assisted Release Notes"
const updatedBody = pr.body.replace(
/(^|\n)#{1,6}\s*AI Assisted Release Notes\s*\n([\s\S]*?)(?=\n#{1,6}\s+\S|\s*$)/gi,
''
).trim();
// Add a new section with heading "AI Assisted Release Notes" and placeholder text
const newBody = `${updatedBody}\n\n## AI Assisted Release Notes\n\n**This section will be populated with AI-assisted release notes.**\n\n`;
const newBody = upsertAiAssistedReleaseNotes(pr.body || '');
await github.rest.pulls.update({
owner: context.repo.owner,