Skip to content

Commit

Permalink
up to date supported runtime versions for existing runtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
gregra81 committed Oct 30, 2024
1 parent 857a0fe commit eaae6bc
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/services/schemas/mondaycoderc-schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { z } from 'zod';

// See here for all the supported versions https://cloud.google.com/docs/buildpacks/builders#buildergoogle-22_supported_languages
export const mondaycodercSchema = z
.object({
RUNTIME: z
Expand All @@ -16,10 +17,9 @@ export const mondaycodercSchema = z
.refine(data => {
if (data.RUNTIME_VERSION) {
if (data.RUNTIME === 'Python') {
// See status of python versions https://devguide.python.org/versions/
if (!/^3\.(10|11|12|13)\.\d+$/.test(data.RUNTIME_VERSION || '')) {
if (!/^3\.(10|11|12)\.\d+$/.test(data.RUNTIME_VERSION || '')) {
throw new Error(
'Invalid RUNTIME_VERSION for Python in .mondaycoderc. Allowed versions are 3.10.x, 3.11.x, 3.12.x, 3.13.x',
'Invalid RUNTIME_VERSION for Python in .mondaycoderc. Allowed versions are 3.10.x, 3.11.x, 3.12.x',
);
}

Expand All @@ -36,7 +36,6 @@ export const mondaycodercSchema = z
}

if (data.RUNTIME === 'Go') {
// See here https://go.dev/doc/devel/release
if (!/^1\.\d+\.\d+$/.test(data.RUNTIME_VERSION || '')) {
throw new Error('Invalid RUNTIME_VERSION for Go in .mondaycoderc. Allowed versions are 1.x.x');
}
Expand All @@ -45,7 +44,6 @@ export const mondaycodercSchema = z
}

if (data.RUNTIME === 'PHP') {
// See here https://www.php.net/supported-versions.php
if (!/^8\.([1-3])\.\d+$/.test(data.RUNTIME_VERSION || '')) {
throw new Error('Invalid RUNTIME_VERSION for PHP in .mondaycoderc. Allowed versions are 8.1.x, 8.2.x, 8.3.x');
}
Expand All @@ -54,10 +52,9 @@ export const mondaycodercSchema = z
}

if (data.RUNTIME === 'Ruby') {
// See here https://www.ruby-lang.org/en/downloads/releases/
if (!/^3\.([0-3])\.\d+$/.test(data.RUNTIME_VERSION || '')) {
if (!/^3\.([1-3])\.\d+$/.test(data.RUNTIME_VERSION || '')) {
throw new Error(
'Invalid RUNTIME_VERSION for Ruby in .mondaycoderc. Allowed versions are 3.0.x, 3.1.x, 3.2.x and 3.3.x',
'Invalid RUNTIME_VERSION for Ruby in .mondaycoderc. Allowed versions are 3.1.x, 3.2.x and 3.3.x',
);
}

Expand Down

0 comments on commit eaae6bc

Please sign in to comment.