Skip to content

Commit

Permalink
[releng] Prepare next release
Browse files Browse the repository at this point in the history
Signed-off-by: Axel RICHARD <[email protected]>
  • Loading branch information
AxelRICHARD committed Dec 23, 2024
1 parent 536df9e commit 502471b
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 35 deletions.
23 changes: 23 additions & 0 deletions doc/content/modules/user-manual/pages/release-notes/2025.2.0.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
= 2025.2.0 (work in progress)

== Key highlights


== Breaking changes


== Bug fixes


== New features


== Improvements


== Dependency update


== Technical details

* For technical details on this {product} release please refer to https://github.com/eclipse-syson/syson/blob/main/CHANGELOG.adoc[changelog].
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

:sectnums!:

include::user-manual:release-notes/2025.2.0.adoc[leveloffset=+1]
include::user-manual:release-notes/2025.1.0.adoc[leveloffset=+1]
include::user-manual:release-notes/2024.11.0.adoc[leveloffset=+1]
include::user-manual:release-notes/2024.9.0.adoc[leveloffset=+1]
Expand Down
2 changes: 1 addition & 1 deletion doc/docs-site/antora-playbook.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
site:
title: SysON Docs
start_page: v2024.11.0@syson::index.adoc
start_page: v2025.1.0@syson::index.adoc

output:
clean: true
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
networks:
- syson
app:
image: "${IMAGE_TAG:-eclipsesyson/syson:v2025.1.0}"
image: "${IMAGE_TAG:-eclipsesyson/syson:latest}"
ports:
- "8080:8080"
environment:
Expand Down
69 changes: 36 additions & 33 deletions scripts/check-changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
const childProcess = require('child_process');
const fs = require('fs');
const childProcess = require("child_process");
const fs = require("fs");

const workspace = process.env.GITHUB_WORKSPACE;
const event = process.env.GITHUB_EVENT;
Expand All @@ -21,62 +21,65 @@ const baseSHA = body.pull_request.base.sha;
const headSHA = body.pull_request.head.sha;

const gitLogCommand = `git log --format=format:%H ${baseSHA}..${headSHA}`;
const result = childProcess.execSync(gitLogCommand, { encoding: 'utf8' });
const result = childProcess.execSync(gitLogCommand, { encoding: "utf8" });
const lines = result.split(/\r?\n/);

console.log('The following commits will be reviewed:');
console.log("The following commits will be reviewed:");
console.log(lines);
console.log();

const changelog = fs.readFileSync(`${workspace}/CHANGELOG.adoc`, {
encoding: 'utf8',
encoding: "utf8",
});

const latestTag = childProcess.execSync('git describe --tags --abbrev=0', {
encoding: 'utf8',
const latestTag = childProcess.execSync("git describe --tags --abbrev=0", {
encoding: "utf8",
});

// Get the next release version based on the latest tag
const regexpCoordinates = /v(\d{4})\.(\d{1,2})\..*/g;
const match = regexpCoordinates.exec(latestTag);
let yearReleaseVersion = Number(match[1]);
let majorReleaseVersion = Number(match[2]);
if(majorReleaseVersion === 11) {
if (majorReleaseVersion === 11) {
yearReleaseVersion++;
}
majorReleaseVersion = (majorReleaseVersion + 2) % 12;
const nextReleaseVersion = yearReleaseVersion + '.' + majorReleaseVersion
const docChangelogPath = `doc/content/modules/user-manual/pages/release-notes/${nextReleaseVersion}.0.adoc`
const docChangelog = fs.readFileSync(`${workspace}/${docChangelogPath}`);
if (majorReleaseVersion === 3) {
majorReleaseVersion--;
}
const nextReleaseVersion = yearReleaseVersion + "." + majorReleaseVersion;
const releaseNotesPath = `doc/content/modules/user-manual/pages/release-notes/${nextReleaseVersion}.0.adoc`;
const releaseNotes = fs.readFileSync(`${workspace}/${releaseNotesPath}`);

const invalidChangelogContent =
changelog.includes('<<<<<<<') ||
changelog.includes('=======') ||
changelog.includes('>>>>>>>');
changelog.includes("<<<<<<<") ||
changelog.includes("=======") ||
changelog.includes(">>>>>>>");

const invalidDocChangelogContent =
docChangelog.includes('<<<<<<<') ||
docChangelog.includes('=======') ||
docChangelog.includes('>>>>>>>');
const invalidReleaseNotesContent =
releaseNotes.includes("<<<<<<<") ||
releaseNotes.includes("=======") ||
releaseNotes.includes(">>>>>>>");

const missingIssuesInChangelog = [];
const missingIssuesInDocChangelog = [];
const missingIssuesInReleaseNotes = [];
for (let index = 0; index < lines.length; index++) {
const line = lines[index];
const gitShowCommand = `git rev-list --format=%B --max-count=1 ${line}`;
const commitMessage = childProcess.execSync(gitShowCommand, {
encoding: 'utf8',
encoding: "utf8",
});
const commitMessageLines = commitMessage.split(/\r?\n/);

if (commitMessageLines.length > 1) {
// Skip the first line which only contains the hash of the commit
const title = commitMessageLines[1];

const tagStartIndex = title.indexOf('[');
const tagEndIndex = title.indexOf(']', tagStartIndex);
const tagStartIndex = title.indexOf("[");
const tagEndIndex = title.indexOf("]", tagStartIndex);
if (tagStartIndex >= 0 && tagStartIndex < tagEndIndex) {
const tag = title.substring(tagStartIndex + '['.length, tagEndIndex);
const tag = title.substring(tagStartIndex + "[".length, tagEndIndex);

const tagAsNumber = Number(tag);
if (!isNaN(tagAsNumber)) {
Expand All @@ -86,14 +89,14 @@ for (let index = 0; index < lines.length; index++) {
missingIssuesInChangelog.push(issueURL);
}

// Check that the documentation changelog has been updated in the commit
// Check that the release notes has been updated in the commit
const gitDescribeCommand = `git diff-tree --no-commit-id --name-only ${line} -r`;
const changedFiles = childProcess.execSync(gitDescribeCommand, {
encoding: 'utf8',
encoding: "utf8",
});
const changedFilesLines = changedFiles.split(/\r?\n/);
if(!changedFilesLines.includes(docChangelogPath)) {
missingIssuesInDocChangelog.push(issueURL);
if (!changedFilesLines.includes(releaseNotesPath)) {
missingIssuesInReleaseNotes.push(issueURL);
}
}
}
Expand All @@ -102,24 +105,24 @@ for (let index = 0; index < lines.length; index++) {

if (missingIssuesInChangelog.length > 0) {
console.log(
'The following issues should appear in the CHANGELOG with some documentation'
"The following issues should appear in the CHANGELOG with some documentation"
);
console.log(missingIssuesInChangelog);
process.exit(1);
} else if(missingIssuesInDocChangelog.length > 0) {
} else if (missingIssuesInReleaseNotes.length > 0) {
console.log(
`The commits referencing the following issues should contain a modification of the latest documentation changelog (${docChangelogPath})`
`The commits referencing the following issues should contain a modification of the latest release notes (${releaseNotesPath})`
);
console.log(missingIssuesInDocChangelog);
console.log(missingIssuesInReleaseNotes);
process.exit(1);
} else if (invalidChangelogContent) {
console.log(
'The CHANGELOG seems to contain Git conflict markers like "<<<<<<<", "=======" or ">>>>>>>"'
);
process.exit(1);
} else if(invalidDocChangelogContent) {
} else if (invalidReleaseNotesContent) {
console.log(
'The documentation changelog seems to contains Git conflict markers like "<<<<<<<", "=======" or ">>>>>>>"'
'The release notes seems to contains Git conflict markers like "<<<<<<<", "=======" or ">>>>>>>"'
);
process.exit(1);
}

0 comments on commit 502471b

Please sign in to comment.