fix: pass correct repo url for nightly (#158)

fix: pass correct repo url for nightly

The amendMatrixForNext function uses the repository argument to
determine the version constraint for the returned matrix for kind
nightly.
Previously, the upstream-mirror repo url was passed as an argument, but
the nightly builds use a different repo url.
This resulted in failed builds, because the version string 'next' could
not be parsed by composer.

Example:
https://github.com/mage-os/generate-mirror-repo-js/actions/runs/6370219504/job/17291152703

With this change, the nightly kind will always return the @alpha
version constraint, that is, stability constraint.
There currently is no way to distinguish between different nightly
repos, but since both work the same way, this is fine (for now).
This commit is contained in:
Vinai Kopp
2023-10-02 06:27:52 +13:00
committed by GitHub
parent b7a037a472
commit b645c2327d
3 changed files with 6 additions and 5 deletions
+4 -4
View File
File diff suppressed because one or more lines are too long
@@ -36,6 +36,7 @@ describe('getMatrixForKind for mage-os', () => {
const result = getMatrixForKind("nightly", project);
expect(result.magento).toBeDefined();
expect(result.include).toBeDefined();
expect(result.magento[0]).toBe('mage-os/project-community-edition:@alpha');
});
it('returns a matrix for the next release when using `nightly`', () => {
@@ -14,7 +14,7 @@ export const getMatrixForKind = (kind: string, project: string, versions = "") =
case 'currently-supported':
return getMatrixForVersions(project, getCurrentlySupportedVersions(project, new Date()));
case 'nightly':
return amendMatrixForNext(getMatrixForVersions(project, nightlyJson[project]), 'https://upstream-mirror.mage-os.org', getDayBefore());
return amendMatrixForNext(getMatrixForVersions(project, nightlyJson[project]), 'https://upstream-nightly.mage-os.org', getDayBefore());
case 'all':
return getMatrixForVersions(project, Object.keys(getIndividualVersionsForProject(project)));
case 'custom':