You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above throws the following syntax error when trying to use --preview or running the job itself
➜ ~ rm -rf <project_dir>/.gitlab-ci-local && gitlab-ci-local --cwd <project_dir> --preview
Using fallback git commit data
Unable to retrieve default remote branch, falling back to `main`.
Using fallback git remote data
SyntaxError: Unexpected token ')'
at Function.evaluateRuleIf (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/utils.ts:221:29)
at Function.getRulesResult (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/utils.ts:185:24)
at new Job (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/job.ts:216:38)
at /home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/parser.ts:176:29
at Function.forEachRealJob (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/utils.ts:54:13)
at Parser.init (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/parser.ts:162:15)
at Function.create (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/parser.ts:60:9)
at handler (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/handler.ts:45:18)
at Object.handler (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/index.ts:37:21)
➜ ~ rm -rf <project_dir>/.gitlab-ci-local && gitlab-ci-local --cwd <project_dir> test-job
Using fallback git commit data
Unable to retrieve default remote branch, falling back to `main`.
Using fallback git remote data
SyntaxError: Unexpected token ')'
at Function.evaluateRuleIf (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/utils.ts:221:29)
at Function.getRulesResult (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/utils.ts:185:24)
at new Job (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/job.ts:216:38)
at /home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/parser.ts:176:29
at Function.forEachRealJob (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/utils.ts:54:13)
at Parser.init (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/parser.ts:162:15)
at Function.create (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/parser.ts:60:9)
at handler (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/handler.ts:78:18)
at Object.handler (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/index.ts:37:21)
➜ ~ docker version
Client: Docker Engine - Community
Version: 27.2.1
API version: 1.47
Go version: go1.22.7
Git commit: 9e34c9b
Built: Fri Sep 6 12:08:15 2024
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 27.2.1
API version: 1.47 (minimum version 1.24)
Go version: go1.22.7
Git commit: 8b539b8
Built: Fri Sep 6 12:08:15 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.21
GitCommit: 472731909fa34bd7bc9c087e4c27943f9835f111
nvidia:
Version: 1.1.13
GitCommit: v1.1.13-0-g58aa920
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Additional context
Changing REGEX_VAR: "/test\//" to REGEX_VAR: '/test\//' seems to get around the issue although it seems strange that the backslash would not be interpreted literally in that case, also works with REGEX_VAR: "/test\/" but I believe that's not the same thing?
Using REGEX_VAR: '/test\/', on the other hand, throws a different syntax error
➜ ~ rm -rf <project_dir>/.gitlab-ci-local && gitlab-ci-local --cwd <project_dir> test-job
Using fallback git commit data
Unable to retrieve default remote branch, falling back to `main`.
Using fallback git remote data
SyntaxError: Invalid regular expression: missing /
at Function.evaluateRuleIf (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/utils.ts:221:29)
at Function.getRulesResult (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/utils.ts:185:24)
at new Job (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/job.ts:216:38)
at /home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/parser.ts:176:29
at Function.forEachRealJob (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/utils.ts:54:13)
at Parser.init (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/parser.ts:162:15)
at Function.create (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/parser.ts:60:9)
at handler (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/handler.ts:45:18)
at Object.handler (/home/linuxbrew/.linuxbrew/Cellar/gitlab-ci-local/4.53.0/libexec/lib/node_modules/gitlab-ci-local/src/index.ts:37:21)
I don't know if the above is specific to gitlab's kubernetes executor but if it is, feel free to close this issue and link it to #1064
The text was updated successfully, but these errors were encountered:
For now, change to either of the following should work similar in gitlab.com and gcl:
variables:
REGEX_VAR: /test\//REGEX_VAR: '/test\//'# NOTE: we are using double the backslash `\\`! this is due to how the yaml parsers parses double quoted string and the edge case that's not handled on our sideREGEX_VAR: "/test\\//"
Minimal .gitlab-ci.yml illustrating the issue
The above throws the following syntax error when trying to use
--preview
or running the job itselfExpected behavior
Host information
Containerd binary
Additional context
Changing
REGEX_VAR: "/test\//"
toREGEX_VAR: '/test\//'
seems to get around the issue although it seems strange that the backslash would not be interpreted literally in that case, also works withREGEX_VAR: "/test\/"
but I believe that's not the same thing?Using
REGEX_VAR: '/test\/'
, on the other hand, throws a different syntax errorI don't know if the above is specific to gitlab's kubernetes executor but if it is, feel free to close this issue and link it to #1064
The text was updated successfully, but these errors were encountered: