Update version.js to accept dev build version format

- fixes #9184
pull/9374/head^2
Sam Moran 2022-10-16 16:47:06 -07:00 zatwierdzone przez LB (Ben Johnston)
rodzic f86073c55e
commit 45f0c73ff4
4 zmienionych plików z 13 dodań i 1 usunięć

Wyświetl plik

@ -78,6 +78,7 @@ Changelog
* Fix: Avoid creating an extra rich text block when inserting a new block at the end of the content (Matt Westcott)
* Fix: Removed the extra dot in the Wagtail version shown within the admin settings menu item (Loveth Omokaro)
* Fix: Fully remove the obsolete `wagtailsearch_editorspick` table that prevents flushing the database (Matt Westcott)
* Fix: Update latest version message on Dashboard to accept dev build version format used on nlightly builds (Sam Moran)
4.0.3 (xx.xx.xxxx) - IN DEVELOPMENT

Wyświetl plik

@ -25,7 +25,7 @@ class VersionDeltaType {
class VersionNumber {
constructor(versionString) {
const versionRegex =
/^(?<major>\d+)\.{1}(?<minor>\d+)((\.{1}(?<patch>\d+))|(?<preReleaseStep>a|b|rc){1}(?<preReleaseVersion>\d+)){0,1}$/;
/^(?<major>\d+)\.{1}(?<minor>\d+)((\.{1}(?<patch>\d+))|(?<preReleaseStep>a|b|rc|\.dev){1}(?<preReleaseVersion>\d+)){0,1}$/;
const matches = versionString.match(versionRegex);
if (matches === null) {
throw new VersionNumberFormatError(versionString);

Wyświetl plik

@ -116,6 +116,16 @@ describe('version.VersionNumber initialisation', () => {
expect(result.preReleaseVersion).toBe(23);
});
it('initialises dev 4.1.dev20220912', () => {
const result = new VersionNumber('4.1.dev20220912');
expect(result.major).toBe(4);
expect(result.minor).toBe(1);
expect(result.patch).toBe(0);
expect(result.preReleaseStep).toBe('.dev');
expect(result.preReleaseVersion).toBe(20220912);
});
it('initialisation throws error for 1', () => {
expect(() => new VersionNumber('1')).toThrow(VersionNumberFormatError);
});

Wyświetl plik

@ -110,6 +110,7 @@ There are multiple improvements to the documentation theme this release, here ar
* Avoid creating an extra rich text block when inserting a new block at the end of the content (Matt Westcott)
* Removed the extra dot in the Wagtail version shown within the admin settings menu item (Loveth Omokaro)
* Fully remove the obsolete `wagtailsearch_editorspick` table that prevents flushing the database (Matt Westcott)
* Update latest version message on Dashboard to accept dev build version format used on nlightly builds (Sam Moran)
## Upgrade considerations