From f4696196f4eaa1ce1ce90c0ba886b3f40361cb9c Mon Sep 17 00:00:00 2001 From: Parker Rowe Date: Wed, 15 Oct 2025 16:37:08 -0400 Subject: [PATCH 01/13] move descriptions from publicschema.json to schema.json --- schema.json | 309 +++++++++++++++++++++++++++++----------------------- 1 file changed, 175 insertions(+), 134 deletions(-) diff --git a/schema.json b/schema.json index 7fced709..7ddc2065 100644 --- a/schema.json +++ b/schema.json @@ -6,11 +6,11 @@ "oneOf": [ { "type": "string", - "description": "Job may be a string reference to another job" + "markdownDescription": "A reference to a job defined elsewhere in the configuration, either in the `jobs` section or from an orb (e.g., `my-job` or `orb-name/job-name`)." }, { "type": "object", - "description": "Job definition object", + "markdownDescription": "https://circleci.com/docs/creating-orbs#creating-inline-orbs\n\nInline orbs can be handy during development of an orb or as a convenience for name-spacing jobs and commands in lengthy configurations, particularly if you later intend to share the orb with others.", "properties": { "type": { "enum": [ @@ -21,7 +21,7 @@ "approval", "no-op" ], - "description": "The job type. If not specified, defaults to build." + "markdownDescription": "The job type. If not specified, defaults to build." } }, "if": { @@ -35,14 +35,14 @@ } }, "then": { - "description": "Release job.", + "markdownDescription": "https://circleci.com/docs/reference/configuration-reference/#job-type\n\nRelease job.", "required": [ "plan_name" ], "properties": { "plan_name": { "type": "string", - "description": "Required plan name for release jobs." + "markdownDescription": "Required plan name for release jobs." } }, "additionalProperties": true @@ -62,14 +62,14 @@ } }, "then": { - "description": "A lock/unlock job", + "markdownDescription": "https://circleci.com/docs/reference/configuration-reference/#job-type\n\nA lock/unlock job", "required": [ "key" ], "properties": { "key": { "type": "string", - "description": "Required key for lock/unlock jobs." + "markdownDescription": "Required key for lock/unlock jobs." } }, "additionalProperties": true @@ -89,12 +89,12 @@ } }, "then": { - "description": "Approval/no-op jobs primarily act as workflow markers. Other keys like `steps:` are permitted but will be ignored in the final pipeline.", + "markdownDescription": "https://circleci.com/docs/reference/configuration-reference/#job-type\n\nApproval/no-op jobs primarily act as workflow markers. Other keys like `steps:` are permitted but will be ignored in the final pipeline.", "additionalProperties": true }, "else": { "if": { - "description": "Condition: The job must be of type 'build' or have no type specified.", + "markdownDescription": "https://circleci.com/docs/reference/configuration-reference/#job-type\n\nA build job. The job explicitly has type 'build' or defaults to build when no type specified.", "anyOf": [ { "not": { @@ -116,17 +116,17 @@ ] }, "then": { - "description": "Validation: The job must adhere to the structure of a build job.", + "markdownDescription": "Validation: The job must adhere to the structure of a build job.", "properties": { "description": { "type": "string" }, "type": { "const": "build", - "description": "The job type. If not specified, defaults to build." + "markdownDescription": "The job type. If not specified, defaults to build." }, "parallelism": { - "description": "A integer or a parameter evaluating to a integer", + "markdownDescription": "A integer or a parameter evaluating to a integer", "anyOf": [ { "oneOf": [ @@ -213,14 +213,14 @@ "environment": { "oneOf": [ { - "description": "Allow null to account for empty `environment:` declarations.", + "markdownDescription": "A map of environment variable names and values.", "type": [ "string", "null" ] }, { - "description": "An array of strings in the form KEY=VALUE", + "markdownDescription": "An array of strings in the form KEY=VALUE", "type": "array", "items": { "$ref": "#/definitions/environment" @@ -228,7 +228,7 @@ }, { "type": "object", - "description": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", + "markdownDescription": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", "additionalProperties": { "type": [ "string", @@ -303,7 +303,8 @@ "minItems": 1 }, "working_directory": { - "type": "string" + "type": "string", + "markdownDescription": "In which directory to run the steps. (default: `~/project`. `project` is a literal string, not the name of the project.) You can also refer the directory with `$CIRCLE_WORKING_DIRECTORY` environment variable." }, "retention": { "type": "object", @@ -316,13 +317,13 @@ "additionalProperties": false }, "circleci_ip_ranges": { - "type": "boolean" + "type": "boolean", + "markdownDescription": "Enable running jobs with a set of well-defined IP address ranges." }, "machine": { - "description": "Machine must be a boolean or a map", + "markdownDescription": "Use the default machine executor image", "oneOf": [ { - "description": "A boolean or a template parameter evaluating to a boolean", "anyOf": [ { "type": "string", @@ -343,7 +344,7 @@ "type": "object", "properties": { "enabled": { - "description": "A boolean or a template parameter evaluating to a boolean", + "markdownDescription": "A boolean or a template parameter evaluating to a boolean", "anyOf": [ { "type": "string", @@ -364,7 +365,7 @@ "type": "string" }, "docker_layer_caching": { - "description": "A boolean or a template parameter evaluating to a boolean", + "markdownDescription": "Set to `true` to enable [Docker Layer Caching](https://circleci.com/docs/docker-layer-caching). Note: If you haven't already, you must open a support ticket to have a CircleCI Sales representative contact you about enabling this feature on your account for an additional fee.", "anyOf": [ { "type": "string", @@ -395,14 +396,14 @@ "environment": { "oneOf": [ { - "description": "Allow null to account for empty `environment:` declarations.", + "markdownDescription": "A map of environment variable names and values.", "type": [ "string", "null" ] }, { - "description": "An array of strings in the form KEY=VALUE", + "markdownDescription": "An array of strings in the form KEY=VALUE", "type": "array", "items": { "$ref": "#/definitions/environment" @@ -410,7 +411,7 @@ }, { "type": "object", - "description": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", + "markdownDescription": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", "additionalProperties": { "type": [ "string", @@ -426,11 +427,11 @@ "oneOf": [ { "type": "string", - "description": "short executor invocation, name of executor" + "markdownDescription": "https://circleci.com/docs/reference/reusing-config/#executor\n\nThe name of the executor to use (defined via the top level executors map or from an orb)." }, { "type": "object", - "description": "executor invocation with arguments, i.e. parameters", + "markdownDescription": "Executor stanza to use for the job, with optional parameter overrides.", "minProperties": 1, "additionalProperties": true, "properties": { @@ -458,7 +459,7 @@ ] }, "parameters": { - "description": "Parameters given to a job.", + "markdownDescription": "https://circleci.com/docs/reusing-config#using-the-parameters-declaration\n\nA map of parameter keys.", "type": "object", "additionalProperties": { "type": "object", @@ -518,7 +519,7 @@ "additionalProperties": false, "anyOf": [ { - "description": "A job must have one of `docker`, `machine`, `macos` or `executor` (which can provide docker/machine/macos information).", + "markdownDescription": "A job that uses an executor defined elsewhere in the configuration.", "type": "object", "required": [ "executor" @@ -564,7 +565,7 @@ "type": "object", "properties": { "jobs": { - "description": "Any string key is allowed as job name.", + "markdownDescription": "Jobs are collections of steps. All of the steps in the job are executed in a single unit, either within a fresh container or VM.", "type": "object", "propertyNames": { "type": "string", @@ -588,7 +589,7 @@ "type": "string" }, "parameters": { - "description": "Parameters given to a step.", + "markdownDescription": "https://circleci.com/docs/reusing-config#using-the-parameters-declaration\n\nA map of parameter keys.", "type": "object", "additionalProperties": { "type": "object", @@ -656,7 +657,7 @@ }, { "type": "string", - "description": "Command may be a string reference to another command" + "markdownDescription": "Command may be a string reference to another command" } ] } @@ -742,14 +743,14 @@ "environment": { "oneOf": [ { - "description": "Allow null to account for empty `environment:` declarations.", + "markdownDescription": "A map of environment variable names and values.", "type": [ "string", "null" ] }, { - "description": "An array of strings in the form KEY=VALUE", + "markdownDescription": "An array of strings in the form KEY=VALUE", "type": "array", "items": { "$ref": "#/definitions/environment" @@ -757,7 +758,7 @@ }, { "type": "object", - "description": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", + "markdownDescription": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", "additionalProperties": { "type": [ "string", @@ -828,10 +829,10 @@ "type": "string" }, "machine": { - "description": "Machine must be a boolean or a map", + "markdownDescription": "Use the default machine executor image", "oneOf": [ { - "description": "A boolean or a template parameter evaluating to a boolean", + "markdownDescription": "Specify an image tag.\n\nUsing CircleCI Cloud? Use of `machine: true` is deprecated. You must specify an image to use.", "anyOf": [ { "type": "string", @@ -852,7 +853,7 @@ "type": "object", "properties": { "enabled": { - "description": "A boolean or a template parameter evaluating to a boolean", + "markdownDescription": "A boolean or a template parameter evaluating to a boolean", "anyOf": [ { "type": "string", @@ -873,7 +874,7 @@ "type": "string" }, "docker_layer_caching": { - "description": "A boolean or a template parameter evaluating to a boolean", + "markdownDescription": "Set to `true` to enable [Docker Layer Caching](https://circleci.com/docs/docker-layer-caching). Note: If you haven't already, you must open a support ticket to have a CircleCI Sales representative contact you about enabling this feature on your account for an additional fee.", "anyOf": [ { "type": "string", @@ -904,14 +905,14 @@ "environment": { "oneOf": [ { - "description": "Allow null to account for empty `environment:` declarations.", + "markdownDescription": "A map of environment variable names and values.", "type": [ "string", "null" ] }, { - "description": "An array of strings in the form KEY=VALUE", + "markdownDescription": "An array of strings in the form KEY=VALUE", "type": "array", "items": { "$ref": "#/definitions/environment" @@ -919,7 +920,7 @@ }, { "type": "object", - "description": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", + "markdownDescription": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", "additionalProperties": { "type": [ "string", @@ -945,7 +946,7 @@ ] }, "parameters": { - "description": "Parameters given to a job.", + "markdownDescription": "https://circleci.com/docs/reusing-config#using-the-parameters-declaration\n\nA map of parameter keys.", "type": "object", "additionalProperties": { "type": "object", @@ -1003,7 +1004,7 @@ }, { "type": "string", - "description": "Executor may be a string reference to another executor" + "markdownDescription": "Executor may be a string reference to another executor" } ] } @@ -1018,14 +1019,14 @@ "environment": { "oneOf": [ { - "description": "Allow null to account for empty `environment:` declarations.", + "markdownDescription": "A map of environment variable names and values.", "type": [ "string", "null" ] }, { - "description": "An array of strings in the form KEY=VALUE", + "markdownDescription": "An array of strings in the form KEY=VALUE", "type": "array", "items": { "$ref": "#/definitions/environment" @@ -1033,7 +1034,7 @@ }, { "type": "object", - "description": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", + "markdownDescription": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", "additionalProperties": { "type": [ "string", @@ -1048,7 +1049,7 @@ "logic": { "oneOf": [ { - "description": "A boolean or a pipeline parameter evaluating to a boolean", + "markdownDescription": "https://circleci.com/docs/configuration-reference#logic-statements\n\nA value or parameter reference to be used in a logical statement.", "anyOf": [ { "type": "string", @@ -1067,7 +1068,7 @@ }, { "type": "object", - "description": "This is the object that represents the logical/comparison operators", + "markdownDescription": "https://circleci.com/docs/configuration-reference#logic-statements\n\nA logical operator (and, or, not, equal, matches) to be used in dynamic configuration.", "minProperties": 1, "maxProperties": 1, "additionalProperties": false, @@ -1116,7 +1117,7 @@ }, { "type": "object", - "description": "This is the object operand", + "markdownDescription": "A custom logic object with user-defined properties for conditional evaluation.", "propertyNames": { "not": { "pattern": "^(and|or|not|equal|matches)$" @@ -1129,11 +1130,11 @@ "oneOf": [ { "type": "string", - "description": "Shorthand commands, like `checkout`" + "markdownDescription": "A reference to a command or built-in step (e.g., `checkout`, `my-command`, or `orb-name/command-name`)." }, { "type": "object", - "description": "long form commands like `run:`", + "markdownDescription": "long form commands like `run:` or `checkout:", "propertyNames": { "pattern": "^[a-z][a-z\\d\/_-]*$", "not": { @@ -1171,7 +1172,7 @@ }, { "type": "object", - "description": "`when`/`unless` step", + "markdownDescription": "https://circleci.com/docs/configuration-reference#the-when-step-requires-version-21\n\nA conditional step (`when` or `unless`) that runs based on a logical condition.", "additionalProperties": false, "minProperties": 1, "maxProperties": 1, @@ -1238,6 +1239,7 @@ "object", "null" ], + "markdownDescription": "Executors define the environment in which the steps of a job will be run, allowing you to reuse a single executor definition across multiple jobs.", "propertyNames": { "pattern": "^[a-z][a-z\\d_-]*$" }, @@ -1251,12 +1253,14 @@ }, "macos": { "type": "object", + "markdownDescription": "Options for the [macOS executor](https://circleci.com/docs/configuration-reference#macos)", "properties": { "xcode": { "type": [ "string", "number" - ] + ], + "markdownDescription": "The version of Xcode that is installed on the virtual machine, see the [Supported Xcode Versions section of the Testing iOS](https://circleci.com/docs/testing-ios#supported-xcode-versions) document for the complete list." }, "resource_class": { "type": "string" @@ -1271,19 +1275,23 @@ "additionalProperties": false }, "resource_class": { - "type": "string" + "type": "string", + "markdownDescription": "Amount of CPU and RAM allocated to each container in a job. Note: A performance plan is required to access this feature." }, "docker": { "type": "array", "minItems": 1, + "markdownDescription": "Options for the [docker executor](https://circleci.com/docs/configuration-reference#docker)", "items": { "type": "object", "properties": { "image": { - "type": "string" + "type": "string", + "markdownDescription": "The name of a custom docker image to use" }, "name": { - "type": "string" + "type": "string", + "markdownDescription": "The name the container is reachable by. By default, container services are accessible through `localhost`" }, "entrypoint": { "oneOf": [ @@ -1296,7 +1304,8 @@ "type": "string" } } - ] + ], + "markdownDescription": "The command used as executable when launching the container" }, "command": { "oneOf": [ @@ -1309,22 +1318,24 @@ "type": "string" } } - ] + ], + "markdownDescription": "The command used as pid 1 (or args for entrypoint) when launching the container" }, "user": { - "type": "string" + "type": "string", + "markdownDescription": "Which user to run the command as" }, "environment": { "oneOf": [ { - "description": "Allow null to account for empty `environment:` declarations.", + "markdownDescription": "A map of environment variable names and values.", "type": [ "string", "null" ] }, { - "description": "An array of strings in the form KEY=VALUE", + "markdownDescription": "An array of strings in the form KEY=VALUE", "type": "array", "items": { "$ref": "#/definitions/environment" @@ -1332,7 +1343,7 @@ }, { "type": "object", - "description": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", + "markdownDescription": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", "additionalProperties": { "type": [ "string", @@ -1374,7 +1385,8 @@ ], "additionalProperties": false } - ] + ], + "markdownDescription": "Authentication for AWS EC2 Container Registry (ECR). You can use the access/secret keys or OIDC." }, "auth": { "type": "object", @@ -1390,7 +1402,8 @@ "username", "password" ], - "additionalProperties": false + "additionalProperties": false, + "markdownDescription": "Authentication for registries using standard `docker login` credentials" } }, "required": [ @@ -1400,13 +1413,14 @@ } }, "working_directory": { - "type": "string" + "type": "string", + "markdownDescription": "In which directory to run the steps." }, "machine": { - "description": "Machine must be a boolean or a map", + "markdownDescription": "Use the default machine executor image", "oneOf": [ { - "description": "A boolean or a template parameter evaluating to a boolean", + "markdownDescription": "Specify an image tag.\n\nUsing CircleCI Cloud? Use of `machine: true` is deprecated. You must specify an image to use.", "anyOf": [ { "type": "string", @@ -1427,7 +1441,7 @@ "type": "object", "properties": { "enabled": { - "description": "A boolean or a template parameter evaluating to a boolean", + "markdownDescription": "A boolean or a template parameter evaluating to a boolean", "anyOf": [ { "type": "string", @@ -1445,10 +1459,11 @@ ] }, "image": { - "type": "string" + "type": "string", + "markdownDescription": "The VM image to use. View [available images](https://circleci.com/docs/configuration-reference#available-machine-images). **Note:** This key is **not** supported on the installable CircleCI. For information about customizing machine executor images on CircleCI installed on your servers, see our [VM provisioner documentation](https://circleci.com/docs/server-admin/latest/operator/manage-virtual-machines-with-machine-provisioner/)." }, "docker_layer_caching": { - "description": "A boolean or a template parameter evaluating to a boolean", + "markdownDescription": "Set to `true` to enable [Docker Layer Caching](https://circleci.com/docs/docker-layer-caching). Note: If you haven't already, you must open a support ticket to have a CircleCI Sales representative contact you about enabling this feature on your account for an additional fee.", "anyOf": [ { "type": "string", @@ -1479,14 +1494,14 @@ "environment": { "oneOf": [ { - "description": "Allow null to account for empty `environment:` declarations.", + "markdownDescription": "A map of environment variable names and values.", "type": [ "string", "null" ] }, { - "description": "An array of strings in the form KEY=VALUE", + "markdownDescription": "An array of strings in the form KEY=VALUE", "type": "array", "items": { "$ref": "#/definitions/environment" @@ -1494,7 +1509,7 @@ }, { "type": "object", - "description": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", + "markdownDescription": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", "additionalProperties": { "type": [ "string", @@ -1517,10 +1532,11 @@ "type": "string" } } - ] + ], + "markdownDescription": "Shell to use for execution command in all steps. Can be overridden by shell in each step (default: See [Default Shell Options](https://circleci.com/docs/configuration-reference#default-shell-options)" }, "parameters": { - "description": "Parameters given to a job.", + "markdownDescription": "https://circleci.com/docs/reusing-config#using-the-parameters-declaration\n\nA map of parameter keys.", "type": "object", "additionalProperties": { "type": "object", @@ -1578,7 +1594,7 @@ }, { "type": "string", - "description": "Executor may be a string reference to another executor" + "markdownDescription": "Executor may be a string reference to another executor" } ] } @@ -1640,7 +1656,8 @@ "type": [ "number", "string" - ] + ], + "markdownDescription": "The Workflows `version` field is used to issue warnings for deprecation or breaking changes during v2 Beta. It is deprecated as of CircleCI v2.1" } }, "propertyNames": { @@ -1658,7 +1675,8 @@ "type": "object", "properties": { "cron": { - "type": "string" + "type": "string", + "markdownDescription": "See the [crontab man page](http://pubs.opengroup.org/onlinepubs/7908799/xcu/crontab.html)" }, "filters": { "type": "object", @@ -1677,7 +1695,8 @@ "type": "string" } } - ] + ], + "markdownDescription": "Either a single branch specifier, or a list of branch specifiers" }, "ignore": { "oneOf": [ @@ -1690,30 +1709,38 @@ "type": "string" } } - ] + ], + "markdownDescription": "Either a single branch specifier, or a list of branch specifiers" } }, - "additionalProperties": false + "additionalProperties": false, + "markdownDescription": "A map defining rules for execution on specific branches" } }, - "additionalProperties": false + "additionalProperties": false, + "markdownDescription": "A map defining rules for execution on specific branches" } - } + }, + "markdownDescription": "A workflow may have a schedule indicating it runs at a certain time, for example a nightly build that runs every day at 12am UTC:" } }, "additionalProperties": false - } + }, + "markdownDescription": "Specifies which triggers will cause this workflow to be executed. Default behavior is to trigger the workflow when pushing to a branch." }, "max_auto_reruns": { "type": "integer", "minimum": 1, - "maximum": 5 + "maximum": 5, + "markdownDescription": "The maximum number of times a workflow will be automatically rerun if it fails" }, "when": { - "$ref": "#/definitions/logic" + "$ref": "#/definitions/logic", + "markdownDescription": "https://circleci.com/docs/configuration-reference#the-when-step-requires-version-21\n\nConditional step to run on custom conditions (determined at config-compile time) that are checked before a workflow runs" }, "unless": { - "$ref": "#/definitions/logic" + "$ref": "#/definitions/logic", + "markdownDescription": "https://circleci.com/docs/configuration-reference#the-when-step-requires-version-21\n\nConditional step to run when custom conditions aren't met (determined at config-compile time) that are checked before a workflow runs" }, "jobs": { "type": "array", @@ -1732,6 +1759,7 @@ "properties": { "requires": { "type": "array", + "markdownDescription": "Jobs are run in parallel by default, so you must explicitly require any dependencies by their job name.", "items": { "oneOf": [ { @@ -1773,7 +1801,7 @@ }, "filters": { "type": "object", - "description": "This is similar to to other `filters` in config, but has an additional key, `tags`", + "markdownDescription": "This is similar to to other `filters` in config, but has an additional key, `tags`", "properties": { "branches": { "type": "object", @@ -1821,7 +1849,8 @@ "type": "string" } } - ] + ], + "markdownDescription": "Either a single branch specifier, or a list of branch specifiers" }, "ignore": { "oneOf": [ @@ -1834,10 +1863,12 @@ "type": "string" } } - ] + ], + "markdownDescription": "Either a single branch specifier, or a list of branch specifiers" } }, - "additionalProperties": false + "additionalProperties": false, + "markdownDescription": "A map defining rules for execution on specific branches" } }, "additionalProperties": false @@ -1853,7 +1884,8 @@ "type": "string" } } - ] + ], + "markdownDescription": "Either a single context name, or a list of contexts. The default name is `org-global`" }, "type": { "type": "string" @@ -1883,18 +1915,22 @@ ], "properties": { "parameters": { - "type": "object" + "type": "object", + "markdownDescription": "A map of parameter names to every value the job should be called with" }, "exclude": { "type": "array", "items": { "type": "object" - } + }, + "markdownDescription": "A list of argument maps that should be excluded from the matrix" }, "alias": { - "type": "string" + "type": "string", + "markdownDescription": "An alias for the matrix, usable from another job's requires stanza. Defaults to the name of the job being executed" } - } + }, + "markdownDescription": "https://circleci.com/docs/configuration-reference#matrix-requires-version-21\n\nThe matrix stanza allows you to run a parameterized job multiple times with different arguments." }, "serial-group": { "type": "string", @@ -1914,7 +1950,7 @@ "jobs" ], "not": { - "description": "cannot use both 'when' and 'unless'", + "markdownDescription": "https://circleci.com/docs/configuration-reference#logic-statements \n\nLogical not: true when statement is false", "allOf": [ { "required": [ @@ -1928,10 +1964,11 @@ } ] } - } + }, + "markdownDescription": "Used for orchestrating all jobs. Each workflow consists of the workflow name as a key and a map as a value" }, "jobs": { - "description": "Any string key is allowed as job name.", + "markdownDescription": "Jobs are collections of steps. All of the steps in the job are executed in a single unit, either within a fresh container or VM.", "type": "object", "propertyNames": { "type": "string", @@ -1946,6 +1983,7 @@ "object", "null" ], + "markdownDescription": "https://circleci.com/docs/configuration-reference#orbs-requires-version-21\n\nOrbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects.", "additionalProperties": { "oneOf": [ { @@ -1955,7 +1993,7 @@ "type": "object", "properties": { "jobs": { - "description": "Any string key is allowed as job name.", + "markdownDescription": "Jobs are collections of steps. All of the steps in the job are executed in a single unit, either within a fresh container or VM.", "type": "object", "propertyNames": { "type": "string", @@ -1971,7 +2009,7 @@ "type": "string" }, "parallelism": { - "description": "A integer or a parameter evaluating to a integer", + "markdownDescription": "Number of parallel instances of this job to run (default: 1)", "anyOf": [ { "oneOf": [ @@ -2058,14 +2096,14 @@ "environment": { "oneOf": [ { - "description": "Allow null to account for empty `environment:` declarations.", + "markdownDescription": "A map of environment variable names and values.", "type": [ "string", "null" ] }, { - "description": "An array of strings in the form KEY=VALUE", + "markdownDescription": "An array of strings in the form KEY=VALUE", "type": "array", "items": { "$ref": "#/definitions/environment" @@ -2073,7 +2111,7 @@ }, { "type": "object", - "description": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", + "markdownDescription": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", "additionalProperties": { "type": [ "string", @@ -2154,10 +2192,10 @@ "type": "boolean" }, "machine": { - "description": "Machine must be a boolean or a map", + "markdownDescription": "Use the default machine executor image", "oneOf": [ { - "description": "A boolean or a template parameter evaluating to a boolean", + "markdownDescription": "Specify an image tag.\n\nUsing CircleCI Cloud? Use of `machine: true` is deprecated. You must specify an image to use.", "anyOf": [ { "type": "string", @@ -2178,7 +2216,7 @@ "type": "object", "properties": { "enabled": { - "description": "A boolean or a template parameter evaluating to a boolean", + "markdownDescription": "A boolean or a template parameter evaluating to a boolean", "anyOf": [ { "type": "string", @@ -2199,7 +2237,7 @@ "type": "string" }, "docker_layer_caching": { - "description": "A boolean or a template parameter evaluating to a boolean", + "markdownDescription": "Set to `true` to enable [Docker Layer Caching](https://circleci.com/docs/docker-layer-caching). Note: If you haven't already, you must open a support ticket to have a CircleCI Sales representative contact you about enabling this feature on your account for an additional fee.", "anyOf": [ { "type": "string", @@ -2230,14 +2268,14 @@ "environment": { "oneOf": [ { - "description": "Allow null to account for empty `environment:` declarations.", + "markdownDescription": "A map of environment variable names and values.", "type": [ "string", "null" ] }, { - "description": "An array of strings in the form KEY=VALUE", + "markdownDescription": "An array of strings in the form KEY=VALUE", "type": "array", "items": { "$ref": "#/definitions/environment" @@ -2245,7 +2283,7 @@ }, { "type": "object", - "description": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", + "markdownDescription": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", "additionalProperties": { "type": [ "string", @@ -2261,11 +2299,11 @@ "oneOf": [ { "type": "string", - "description": "short executor invocation, name of executor" + "markdownDescription": "https://circleci.com/docs/reference/reusing-config/#executor\n\nThe name of the executor to use (defined via the top level executors map or from an orb)." }, { "type": "object", - "description": "executor invocation with arguments, i.e. parameters", + "markdownDescription": "Executor stanza to use for the job, with optional parameter overrides.", "minProperties": 1, "additionalProperties": true, "properties": { @@ -2293,7 +2331,7 @@ ] }, "parameters": { - "description": "Parameters given to a job.", + "markdownDescription": "https://circleci.com/docs/reusing-config#using-the-parameters-declaration\n\nA map of parameter keys.", "type": "object", "additionalProperties": { "type": "object", @@ -2353,7 +2391,7 @@ "additionalProperties": false, "anyOf": [ { - "description": "A job must have one of `docker`, `machine`, `macos` or `executor` (which can provide docker/machine/macos information).", + "markdownDescription": "A job that uses an executor defined elsewhere in the configuration.", "type": "object", "required": [ "executor" @@ -2385,7 +2423,7 @@ }, { "type": "string", - "description": "Job may be a string reference to another job" + "markdownDescription": "Job may be a string reference to another job" } ] } @@ -2404,7 +2442,7 @@ "type": "string" }, "parameters": { - "description": "Parameters given to a step.", + "markdownDescription": "https://circleci.com/docs/reusing-config#using-the-parameters-declaration\n\nA map of parameter keys.", "type": "object", "additionalProperties": { "type": "object", @@ -2472,7 +2510,7 @@ }, { "type": "string", - "description": "Command may be a string reference to another command" + "markdownDescription": "Command may be a string reference to another command" } ] } @@ -2558,14 +2596,14 @@ "environment": { "oneOf": [ { - "description": "Allow null to account for empty `environment:` declarations.", + "markdownDescription": "A map of environment variable names and values.", "type": [ "string", "null" ] }, { - "description": "An array of strings in the form KEY=VALUE", + "markdownDescription": "An array of strings in the form KEY=VALUE", "type": "array", "items": { "$ref": "#/definitions/environment" @@ -2573,7 +2611,7 @@ }, { "type": "object", - "description": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", + "markdownDescription": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", "additionalProperties": { "type": [ "string", @@ -2644,10 +2682,10 @@ "type": "string" }, "machine": { - "description": "Machine must be a boolean or a map", + "markdownDescription": "Use the default machine executor image", "oneOf": [ { - "description": "A boolean or a template parameter evaluating to a boolean", + "markdownDescription": "Specify an image tag.\n\nUsing CircleCI Cloud? Use of `machine: true` is deprecated. You must specify an image to use.", "anyOf": [ { "type": "string", @@ -2668,7 +2706,7 @@ "type": "object", "properties": { "enabled": { - "description": "A boolean or a template parameter evaluating to a boolean", + "markdownDescription": "A boolean or a template parameter evaluating to a boolean", "anyOf": [ { "type": "string", @@ -2689,7 +2727,7 @@ "type": "string" }, "docker_layer_caching": { - "description": "A boolean or a template parameter evaluating to a boolean", + "markdownDescription": "Set to `true` to enable [Docker Layer Caching](https://circleci.com/docs/docker-layer-caching). Note: If you haven't already, you must open a support ticket to have a CircleCI Sales representative contact you about enabling this feature on your account for an additional fee.", "anyOf": [ { "type": "string", @@ -2720,14 +2758,14 @@ "environment": { "oneOf": [ { - "description": "Allow null to account for empty `environment:` declarations.", + "markdownDescription": "A map of environment variable names and values.", "type": [ "string", "null" ] }, { - "description": "An array of strings in the form KEY=VALUE", + "markdownDescription": "An array of strings in the form KEY=VALUE", "type": "array", "items": { "$ref": "#/definitions/environment" @@ -2735,7 +2773,7 @@ }, { "type": "object", - "description": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", + "markdownDescription": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", "additionalProperties": { "type": [ "string", @@ -2761,7 +2799,7 @@ ] }, "parameters": { - "description": "Parameters given to a job.", + "markdownDescription": "https://circleci.com/docs/reusing-config#using-the-parameters-declaration\n\nA map of parameter keys.", "type": "object", "additionalProperties": { "type": "object", @@ -2819,7 +2857,7 @@ }, { "type": "string", - "description": "Executor may be a string reference to another executor" + "markdownDescription": "Executor may be a string reference to another executor" } ] } @@ -2837,6 +2875,7 @@ "object", "null" ], + "markdownDescription": "https://circleci.com/docs/configuration-reference#commands-requires-version-21\n\nA command definition defines a sequence of steps as a map to be executed in a job, enabling you to reuse a single command definition across multiple jobs.", "propertyNames": { "pattern": "^[a-z][a-z\\d_-]*$" }, @@ -2849,7 +2888,7 @@ "type": "string" }, "parameters": { - "description": "Parameters given to a step.", + "markdownDescription": "https://circleci.com/docs/reusing-config#using-the-parameters-declaration\n\nA map of parameter keys.", "type": "object", "additionalProperties": { "type": "object", @@ -2907,7 +2946,8 @@ "items": { "$ref": "#/definitions/step" }, - "minItems": 1 + "minItems": 1, + "markdownDescription": "A sequence of steps run inside the calling job of the command." } }, "required": [ @@ -2917,7 +2957,7 @@ }, { "type": "string", - "description": "Command may be a string reference to another command" + "markdownDescription": "https://circleci.com/docs/creating-orbs#creating-inline-orbs\n\nInline orbs can be handy during development of an orb or as a convenience for name-spacing jobs and commands in lengthy configurations, particularly if you later intend to share the orb with others." } ] } @@ -2961,7 +3001,8 @@ "enum": [ "2.1", 2.1 - ] + ], + "markdownDescription": "The version field is intended to be used in order to issue warnings for deprecation or breaking changes." }, "parameters": { "type": [ From 01fbd630db54fee54b4190409c87181d67aabf9f Mon Sep 17 00:00:00 2001 From: Parker Rowe Date: Wed, 15 Oct 2025 17:13:18 -0400 Subject: [PATCH 02/13] replace orbs: jobs: with a reference to jobDefinition --- schema.json | 427 +--------------------------------------------------- 1 file changed, 1 insertion(+), 426 deletions(-) diff --git a/schema.json b/schema.json index 7ddc2065..8f77d5e6 100644 --- a/schema.json +++ b/schema.json @@ -2000,432 +2000,7 @@ "pattern": "^[A-Za-z][A-Za-z\\s\\d_-]*$" }, "additionalProperties": { - "oneOf": [ - { - "title": "CircleCI Orb: Jobs", - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "parallelism": { - "markdownDescription": "Number of parallel instances of this job to run (default: 1)", - "anyOf": [ - { - "oneOf": [ - { - "type": "string", - "pattern": " *<< *parameters.([^ ]+) *>> *" - }, - { - "type": "string", - "pattern": " *<< *pipeline.parameters.([^ ]+) *>> *" - } - ] - }, - { - "type": "integer" - } - ] - }, - "macos": { - "type": "object", - "properties": { - "xcode": { - "type": [ - "string", - "number" - ] - }, - "resource_class": { - "type": "string" - }, - "shell": { - "type": "string" - } - }, - "required": [ - "xcode" - ], - "additionalProperties": false - }, - "resource_class": { - "type": "string" - }, - "docker": { - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "properties": { - "image": { - "type": "string" - }, - "name": { - "type": "string" - }, - "entrypoint": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "command": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "user": { - "type": "string" - }, - "environment": { - "oneOf": [ - { - "markdownDescription": "A map of environment variable names and values.", - "type": [ - "string", - "null" - ] - }, - { - "markdownDescription": "An array of strings in the form KEY=VALUE", - "type": "array", - "items": { - "$ref": "#/definitions/environment" - } - }, - { - "type": "object", - "markdownDescription": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", - "additionalProperties": { - "type": [ - "string", - "boolean", - "number", - "null" - ] - } - } - ] - }, - "aws_auth": { - "oneOf": [ - { - "type": "object", - "properties": { - "aws_access_key_id": { - "type": "string" - }, - "aws_secret_access_key": { - "type": "string" - } - }, - "required": [ - "aws_access_key_id", - "aws_secret_access_key" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "oidc_role_arn": { - "type": "string" - } - }, - "required": [ - "oidc_role_arn" - ], - "additionalProperties": false - } - ] - }, - "auth": { - "type": "object", - "properties": { - "username": { - "type": "string" - }, - "password": { - "type": "string" - } - }, - "required": [ - "username", - "password" - ], - "additionalProperties": false - } - }, - "required": [ - "image" - ], - "additionalProperties": false - } - }, - "steps": { - "type": "array", - "items": { - "$ref": "#/definitions/step" - }, - "minItems": 1 - }, - "working_directory": { - "type": "string" - }, - "circleci_ip_ranges": { - "type": "boolean" - }, - "machine": { - "markdownDescription": "Use the default machine executor image", - "oneOf": [ - { - "markdownDescription": "Specify an image tag.\n\nUsing CircleCI Cloud? Use of `machine: true` is deprecated. You must specify an image to use.", - "anyOf": [ - { - "type": "string", - "pattern": " *<< *parameters.([^ ]+) *>> *" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - } - ] - }, - { - "type": "object", - "properties": { - "enabled": { - "markdownDescription": "A boolean or a template parameter evaluating to a boolean", - "anyOf": [ - { - "type": "string", - "pattern": " *<< *parameters.([^ ]+) *>> *" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - } - ] - }, - "image": { - "type": "string" - }, - "docker_layer_caching": { - "markdownDescription": "Set to `true` to enable [Docker Layer Caching](https://circleci.com/docs/docker-layer-caching). Note: If you haven't already, you must open a support ticket to have a CircleCI Sales representative contact you about enabling this feature on your account for an additional fee.", - "anyOf": [ - { - "type": "string", - "pattern": " *<< *parameters.([^ ]+) *>> *" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - } - ] - }, - "resource_class": { - "type": "string" - }, - "shell": { - "type": "string" - } - }, - "additionalProperties": false - } - ] - }, - "environment": { - "oneOf": [ - { - "markdownDescription": "A map of environment variable names and values.", - "type": [ - "string", - "null" - ] - }, - { - "markdownDescription": "An array of strings in the form KEY=VALUE", - "type": "array", - "items": { - "$ref": "#/definitions/environment" - } - }, - { - "type": "object", - "markdownDescription": "The value should be a string, but we allow null, boolean and numbers too. Examples: `FOO: true` and `BAR: 2` `BAZ:`", - "additionalProperties": { - "type": [ - "string", - "boolean", - "number", - "null" - ] - } - } - ] - }, - "executor": { - "oneOf": [ - { - "type": "string", - "markdownDescription": "https://circleci.com/docs/reference/reusing-config/#executor\n\nThe name of the executor to use (defined via the top level executors map or from an orb)." - }, - { - "type": "object", - "markdownDescription": "Executor stanza to use for the job, with optional parameter overrides.", - "minProperties": 1, - "additionalProperties": true, - "properties": { - "name": { - "type": "string" - } - }, - "required": [ - "name" - ] - } - ] - }, - "shell": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "parameters": { - "markdownDescription": "https://circleci.com/docs/reusing-config#using-the-parameters-declaration\n\nA map of parameter keys.", - "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "boolean", - "string", - "steps", - "enum", - "executor", - "integer", - "env_var_name" - ] - }, - "default": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/step" - } - } - ] - }, - "description": { - "type": "string" - }, - "enum": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false, - "required": [ - "type" - ] - }, - "minProperties": 1 - } - }, - "required": [ - "steps" - ], - "additionalProperties": false, - "anyOf": [ - { - "markdownDescription": "A job that uses an executor defined elsewhere in the configuration.", - "type": "object", - "required": [ - "executor" - ] - }, - { - "oneOf": [ - { - "type": "object", - "required": [ - "machine" - ] - }, - { - "type": "object", - "required": [ - "docker" - ] - }, - { - "type": "object", - "required": [ - "macos" - ] - } - ] - } - ] - }, - { - "type": "string", - "markdownDescription": "Job may be a string reference to another job" - } - ] + "$ref": "#/definitions/jobDefinition" } }, "commands": { From cfeec4ea4105982fc0d1797ea461ac69c3c68d0f Mon Sep 17 00:00:00 2001 From: Parker Rowe Date: Wed, 15 Oct 2025 17:25:21 -0400 Subject: [PATCH 03/13] update launch.json to point language server to schema.json --- .vscode/launch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 72cafc11..effcc164 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -57,7 +57,7 @@ "--port", "10001", "--schema", - "${workspaceFolder}/publicschema.json" + "${workspaceFolder}/schema.json" ] }, { From 2b64ad90fde112813a356e47fd0e9cc137217af3 Mon Sep 17 00:00:00 2001 From: Parker Rowe Date: Thu, 16 Oct 2025 12:18:17 -0400 Subject: [PATCH 04/13] remove unused ./out directory from the VSC extension used for testing --- editors/vscode/out/extension.js | 73 ------- editors/vscode/out/extension.js.map | 1 - editors/vscode/out/hover.js | 77 ------- editors/vscode/out/hover.js.map | 1 - editors/vscode/out/server.js | 198 ------------------ editors/vscode/out/server.js.map | 1 - editors/vscode/out/utils/appleSilicon.js | 13 -- editors/vscode/out/utils/appleSilicon.js.map | 1 - editors/vscode/out/utils/deferredPromise.js | 16 -- .../vscode/out/utils/deferredPromise.js.map | 1 - editors/vscode/out/utils/devMode.js | 8 - editors/vscode/out/utils/devMode.js.map | 1 - editors/vscode/out/utils/index.js | 21 -- editors/vscode/out/utils/index.js.map | 1 - editors/vscode/out/utils/outputChannel.js | 21 -- editors/vscode/out/utils/outputChannel.js.map | 1 - 16 files changed, 435 deletions(-) delete mode 100644 editors/vscode/out/extension.js delete mode 100644 editors/vscode/out/extension.js.map delete mode 100644 editors/vscode/out/hover.js delete mode 100644 editors/vscode/out/hover.js.map delete mode 100644 editors/vscode/out/server.js delete mode 100644 editors/vscode/out/server.js.map delete mode 100644 editors/vscode/out/utils/appleSilicon.js delete mode 100644 editors/vscode/out/utils/appleSilicon.js.map delete mode 100644 editors/vscode/out/utils/deferredPromise.js delete mode 100644 editors/vscode/out/utils/deferredPromise.js.map delete mode 100644 editors/vscode/out/utils/devMode.js delete mode 100644 editors/vscode/out/utils/devMode.js.map delete mode 100644 editors/vscode/out/utils/index.js delete mode 100644 editors/vscode/out/utils/index.js.map delete mode 100644 editors/vscode/out/utils/outputChannel.js delete mode 100644 editors/vscode/out/utils/outputChannel.js.map diff --git a/editors/vscode/out/extension.js b/editors/vscode/out/extension.js deleted file mode 100644 index ef102421..00000000 --- a/editors/vscode/out/extension.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.deactivate = exports.activate = void 0; -const vscode = require("vscode"); -const hover_1 = require("./hover"); -const server_1 = require("./server"); -let lsp = undefined; -async function activate(context) { - try { - lsp = new server_1.LSP(context); - await lsp?.start(); - const commandHandlers = { - 'circleci-language-server.restartServer': () => { - lsp?.restart(); - }, - 'circleci-language-server.selectTagAndComplete': () => { - // Change editor selection to have a tag selected - const editor = vscode.window.activeTextEditor; - const document = vscode.window.activeTextEditor?.document; - if (!document || !editor) { - return; - } - const r = document.getWordRangeAtPosition(editor.selection.start, new RegExp('([A-Za-z0-9_]+[.|-]*)+')); - if (r?.start) { - editor.selections = [ - // Important to activate the cursor at the START of the selection. Has an importance when autocompleting in Language Server - new vscode.Selection(r.end, r.start), - ]; - } - // Trigger completion again - vscode.commands.executeCommand('editor.action.triggerSuggest'); - }, - }; - const wrap = (name, handler) => { - return async (...args) => { - try { - await handler(...args); - } - catch (e) { - console.error('container', 'command failed:', name, e); - } - }; - }; - Object.keys(commandHandlers).forEach((commandName) => { - context.subscriptions.push(vscode.commands.registerCommand(commandName, wrap(commandName, commandHandlers[commandName]))); - }); - const redHatYAMLExtension = vscode.extensions.getExtension('redhat.vscode-yaml'); - if (!redHatYAMLExtension?.isActive) { - vscode.languages.registerHoverProvider({ - scheme: 'file', - language: 'yaml', - pattern: '**/.circleci/**/*', - }, { - provideHover: (document, position) => { - return (0, hover_1.doHover)(context, { - ...document, - uri: document.uri.toString(), - }, position); - }, - }); - } - } - catch (e) { - console.trace(); - console.error(e); - } -} -exports.activate = activate; -async function deactivate(context) { - await lsp?.stop(); -} -exports.deactivate = deactivate; -//# sourceMappingURL=extension.js.map \ No newline at end of file diff --git a/editors/vscode/out/extension.js.map b/editors/vscode/out/extension.js.map deleted file mode 100644 index 1adc9ad4..00000000 --- a/editors/vscode/out/extension.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,mCAAkC;AAElC,qCAA+B;AAK/B,IAAI,GAAG,GAAoB,SAAS,CAAC;AAE9B,KAAK,UAAU,QAAQ,CAAC,OAAgC;IAC3D,IAAI;QACA,GAAG,GAAG,IAAI,YAAG,CAAC,OAAO,CAAC,CAAC;QACvB,MAAM,GAAG,EAAE,KAAK,EAAE,CAAC;QACnB,MAAM,eAAe,GAAwC;YACzD,wCAAwC,EAAE,GAAG,EAAE;gBAC3C,GAAG,EAAE,OAAO,EAAE,CAAC;YACnB,CAAC;YACD,+CAA+C,EAAE,GAAG,EAAE;gBAClD,iDAAiD;gBACjD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC;gBAC9C,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,QAAQ,CAAC;gBAE1D,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAE;oBACtB,OAAO;iBACV;gBAED,MAAM,CAAC,GAAG,QAAQ,CAAC,sBAAsB,CACrC,MAAM,CAAC,SAAS,CAAC,KAAK,EACtB,IAAI,MAAM,CAAC,wBAAwB,CAAC,CACvC,CAAC;gBAEF,IAAI,CAAC,EAAE,KAAK,EAAE;oBACV,MAAM,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AAG,EAAE,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE;qBAC/B,EACD,QAAQ,CACX,CAAC;gBACN,CAAC;aACJ,CACJ,CAAC;SACL;KACJ;IAAC,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACpB;AACL,CAAC;AArFD,4BAqFC;AAEM,KAAK,UAAU,UAAU,CAAC,OAAgC;IAC7D,MAAM,GAAG,EAAE,IAAI,EAAE,CAAC;AACtB,CAAC;AAFD,gCAEC"} \ No newline at end of file diff --git a/editors/vscode/out/hover.js b/editors/vscode/out/hover.js deleted file mode 100644 index 3c91450e..00000000 --- a/editors/vscode/out/hover.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.setHoverInLanguageServer = exports.getCircleHoverLanguageService = exports.getYamlLanguageService = exports.doHover = void 0; -const path = require("path"); -const vscode = require("vscode"); -const fs_1 = require("fs"); -const vscode_json_languageservice_1 = require("vscode-json-languageservice"); -const yamlParser07_1 = require("yaml-language-server/out/server/src/languageservice/parser/yamlParser07"); -const arrUtils_1 = require("yaml-language-server/out/server/src/languageservice/utils/arrUtils"); -const utils_1 = require("./utils"); -let lsHover = undefined; -async function doHover(context, document, position) { - if (!lsHover) { - lsHover = (0, exports.getYamlLanguageService)(context); - } - // @ts-ignore - let hover = await lsHover.doHover(document, position); - if (hover && Array.isArray(hover?.contents)) { - const markdownString = new vscode.MarkdownString(hover.contents.join('\n').replace(/\\/g, '')); - let range = undefined; - if (hover.range) { - range = new vscode.Range(new vscode.Position(hover.range.start.line, hover.range.start.character), new vscode.Position(hover.range.end.line, hover.range.end.character)); - } - return new vscode.Hover(markdownString, range); - } - return hover; -} -exports.doHover = doHover; -const getYamlLanguageService = function (context) { - const publicSchemaLocation = (0, utils_1.isInDevMode)() - ? context.asAbsolutePath(path.join('..', '..', 'publicschema.json')) - : context.asAbsolutePath(path.join('publicschema.json')); - const publicSchema = (0, fs_1.readFileSync)(publicSchemaLocation, 'utf8'); - const parsedPublicSchema = JSON.parse(publicSchema); - const circleciHoverLanguageService = (0, exports.getCircleHoverLanguageService)(parsedPublicSchema); - return (0, exports.setHoverInLanguageServer)(circleciHoverLanguageService); -}; -exports.getYamlLanguageService = getYamlLanguageService; -const getCircleHoverLanguageService = function (schema) { - const builtInParams = {}; - const languageService = (0, vscode_json_languageservice_1.getLanguageService)({ - ...builtInParams, - }); - languageService.configure({ - validate: true, - allowComments: false, - schemas: [ - { - uri: 'json', - fileMatch: ['*'], - schema: schema, - }, - ], - }); - return languageService; -}; -exports.getCircleHoverLanguageService = getCircleHoverLanguageService; -const setHoverInLanguageServer = function (circleciHoverLanguageService) { - const builtInParams = {}; - const languageService = (0, vscode_json_languageservice_1.getLanguageService)({ - ...builtInParams, - }); - languageService.doHover = function (document, position) { - const doc = (0, yamlParser07_1.parse)(document.getText()); - const offset = document.offsetAt(position); - const currentDoc = (0, arrUtils_1.matchOffsetToDocument)(offset, doc); - if (!currentDoc) { - return Promise.resolve(null); - } - const currentDocIndex = doc.documents.indexOf(currentDoc); - currentDoc.currentDocIndex = currentDocIndex; - return circleciHoverLanguageService.doHover(document, position, currentDoc); - }; - return languageService; -}; -exports.setHoverInLanguageServer = setHoverInLanguageServer; -//# sourceMappingURL=hover.js.map \ No newline at end of file diff --git a/editors/vscode/out/hover.js.map b/editors/vscode/out/hover.js.map deleted file mode 100644 index c2e4b77e..00000000 --- a/editors/vscode/out/hover.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hover.js","sourceRoot":"","sources":["../src/hover.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,iCAAiC;AACjC,2BAAkC;AAElC,6EAKqC;AACrC,0GAA6G;AAC7G,iGAA2G;AAE3G,mCAAsC;AAEtC,IAAI,OAAO,GAAgC,SAAS,CAAC;AAE9C,KAAK,UAAU,OAAO,CACzB,OAAgC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AAG,CAAC,CAAC;QACtD,IAAI,CAAC,UAAU,EAAE;YACb,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAChC;QAED,MAAM,eAAe,GAAG,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC1D,UAAU,CAAC,eAAe,GAAG,eAAe,CAAC;QAE7C,OAAO,4BAA4B,CAAC,OAAO,CACvC,QAAQ,EACR,QAAQ,EACR,UAAU,CACb,CAAC;IACN,CAAC,CAAC;IAEF,OAAO,eAAe,CAAC;AAC3B,CAAC,CAAC;AA/BW,QAAA,wBAAwB,4BA+BnC"} \ No newline at end of file diff --git a/editors/vscode/out/server.js b/editors/vscode/out/server.js deleted file mode 100644 index eb677448..00000000 --- a/editors/vscode/out/server.js +++ /dev/null @@ -1,198 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LSP = void 0; -const os = require("os"); -const net = require("net"); -const path = require("path"); -const get_port_1 = require("get-port"); -const vscode = require("vscode"); -const cp = require("child_process"); -const lc = require("vscode-languageclient/node"); -const utils_1 = require("./utils"); -const fs_1 = require("fs"); -class LSP { - constructor(context) { - this.context = context; - const isDev = (0, utils_1.isInDevMode)(); - const serverBinary = this.getServerBinaryFileName(); - if (!serverBinary) { - throw new Error('Unsupported platform'); - } - this.serverPath = isDev - ? context.asAbsolutePath(path.join('..', '..', 'bin', 'start_server')) - : context.asAbsolutePath(path.join('bin', serverBinary)); - this.serverPath = - os.platform() == 'win32' - ? `${this.serverPath}.exe` - : this.serverPath; - } - getServerBinaryFileName() { - switch (os.platform()) { - case 'darwin': - const onAppleSilicon = (0, utils_1.isAppleSilicon)(); - return `${os.platform()}-${onAppleSilicon ? 'arm64' : 'amd64'}-lsp`; - case 'linux': - const arch = os.arch(); - return `${os.platform()}-${['arm64', 'arm'].includes(arch) ? 'arm64' : 'amd64'}-lsp`; - case 'win32': - if (os.arch() == 'x64') { - return 'windows-amd64-lsp'; - } - } - } - get server() { - if (!this._server) { - throw new Error('Server not initialized'); - } - return this._server; - } - get client() { - if (!this._client) { - throw new Error('Client not initialized'); - } - return this._client; - } - async start() { - this._client = await this.initLSPClient(); - } - async stop() { - await this.client.stop(); - this.server.kill(); - } - async restart() { - await this.stop(); - await this.start(); - } - async spawnLSPServer(port) { - const inDevMode = (0, utils_1.isInDevMode)(); - const schemaLocation = inDevMode - ? this.context.asAbsolutePath(path.join('..', '..', 'schema.json')) - : this.context.asAbsolutePath(path.join('schema.json')); - const servProcess = cp.spawn(this.serverPath, [], { - env: { - SCHEMA_LOCATION: schemaLocation, - HOME: os.homedir(), - PORT: port.toString(), - }, - }); - const promise = (0, utils_1.createDeferredPromise)(); - servProcess.on('message', (0, utils_1.outputChannel)().appendLine); - servProcess.on('error', (0, utils_1.outputChannel)().appendLine); - servProcess.on('exit', (0, utils_1.outputChannel)().appendLine); - servProcess.on('close', (0, utils_1.outputChannel)().appendLine); - servProcess.on('disconnect', (0, utils_1.outputChannel)().appendLine); - servProcess.stderr.on('data', (0, utils_1.outputChannel)().appendLine); - servProcess.stdout.on('data', (0, utils_1.outputChannel)().appendLine); - const timeout = setTimeout(() => { - promise.reject('LSP server did not start in time'); - }, 10000); - const serverStarted = (data) => { - const value = Buffer.isBuffer(data) ? data.toString() : data; - if (value.trim().startsWith('Server started')) { - clearTimeout(timeout); - promise.resolve(servProcess); - servProcess.stdout.removeListener('data', serverStarted); - } - }; - servProcess.stdout.on('data', serverStarted); - return promise.promise; - } - spawnLSPClient() { - /** - * Spawn and connect to the LSP server - */ - const serverOptions = async () => { - const port = await (0, get_port_1.default)(); - this._server = await this.spawnLSPServer(port); - const connectionInfo = { - port, - host: 'localhost', - }; - const socket = net.connect(connectionInfo); - const result = { - writer: socket, - reader: socket, - }; - return await Promise.resolve(result); - }; - const clientOptions = { - documentSelector: [ - { - scheme: 'file', - language: 'yaml', - pattern: '**/.circleci/**/*', - }, - ], - synchronize: { - configurationSection: ['yaml'], - fileEvents: vscode.workspace.createFileSystemWatcher('**/*.(yml|yaml)'), - }, - diagnosticPullOptions: { - onChange: true, - onSave: true, - onTabs: true, - }, - diagnosticCollectionName: 'cci-diag', - initializationOptions: { - isCciExtension: true, - }, - outputChannel: (0, utils_1.outputChannel)(), - }; - const client = new lc.LanguageClient('cci-language-server', 'CircleCI Language Server', serverOptions, clientOptions); - client.onTelemetry((event) => console.log('Telemetry event', event)); - /* - * Example of request to activate rollbar - * - * client.sendRequest('workspace/executeCommand', { - * command: 'setRollbarInformation', - * arguments: [ - * { - * enabled: true, - * environment: 'development', - * sessionId: vscode.env.sessionId, - * machineId: vscode.env.machineId, - * machine: `${os.platform}/${os.arch}`, - * personId: 'id', - * requestIp: '1.2.4.8', - * }, - * ], - * }); - */ - return client; - } - async initLSPClient() { - const client = this.spawnLSPClient(); - await client.start(); - const token = process.env.TOKEN; - const setTokenCommand = { - command: 'setToken', - arguments: [token], - }; - await client.sendRequest('workspace/executeCommand', setTokenCommand); - const selfHostedUrl = process.env.SELF_HOSTED_URL; - const setHostUrlCommand = { - command: 'setSelfHostedUrl', - arguments: [selfHostedUrl], - }; - await client.sendRequest('workspace/executeCommand', setHostUrlCommand); - const projectSlug = 'gh/CircleCI-Public/circleci-yaml-language-server'; - const setProjectSlugCommand = { - command: 'setProjectSlug', - arguments: [projectSlug], - }; - await client.sendRequest('workspace/executeCommand', setProjectSlugCommand); - const filePath = path.join(__dirname, '..', '..', '..', '.circleci', 'config.yml'); - const content = (0, fs_1.readFileSync)(filePath, { - encoding: 'utf-8', - }); - const getWorkflowsCommand = { - command: 'getWorkflows', - arguments: [content, filePath], - }; - const res = await client.sendRequest('workspace/executeCommand', getWorkflowsCommand); - console.log(res); - return client; - } -} -exports.LSP = LSP; -//# sourceMappingURL=server.js.map \ No newline at end of file diff --git a/editors/vscode/out/server.js.map b/editors/vscode/out/server.js.map deleted file mode 100644 index 64f730f2..00000000 --- a/editors/vscode/out/server.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file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,CAAC;SAC3B,CAAC;QACF,MAAM,MAAM,CAAC,WAAW,CACpB,0BAA0B,EAC1B,qBAAqB,CACxB,CAAC;QAEF,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CACtB,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,YAAY,CACf,CAAC;QACF,MAAM,OAAO,GAAG,IAAA,iBAAY,EAAC,QAAQ,EAAE;YACnC,QAAQ,EAAE,OAAO;SACpB,CAAC,CAAC;QACH,MAAM,mBAAmB,GAAG;YACxB,OAAO,EAAE,cAAc;YACvB,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;SACjC,CAAC;QACF,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,WAAW,CAChC,0BAA0B,EAC1B,mBAAmB,CACtB,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEjB,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AArPD,kBAqPC"} \ No newline at end of file diff --git a/editors/vscode/out/utils/appleSilicon.js b/editors/vscode/out/utils/appleSilicon.js deleted file mode 100644 index ba0071d6..00000000 --- a/editors/vscode/out/utils/appleSilicon.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isAppleSilicon = void 0; -const os = require("os"); -/** - * Check if the user is running on an Apple Silicon chipset - * @returns true if the processor is an Apple one (such as the M1) - */ -function isAppleSilicon() { - return os.cpus().some((cpu) => cpu.model.startsWith('Apple ')); -} -exports.isAppleSilicon = isAppleSilicon; -//# sourceMappingURL=appleSilicon.js.map \ No newline at end of file diff --git a/editors/vscode/out/utils/appleSilicon.js.map b/editors/vscode/out/utils/appleSilicon.js.map deleted file mode 100644 index 5b80554b..00000000 --- a/editors/vscode/out/utils/appleSilicon.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"appleSilicon.js","sourceRoot":"","sources":["../../src/utils/appleSilicon.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AAEzB;;;GAGG;AACH,SAAgB,cAAc;IAC1B,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;AACnE,CAAC;AAFD,wCAEC"} \ No newline at end of file diff --git a/editors/vscode/out/utils/deferredPromise.js b/editors/vscode/out/utils/deferredPromise.js deleted file mode 100644 index 52f8a802..00000000 --- a/editors/vscode/out/utils/deferredPromise.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createDeferredPromise = void 0; -function createDeferredPromise() { - let resolve; - let reject; - const promise = new Promise((res, rej) => { - resolve = res; - reject = rej; - }); - let created = Date.now(); - //@ts-ignore - return { resolve, reject, promise, created }; -} -exports.createDeferredPromise = createDeferredPromise; -//# sourceMappingURL=deferredPromise.js.map \ No newline at end of file diff --git a/editors/vscode/out/utils/deferredPromise.js.map b/editors/vscode/out/utils/deferredPromise.js.map deleted file mode 100644 index 9a972664..00000000 --- a/editors/vscode/out/utils/deferredPromise.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"deferredPromise.js","sourceRoot":"","sources":["../../src/utils/deferredPromise.ts"],"names":[],"mappings":";;;AAOA,SAAgB,qBAAqB;IACjC,IAAI,OAAyB,CAAC;IAC9B,IAAI,MAAwB,CAAC;IAC7B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACxC,OAAO,GAAG,GAAG,CAAC;QACd,MAAM,GAAG,GAAG,CAAC;IACjB,CAAC,CAAC,CAAC;IACH,IAAI,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACzB,YAAY;IACZ,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AACjD,CAAC;AAVD,sDAUC"} \ No newline at end of file diff --git a/editors/vscode/out/utils/devMode.js b/editors/vscode/out/utils/devMode.js deleted file mode 100644 index 2e39ea73..00000000 --- a/editors/vscode/out/utils/devMode.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isInDevMode = void 0; -function isInDevMode() { - return process.env.CCI_DEV === 'true'; -} -exports.isInDevMode = isInDevMode; -//# sourceMappingURL=devMode.js.map \ No newline at end of file diff --git a/editors/vscode/out/utils/devMode.js.map b/editors/vscode/out/utils/devMode.js.map deleted file mode 100644 index f0ceb8a5..00000000 --- a/editors/vscode/out/utils/devMode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"devMode.js","sourceRoot":"","sources":["../../src/utils/devMode.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW;IACvB,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,MAAM,CAAC;AAC1C,CAAC;AAFD,kCAEC"} \ No newline at end of file diff --git a/editors/vscode/out/utils/index.js b/editors/vscode/out/utils/index.js deleted file mode 100644 index 694fa212..00000000 --- a/editors/vscode/out/utils/index.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./deferredPromise"), exports); -__exportStar(require("./outputChannel"), exports); -__exportStar(require("./appleSilicon"), exports); -__exportStar(require("./devMode"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/editors/vscode/out/utils/index.js.map b/editors/vscode/out/utils/index.js.map deleted file mode 100644 index 564f24cc..00000000 --- a/editors/vscode/out/utils/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,kDAAgC;AAChC,iDAA+B;AAC/B,4CAA0B"} \ No newline at end of file diff --git a/editors/vscode/out/utils/outputChannel.js b/editors/vscode/out/utils/outputChannel.js deleted file mode 100644 index 2624aaeb..00000000 --- a/editors/vscode/out/utils/outputChannel.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.outputChannel = exports.traceOutputChannel = void 0; -const vscode = require("vscode"); -let TRACE_OUTPUT_CHANNEL = null; -function traceOutputChannel() { - if (!TRACE_OUTPUT_CHANNEL) { - TRACE_OUTPUT_CHANNEL = vscode.window.createOutputChannel('Circle CI Language Server Trace'); - } - return TRACE_OUTPUT_CHANNEL; -} -exports.traceOutputChannel = traceOutputChannel; -let OUTPUT_CHANNEL = null; -function outputChannel() { - if (!OUTPUT_CHANNEL) { - OUTPUT_CHANNEL = vscode.window.createOutputChannel('Circle CI Language Server'); - } - return OUTPUT_CHANNEL; -} -exports.outputChannel = outputChannel; -//# sourceMappingURL=outputChannel.js.map \ No newline at end of file diff --git a/editors/vscode/out/utils/outputChannel.js.map b/editors/vscode/out/utils/outputChannel.js.map deleted file mode 100644 index 93353aa7..00000000 --- a/editors/vscode/out/utils/outputChannel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"outputChannel.js","sourceRoot":"","sources":["../../src/utils/outputChannel.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AAEjC,IAAI,oBAAoB,GAAgC,IAAI,CAAC;AAC7D,SAAgB,kBAAkB;IAC9B,IAAI,CAAC,oBAAoB,EAAE;QACvB,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CACpD,iCAAiC,CACpC,CAAC;KACL;IACD,OAAO,oBAAoB,CAAC;AAChC,CAAC;AAPD,gDAOC;AACD,IAAI,cAAc,GAAgC,IAAI,CAAC;AACvD,SAAgB,aAAa;IACzB,IAAI,CAAC,cAAc,EAAE;QACjB,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAC9C,2BAA2B,CAC9B,CAAC;KACL;IACD,OAAO,cAAc,CAAC;AAC1B,CAAC;AAPD,sCAOC"} \ No newline at end of file From 4280f5d09951096799795c9f4b3432084829778a Mon Sep 17 00:00:00 2001 From: Parker Rowe Date: Thu, 16 Oct 2025 12:19:20 -0400 Subject: [PATCH 05/13] tell the testing VS Code extension to always register a hover provider, do not give in to the Red Hat one --- editors/vscode/src/extension.ts | 49 ++++++++++++++++----------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/editors/vscode/src/extension.ts b/editors/vscode/src/extension.ts index ff7caaab..675aa817 100644 --- a/editors/vscode/src/extension.ts +++ b/editors/vscode/src/extension.ts @@ -62,33 +62,30 @@ export async function activate(context: vscode.ExtensionContext) { ); }); - const redHatYAMLExtension = - vscode.extensions.getExtension('redhat.vscode-yaml'); - - if (!redHatYAMLExtension?.isActive) { - vscode.languages.registerHoverProvider( - { - scheme: 'file', - language: 'yaml', - pattern: '**/.circleci/**/*', - }, - { - provideHover: ( - document: vscode.TextDocument, - position: vscode.Position, - ): vscode.ProviderResult => { - return doHover( - context, - { - ...document, - uri: document.uri.toString(), - }, - position, - ); - }, + // Register a hover provider in VS Code that will read the schema.json and + // provide hover hints from the description/markdownDescription keys. + vscode.languages.registerHoverProvider( + { + scheme: 'file', + language: 'yaml', + pattern: '**/.circleci/**/*', + }, + { + provideHover: ( + document: vscode.TextDocument, + position: vscode.Position, + ): vscode.ProviderResult => { + return doHover( + context, + { + ...document, + uri: document.uri.toString(), + }, + position, + ); }, - ); - } + }, + ); } catch (e) { console.trace(); console.error(e); From 929b2ac7c93abb5edc68b5b58c870c44842fb995 Mon Sep 17 00:00:00 2001 From: Parker Rowe Date: Thu, 16 Oct 2025 12:19:36 -0400 Subject: [PATCH 06/13] point testing VS Code extension to schema, not publicschema --- editors/vscode/src/hover.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/editors/vscode/src/hover.ts b/editors/vscode/src/hover.ts index b9b4a3db..fb30f39e 100644 --- a/editors/vscode/src/hover.ts +++ b/editors/vscode/src/hover.ts @@ -55,15 +55,15 @@ export async function doHover( export const getYamlLanguageService = function ( context: vscode.ExtensionContext, ): LanguageService { - const publicSchemaLocation = isInDevMode() - ? context.asAbsolutePath(path.join('..', '..', 'publicschema.json')) - : context.asAbsolutePath(path.join('publicschema.json')); + const schemaLocation = isInDevMode() + ? context.asAbsolutePath(path.join('..', '..', 'schema.json')) + : context.asAbsolutePath(path.join('schema.json')); - const publicSchema = readFileSync(publicSchemaLocation, 'utf8'); - const parsedPublicSchema = JSON.parse(publicSchema) as JSONSchema; + const schema = readFileSync(schemaLocation, 'utf8'); + const parsedSchema = JSON.parse(schema) as JSONSchema; const circleciHoverLanguageService: LanguageService = - getCircleHoverLanguageService(parsedPublicSchema); + getCircleHoverLanguageService(parsedSchema); return setHoverInLanguageServer(circleciHoverLanguageService); }; From b75dc80692755b4407f926dce26d7e1f59ea4c5f Mon Sep 17 00:00:00 2001 From: Parker Rowe Date: Thu, 16 Oct 2025 12:20:11 -0400 Subject: [PATCH 07/13] make task start use schema.json, not publicschema.json --- Taskfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Taskfile.yml b/Taskfile.yml index 578fe6d6..fd394a19 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -60,7 +60,7 @@ tasks: - ./bin/start_server env: PORT: "{{.PORT | default 10001}}" - SCHEMA_LOCATION: ./publicschema.json + SCHEMA_LOCATION: ./schema.json init: - go mod download From 875d347e1bb11037751f1f9359bc4328500e3a77 Mon Sep 17 00:00:00 2001 From: Parker Rowe Date: Thu, 16 Oct 2025 12:46:56 -0400 Subject: [PATCH 08/13] update HACKING.md to only reference schema.json --- HACKING.md | 105 +++++++++++++++-------------------------------------- 1 file changed, 30 insertions(+), 75 deletions(-) diff --git a/HACKING.md b/HACKING.md index bfc05ffa..99c8a50a 100644 --- a/HACKING.md +++ b/HACKING.md @@ -106,13 +106,13 @@ For example, I've the following in my `.emacs.d/init.el`: ## Testing within VSCode -This repository embed a VSCode extension (located at `editors/vscode`) so you -can test your code within the editor. +This repository embeds a mini VSCode extension (located at `editors/vscode`) so you +can test your changes to the language server using VS Code locally. 1. In order to run the extension, you must first prepare installation. This command will install the necessary node packages and build the extension: -``` +```bash task prepare:vscode ``` @@ -125,86 +125,41 @@ task prepare:vscode `Run and Debug` tab and run it via the `Run Extension` on the dropdown menu at the top of the tab. -## Understanding the Schema Files - -The CircleCI YAML Language Server uses **two different schema files** for different purposes: + > [!NOTE] + > Do not do `Run Extension (user extensions enabled)`. Running with no other extensions enabled + > could cause confusion. Specifically, if you had the Red Hat YAML Language Server extension + > installed, it would display hover hints from the JSON schema from schemastore, rather than the local schema.json + > that you will often be making changes to locally and want to test. -| File | Purpose | Used By | -| ------------------- | -------------------------------------------- | ------------------------------------------- | -| `schema.json` | Core validation and language server features | Go language server binary, external tools | -| `publicschema.json` | Rich hover documentation | VSCode extension TypeScript hover providers | +## Understanding the `schema.json` file -### Architecture +The CircleCI YAML Language Server uses the standardized [JSON schema](https://json-schema.org/) to help perform basic structural validations and documentation hover hints the CircleCI YAML files. Our schema lives in `schema.json` and is utilized in multiple different places both inside and outside the codebase. -This is a **two-tier schema system**: +### Use Cases for `schema.json` -### `schema.json` +- **External Tools**: This `schema.json` is notably used by the Red Hat YAML extension. Most VSCode users who open YAML files will have this extension installed. This extension by default will pull in schemas from [schemastore.org](https://www.schemastore.org/api/json/catalog.json). This extension on its own can detect if a user is reading a CircleCI config, then it will automatically pull in our `schema.json` by looking at schemastore, which in turn pulls the latest version of `schema.json` from the main branch of this repository. + - The Red Hat YAML language gets the schema.json from this URL: `https://raw.githubusercontent.com/CircleCI-Public/circleci-yaml-language-server/refs/heads/main/schema.json` -**Primary Purpose**: Validates the YAML is valid according to our CircleCI rules + > [!NOTE] + > A user without the CircleCI VS Code extension installed, and just the Red Hat YAML language server + > installed, still benefits from this `schema.json`. The Red Hat YAML Language server on its own will provide: + > + > 1. schema validation + > 2. a hover provider in VS Code for documentation hints + > + > The benefit of installing the CircleCI Extension in VSCode is that it also pulls in the Go binary, providing more + > complex validations against a user's CircleCI config that aren't possible with JSON Schema alone. -**Used By**: - -- **Go Language Server Binary**: The main language server reads this schema via the `SCHEMA_LOCATION` environment variable +- **CircleCI Go Language Server Binary**: The main language server reads this schema via the `SCHEMA_LOCATION` environment variable. The Go language server binary uses a JSON schema validation library and validates the config against the schema. + - As mentioned above, JSON Schema validation is also handled the Red Hat YAML language server. Our language server is intended to work standalone (but still be compatible with other language servers), so we also perform JSON schema validation in case the user only has our language server installed. - Location: `pkg/services/diagnostics.go`, `pkg/services/validate.go`, etc. -- **External Tools**: Used by the Red Hat YAML extension. This extension looks at [schemastore.org](https://www.schemastore.org/api/json/catalog.json), which reads the latest schema.json from this repo. - - URL: `https://raw.githubusercontent.com/CircleCI-Public/circleci-yaml-language-server/refs/heads/main/schema.json` - -- **VSCode Extension**: Downloaded from GitHub releases page and bundled with the extension - - Location in our private VSCode extension +- **CircleCI VSCode Extension**: CircleCI's closed-source VS Code extension will automatically pull in the latest version of the CircleCI language server from the GitHub releases page. The VS Code extension has some logic such that: + 1. if it detects that the Red Hat YAML Language Server extension is not installed, it will register a hover provider + so that when the user hovers over the YAML code, it will provide hover hints from the `schema.json` it downloaded + from the CircleCI language server's releases page + 2. if it detects the Red Hat YAML Language Server extension, it will defer the hover hints to the Red Hat + YAML Language Server, otherwise the user would see two instances of the hover hints. - **Go Tests**: Used for validation testing - Location: `pkg/services/diagnostics_test.go` - -**Characteristics**: - -- JSON Schema draft-07 - -### `publicschema.json` - -**Primary Purpose**: Documentation for IDE hover features - -**Used By**: - -- **VSCode Extension Hover Provider** - - Location: `circleci-vscode-extension/packages/vscode-extension/src/lsp/hover.ts:62-67` - -**Characteristics**: - -- JSON Schema draft-04 -- Includes inline CircleCI documentation URLs (e.g., `https://circleci.com/docs/configuration-reference#...`) -- **Never used by the Go language server** - -### Why Two Schemas? - -The separation exists because: - -- The Go language server needs a comprehensive schema for validation that handles all edge cases -- The hover provider needs clean documentation with links to CircleCI docs - -### Development Guidelines - -#### When to Update `schema.json` - -Update this schema when: - -- Adding or modifying CircleCI config validation rules -- Changing supported configuration keys or values -- Adding new CircleCI features that affect config structure -- Fixing validation bugs - -#### When to Update `publicschema.json` - -Update this schema when: - -- Improving hover documentation text -- Adding or updating links to CircleCI documentation -- Changing the structure of hover hints -- Making documentation more user-friendly - -#### Keeping Schemas in Sync - -> ⚠️ [!IMPORTANT] -> Both schemas should represent the same CircleCI configuration format. When you update one schema's structure, you likely need to update the other. - -**Best Practice**: Make structural changes to both schemas in the same PR to prevent drift. From 57c2ade6957f3e0f426e7a187918598779b9f50b Mon Sep 17 00:00:00 2001 From: Parker Rowe Date: Thu, 16 Oct 2025 13:22:59 -0400 Subject: [PATCH 09/13] migrate the last missing pieces of documentation from publicschema.json --- schema.json | 399 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 367 insertions(+), 32 deletions(-) diff --git a/schema.json b/schema.json index 8f77d5e6..231fdd4e 100644 --- a/schema.json +++ b/schema.json @@ -474,7 +474,8 @@ "executor", "integer", "env_var_name" - ] + ], + "markdownDescription": "The parameter type. See [Parameter Types](https://circleci.com/docs/reusing-config#parameter-syntax) for details:\n- `boolean`: A boolean parameter\n- `string`: A string parameter \n- `integer`: An integer parameter\n- `enum`: An enum parameter (list of allowed string values)\n- `executor`: An executor parameter (allows job to choose executor)\n- `steps`: A steps parameter (allows mixing predefined and user-defined steps)\n- `env_var_name`: An environment variable name parameter (must match POSIX_NAME regexp)" }, "default": { "oneOf": [ @@ -496,13 +497,16 @@ ] }, "description": { - "type": "string" + "type": "string", + "markdownDescription": "A description of the parameter" }, "enum": { "type": "array", "items": { "type": "string" - } + }, + "minItems": 1, + "markdownDescription": "List of allowed values for an `enum` type parameter" } }, "additionalProperties": false, @@ -1078,34 +1082,41 @@ "items": { "$ref": "#/definitions/logic" }, - "minItems": 1 + "minItems": 1, + "markdownDescription": "https://circleci.com/docs/configuration-reference#logic-statements\n\nLogical and: true when all statements in the list are true" }, "or": { "type": "array", "items": { "$ref": "#/definitions/logic" }, - "minItems": 1 + "minItems": 1, + "markdownDescription": "https://circleci.com/docs/configuration-reference#logic-statements\n\nLogical or: true when at least one statement in the list is true" }, "not": { - "$ref": "#/definitions/logic" + "$ref": "#/definitions/logic", + "markdownDescription": "https://circleci.com/docs/configuration-reference#logic-statements\n\nLogical not: true when statement is false" }, "equal": { "type": "array", "items": { "$ref": "#/definitions/logic" }, - "minItems": 1 + "minItems": 1, + "markdownDescription": "https://circleci.com/docs/configuration-reference#logic-statements\n\nTrue when all elements in the list are equal" }, "matches": { "type": "object", "additionalProperties": false, + "markdownDescription": "https://circleci.com/docs/configuration-reference#logic-statements\n\nTrue when value matches the pattern", "properties": { "pattern": { - "type": "string" + "type": "string", + "markdownDescription": "Regular expression pattern to match against" }, "value": { - "type": "string" + "type": "string", + "markdownDescription": "Value to test against the pattern" } }, "required": [ @@ -1145,6 +1156,7 @@ "maxProperties": 1, "properties": { "run": { + "markdownDescription": "https://circleci.com/docs/configuration-reference#run\n\nUsed for invoking all command-line programs, taking either a map of configuration values, or, when called in its short-form, a string that will be used as both the `command` and `name`. Run commands are executed using non-login shells by default, so you must explicitly source any dotfiles as part of the command.", "oneOf": [ { "type": "string" @@ -1153,12 +1165,297 @@ "type": "object", "properties": { "command": { - "type": "string" + "type": "string", + "markdownDescription": "Command to run via the shell" + }, + "name": { + "type": "string", + "markdownDescription": "Title of the step to be shown in the CircleCI UI (default: full `command`)" + }, + "shell": { + "type": "string", + "markdownDescription": "Shell to use for execution command" + }, + "environment": { + "$ref": "#/definitions/environment", + "markdownDescription": "Additional environmental variables, locally scoped to command" + }, + "background": { + "type": "boolean", + "default": false, + "markdownDescription": "Whether or not this step should run in the background (default: false)" + }, + "working_directory": { + "type": "string", + "markdownDescription": "In which directory to run this step (default: `working_directory` of the job)" + }, + "no_output_timeout": { + "type": "string", + "pattern": "\\d+(\\.\\d+)?[mhs]", + "default": "10m", + "markdownDescription": "Elapsed time the command can run without output. The string is a decimal with unit suffix, such as \"20m\", \"1.25h\", \"5s\" (default: 10 minutes)" + }, + "when": { + "enum": ["always", "on_success", "on_fail"], + "markdownDescription": "Specify when to enable or disable the step. Takes the following values: `always`, `on_success`, `on_fail` (default: `on_success`)" + }, + "max_auto_reruns": { + "type": "integer", + "minimum": 1, + "maximum": 5, + "markdownDescription": "Maximum number of automatic reruns for this step" + }, + "auto_rerun_delay": { + "type": "string", + "pattern": "^(10|[1-9])m|([1-9][0-9]*)s$", + "markdownDescription": "Delay before automatic rerun of this step" } }, "required": [ "command" - ] + ], + "if": { + "properties": { + "auto_rerun_delay": true + }, + "required": [ + "auto_rerun_delay" + ] + }, + "then": { + "required": [ + "max_auto_reruns" + ] + } + } + ] + }, + "checkout": { + "markdownDescription": "https://circleci.com/docs/configuration-reference#checkout\n\nSpecial step used to check out source code to the configured `path` (defaults to the `working_directory`). The reason this is a special step is because it is more of a helper function designed to make checking out code easy for you. If you require doing git over HTTPS you should not use this step as it configures git to checkout over ssh.", + "oneOf": [ + { + "type": "string", + "enum": ["checkout"] + }, + { + "type": "object", + "properties": { + "path": { + "type": "string", + "markdownDescription": "Checkout directory (default: job's `working_directory`)" + }, + "method": { + "type": "string", + "markdownDescription": "The checkout method to be used ('blobless' or 'full', default 'full')" + } + }, + "additionalProperties": false + } + ] + }, + "setup_remote_docker": { + "markdownDescription": "https://circleci.com/docs/configuration-reference#setup_remote_docker\n\nCreates a remote Docker environment configured to execute Docker commands.", + "oneOf": [ + { + "type": "string", + "enum": ["setup_remote_docker"] + }, + { + "type": "object", + "properties": { + "docker_layer_caching": { + "type": "boolean", + "default": false, + "markdownDescription": "When `docker_layer_caching` is set to `true`, CircleCI will try to reuse Docker Images (layers) built during a previous job or workflow (Paid feature)" + }, + "version": { + "markdownDescription": "If your build requires a specific docker image, you can set it as an image attribute", + "anyOf": [ + { + "type": "string", + "enum": [ + "20.10.24", + "20.10.23", + "20.10.18", + "20.10.17", + "20.10.14", + "20.10.12", + "20.10.11", + "20.10.7", + "20.10.6", + "20.10.2", + "19.03.13" + ] + }, + { + "type": "string" + } + ] + } + }, + "additionalProperties": false + } + ] + }, + "save_cache": { + "markdownDescription": "https://circleci.com/docs/configuration-reference#save_cache\n\nGenerates and stores a cache of a file or directory of files such as dependencies or source code in our object storage. Later jobs can restore this cache using the `restore_cache` step.", + "type": "object", + "required": ["paths", "key"], + "properties": { + "paths": { + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "List of directories which should be added to the cache" + }, + "key": { + "type": "string", + "markdownDescription": "Unique identifier for this cache" + }, + "name": { + "type": "string", + "markdownDescription": "Title of the step to be shown in the CircleCI UI (default: 'Saving Cache')" + }, + "when": { + "enum": ["always", "on_success", "on_fail"], + "markdownDescription": "Specify when to enable or disable the step. Takes the following values: `always`, `on_success`, `on_fail` (default: `on_success`)" + } + }, + "additionalProperties": false + }, + "restore_cache": { + "markdownDescription": "https://circleci.com/docs/configuration-reference#restore_cache\n\nRestores a previously saved cache based on a `key`. Cache needs to have been saved first for this key using the `save_cache` step.", + "oneOf": [ + { + "type": "object", + "required": ["key"], + "properties": { + "key": { + "type": "string", + "markdownDescription": "Single cache key to restore" + }, + "name": { + "type": "string", + "markdownDescription": "Title of the step to be shown in the CircleCI UI (default: 'Restoring Cache')" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": ["keys"], + "properties": { + "keys": { + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "List of cache keys to lookup for a cache to restore. Only first existing key will be restored." + }, + "name": { + "type": "string", + "markdownDescription": "Title of the step to be shown in the CircleCI UI (default: 'Restoring Cache')" + } + }, + "additionalProperties": false + } + ] + }, + "store_artifacts": { + "markdownDescription": "https://circleci.com/docs/configuration-reference#store_artifacts\n\nStep to store artifacts (for example logs, binaries, etc) to be available in the web app or through the API.", + "type": "object", + "required": ["path"], + "properties": { + "path": { + "type": "string", + "markdownDescription": "Directory in the primary container to save as job artifacts" + }, + "destination": { + "type": "string", + "markdownDescription": "Prefix added to the artifact paths in the artifacts API (default: the directory of the file specified in `path`)" + }, + "name": { + "type": "string", + "markdownDescription": "Title of the step to be shown in the CircleCI UI" + } + }, + "additionalProperties": false + }, + "store_test_results": { + "markdownDescription": "https://circleci.com/docs/configuration-reference#storetestresults\n\nSpecial step used to upload test results so they display in builds' Test Summary section and can be used for timing analysis. To also see test result as build artifacts, please use the `store_artifacts` step.", + "type": "object", + "required": ["path"], + "properties": { + "path": { + "type": "string", + "markdownDescription": "Path (absolute, or relative to your `working_directory`) to directory containing subdirectories of JUnit XML or Cucumber JSON test metadata files" + }, + "name": { + "type": "string", + "markdownDescription": "Title of the step to be shown in the CircleCI UI" + } + }, + "additionalProperties": false + }, + "persist_to_workspace": { + "markdownDescription": "https://circleci.com/docs/configuration-reference#persist_to_workspace\n\nSpecial step used to persist a temporary file to be used by another job in the workflow", + "type": "object", + "required": ["root", "paths"], + "properties": { + "root": { + "type": "string", + "markdownDescription": "Either an absolute path or a path relative to `working_directory`" + }, + "paths": { + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "Glob identifying file(s), or a non-glob path to a directory to add to the shared workspace. Interpreted as relative to the workspace root. Must not be the workspace root itself." + }, + "name": { + "type": "string", + "markdownDescription": "Title of the step to be shown in the CircleCI UI" + } + }, + "additionalProperties": false + }, + "attach_workspace": { + "markdownDescription": "https://circleci.com/docs/configuration-reference#attach_workspace\n\nSpecial step used to attach the workflow's workspace to the current container. The full contents of the workspace are downloaded and copied into the directory the workspace is being attached at.", + "type": "object", + "required": ["at"], + "properties": { + "at": { + "type": "string", + "markdownDescription": "Directory to attach the workspace to" + }, + "name": { + "type": "string", + "markdownDescription": "Title of the step to be shown in the CircleCI UI" + } + }, + "additionalProperties": false + }, + "add_ssh_keys": { + "markdownDescription": "https://circleci.com/docs/configuration-reference#add_ssh_keys\n\nSpecial step that adds SSH keys from a project's settings to a container. Also configures SSH to use these keys.", + "oneOf": [ + { + "type": "string", + "enum": ["add_ssh_keys"] + }, + { + "type": "object", + "properties": { + "fingerprints": { + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "List of fingerprints corresponding to the keys to be added" + } + }, + "additionalProperties": false } ] } @@ -1179,13 +1476,15 @@ "properties": { "when": { "type": "object", + "markdownDescription": "https://circleci.com/docs/configuration-reference#the-when-step-requires-version-21\n\nConditional step to run on custom conditions (determined at config-compile time) that are checked before a workflow runs", "required": [ "condition", "steps" ], "properties": { "condition": { - "$ref": "#/definitions/logic" + "$ref": "#/definitions/logic", + "markdownDescription": "A logical condition that must evaluate to true for the steps to run" }, "steps": { "oneOf": [ @@ -1198,19 +1497,22 @@ { "$ref": "#/definitions/step" } - ] + ], + "markdownDescription": "A list of steps to be performed when the condition is true" } } }, "unless": { "type": "object", + "markdownDescription": "https://circleci.com/docs/configuration-reference#the-when-step-requires-version-21\n\nConditional step to run when custom conditions aren't met (determined at config-compile time) that are checked before a workflow runs", "required": [ "condition", "steps" ], "properties": { "condition": { - "$ref": "#/definitions/logic" + "$ref": "#/definitions/logic", + "markdownDescription": "A logical condition that must evaluate to false for the steps to run" }, "steps": { "oneOf": [ @@ -1223,7 +1525,8 @@ { "$ref": "#/definitions/step" } - ] + ], + "markdownDescription": "A list of steps to be performed when the condition is false" } } } @@ -1276,6 +1579,25 @@ }, "resource_class": { "type": "string", + "default": "medium", + "enum": [ + "small", + "medium", + "medium+", + "large", + "xlarge", + "2xlarge", + "2xlarge+", + "arm.medium", + "arm.large", + "arm.xlarge", + "arm.2xlarge", + "gpu.nvidia.small", + "gpu.nvidia.medium", + "windows.gpu.nvidia.medium", + "macos.m1.medium.gen1", + "macos.m1.large.gen1" + ], "markdownDescription": "Amount of CPU and RAM allocated to each container in a job. Note: A performance plan is required to access this feature." }, "docker": { @@ -1607,6 +1929,7 @@ "properties": { "branches": { "type": "object", + "markdownDescription": "A map defining rules for execution on specific branches", "properties": { "only": { "oneOf": [ @@ -1619,7 +1942,8 @@ "type": "string" } } - ] + ], + "markdownDescription": "Either a single branch specifier, or a list of branch specifiers" }, "ignore": { "oneOf": [ @@ -1632,7 +1956,8 @@ "type": "string" } } - ] + ], + "markdownDescription": "Either a single branch specifier, or a list of branch specifiers" } }, "additionalProperties": false @@ -1673,6 +1998,7 @@ "properties": { "schedule": { "type": "object", + "markdownDescription": "A workflow may have a schedule indicating it runs at a certain time, for example a nightly build that runs every day at 12am UTC:", "properties": { "cron": { "type": "string", @@ -1680,9 +2006,11 @@ }, "filters": { "type": "object", + "markdownDescription": "A map defining rules for execution on specific branches", "properties": { "branches": { "type": "object", + "markdownDescription": "A map defining rules for execution on specific branches", "properties": { "only": { "oneOf": [ @@ -1713,15 +2041,12 @@ "markdownDescription": "Either a single branch specifier, or a list of branch specifiers" } }, - "additionalProperties": false, - "markdownDescription": "A map defining rules for execution on specific branches" + "additionalProperties": false } }, - "additionalProperties": false, - "markdownDescription": "A map defining rules for execution on specific branches" + "additionalProperties": false } - }, - "markdownDescription": "A workflow may have a schedule indicating it runs at a certain time, for example a nightly build that runs every day at 12am UTC:" + } } }, "additionalProperties": false @@ -1805,6 +2130,7 @@ "properties": { "branches": { "type": "object", + "markdownDescription": "A map defining rules for execution on specific branches", "properties": { "only": { "oneOf": [ @@ -1817,7 +2143,8 @@ "type": "string" } } - ] + ], + "markdownDescription": "Either a single branch specifier, or a list of branch specifiers" }, "ignore": { "oneOf": [ @@ -1830,13 +2157,15 @@ "type": "string" } } - ] + ], + "markdownDescription": "Either a single branch specifier, or a list of branch specifiers" } }, "additionalProperties": false }, "tags": { "type": "object", + "markdownDescription": "A map defining rules for execution on specific tags", "properties": { "only": { "oneOf": [ @@ -1850,7 +2179,7 @@ } } ], - "markdownDescription": "Either a single branch specifier, or a list of branch specifiers" + "markdownDescription": "Either a single tag specifier, or a list of tag specifiers" }, "ignore": { "oneOf": [ @@ -1864,11 +2193,10 @@ } } ], - "markdownDescription": "Either a single branch specifier, or a list of branch specifiers" + "markdownDescription": "Either a single tag specifier, or a list of tag specifiers" } }, - "additionalProperties": false, - "markdownDescription": "A map defining rules for execution on specific branches" + "additionalProperties": false } }, "additionalProperties": false @@ -1987,10 +2315,13 @@ "additionalProperties": { "oneOf": [ { - "type": "string" + "type": "string", + "pattern": "^[a-z][a-z0-9_-]+/[a-z][a-z0-9_-]+@(dev:[\\.a-z0-9_-]+|\\d+|\\d+\\.\\d+|\\d+\\.\\d+\\.\\d+|volatile)$", + "markdownDescription": "https://circleci.com/docs/creating-orbs#semantic-versioning-in-orbs\n\nAn orb to depend on and its semver range, or volatile for the most recent release." }, { "type": "object", + "markdownDescription": "https://circleci.com/docs/creating-orbs#creating-inline-orbs\n\nInline orbs can be handy during development of an orb or as a convenience for name-spacing jobs and commands in lengthy configurations, particularly if you later intend to share the orb with others.", "properties": { "jobs": { "markdownDescription": "Jobs are collections of steps. All of the steps in the job are executed in a single unit, either within a fresh container or VM.", @@ -2005,6 +2336,7 @@ }, "commands": { "type": "object", + "markdownDescription": "https://circleci.com/docs/configuration-reference#commands-requires-version-21\n\nA command definition defines a sequence of steps as a map to be executed in a job, enabling you to reuse a single command definition across multiple jobs.", "propertyNames": { "pattern": "^[a-z][a-z\\d_-]*$" }, @@ -2014,7 +2346,8 @@ "type": "object", "properties": { "description": { - "type": "string" + "type": "string", + "markdownDescription": "A string that describes the purpose of the command." }, "parameters": { "markdownDescription": "https://circleci.com/docs/reusing-config#using-the-parameters-declaration\n\nA map of parameter keys.", @@ -2075,7 +2408,8 @@ "items": { "$ref": "#/definitions/step" }, - "minItems": 1 + "minItems": 1, + "markdownDescription": "A sequence of steps run inside the calling job of the command." } }, "required": [ @@ -2092,6 +2426,7 @@ }, "executors": { "type": "object", + "markdownDescription": "Executors define the environment in which the steps of a job will be run, allowing you to reuse a single executor definition across multiple jobs.", "propertyNames": { "pattern": "^[a-z][a-z\\d_-]*$" }, From 9ff532e69be79093fbc23180f882c91187c5e812 Mon Sep 17 00:00:00 2001 From: Parker Rowe Date: Thu, 16 Oct 2025 14:51:31 -0400 Subject: [PATCH 10/13] delete publicschema.json --- .circleci/config.yml | 1 - editors/vscode/.vscodeignore | 1 - publicschema.json | 1387 ---------------------------------- 3 files changed, 1389 deletions(-) delete mode 100644 publicschema.json diff --git a/.circleci/config.yml b/.circleci/config.yml index ccb25fd2..e72d949f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -329,7 +329,6 @@ jobs: at: ~/ - install-vscode-extensions-deps - run: cp schema.json editors/vscode - - run: cp publicschema.json editors/vscode - run: cp -R bin editors/vscode/bin - run: name: Build VSIX diff --git a/editors/vscode/.vscodeignore b/editors/vscode/.vscodeignore index aad8d3c0..182f01dd 100644 --- a/editors/vscode/.vscodeignore +++ b/editors/vscode/.vscodeignore @@ -6,4 +6,3 @@ !package.json !package-lock.json !schema.json -!publicschema.json diff --git a/publicschema.json b/publicschema.json deleted file mode 100644 index 5d5af103..00000000 --- a/publicschema.json +++ /dev/null @@ -1,1387 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "definitions": { - "logical": { - "description": "https://circleci.com/docs/configuration-reference#logic-statements \n\nA logical statement to be used in dynamic configuration", - "oneOf": [ - { - "type": [ - "string", - "boolean", - "integer", - "number" - ] - }, - { - "type": "object", - "additionalProperties": false, - "minProperties": 1, - "maxProperties": 1, - "properties": { - "and": { - "description": "https://circleci.com/docs/configuration-reference#logic-statements \n\nLogical and: true when all statements in the list are true", - "type": "array", - "items": { - "$ref": "#/definitions/logical" - } - }, - "or": { - "description": "https://circleci.com/docs/configuration-reference#logic-statements \n\nLogical or: true when at least one statements in the list is true", - "type": "array", - "items": { - "$ref": "#/definitions/logical" - } - }, - "not": { - "description": "https://circleci.com/docs/configuration-reference#logic-statements \n\nLogical not: true when statement is false", - "$ref": "#/definitions/logical" - }, - "equal": { - "description": "https://circleci.com/docs/configuration-reference#logic-statements \n\nTrue when all elements in the list are equal", - "type": "array" - }, - "matches": { - "description": "https://circleci.com/docs/configuration-reference#logic-statements \n\nTrue when value matches the pattern", - "type": "object", - "additionalProperties": false, - "properties": { - "pattern": { - "type": "string" - }, - "value": { - "type": "string" - } - } - } - } - } - ] - }, - "filter": { - "description": "A map defining rules for execution on specific branches", - "type": "object", - "additionalProperties": false, - "properties": { - "only": { - "description": "Either a single branch specifier, or a list of branch specifiers", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "ignore": { - "description": "Either a single branch specifier, or a list of branch specifiers", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - } - } - }, - "orbs": { - "description": "https://circleci.com/docs/configuration-reference#orbs-requires-version-21\n\nOrbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects.", - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "description": "https://circleci.com/docs/creating-orbs#semantic-versioning-in-orbs\n\nAn orb to depend on and its semver range, or volatile for the most recent release.", - "type": "string", - "pattern": "^[a-z][a-z0-9_-]+/[a-z][a-z0-9_-]+@(dev:[\\.a-z0-9_-]+|\\d+|\\d+\\.\\d+|\\d+\\.\\d+\\.\\d+|volatile)$" - }, - { - "description": "https://circleci.com/docs/creating-orbs#creating-inline-orbs\n\nInline orbs can be handy during development of an orb or as a convenience for name-spacing jobs and commands in lengthy configurations, particularly if you later intend to share the orb with others.", - "type": "object", - "properties": { - "orbs": { - "$ref": "#/definitions/orbs" - }, - "commands": { - "$ref": "#/definitions/commands" - }, - "executors": { - "$ref": "#/definitions/executors" - }, - "jobs": { - "$ref": "#/definitions/jobs" - } - } - } - ] - } - }, - "commands": { - "description": "https://circleci.com/docs/configuration-reference#commands-requires-version-21\n\nA command definition defines a sequence of steps as a map to be executed in a job, enabling you to reuse a single command definition across multiple jobs.", - "type": "object", - "additionalProperties": { - "description": "https://circleci.com/docs/configuration-reference#commands-requires-version-21\n\nDefinition of a custom command.", - "type": "object", - "required": [ - "steps" - ], - "properties": { - "steps": { - "description": "A sequence of steps run inside the calling job of the command.", - "type": "array", - "items": { - "$ref": "#/definitions/step" - } - }, - "parameters": { - "description": "https://circleci.com/docs/reusing-config#using-the-parameters-declaration\n\nA map of parameter keys.", - "type": "object", - "patternProperties": { - "^[a-z][a-z0-9_-]+$": { - "oneOf": [ - { - "description": "https://circleci.com/docs/reusing-config#string\n\nA string parameter.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "enum": [ - "string" - ] - }, - "description": { - "type": "string" - }, - "default": { - "type": "string" - } - } - }, - { - "description": "https://circleci.com/docs/reusing-config#boolean\n\nA boolean parameter.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "enum": [ - "boolean" - ] - }, - "description": { - "type": "string" - }, - "default": { - "type": "boolean" - } - } - }, - { - "description": "https://circleci.com/docs/reusing-config#integer\n\nAn integer parameter.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "enum": [ - "integer" - ] - }, - "description": { - "type": "string" - }, - "default": { - "type": "integer" - } - } - }, - { - "description": "https://circleci.com/docs/reusing-config#enum\n\nThe `enum` parameter may be a list of any values. Use the `enum` parameter type when you want to enforce that the value must be one from a specific set of string values.", - "type": "object", - "required": [ - "type", - "enum" - ], - "properties": { - "type": { - "enum": [ - "enum" - ] - }, - "enum": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "default": { - "type": "string" - } - } - }, - { - "description": "https://circleci.com/docs/reusing-config#executor\n\nUse an `executor` parameter type to allow the invoker of a job to decide what executor it will run on.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "enum": [ - "executor" - ] - }, - "description": { - "type": "string" - }, - "default": { - "type": "string" - } - } - }, - { - "description": "https://circleci.com/docs/reusing-config#steps\n\nSteps are used when you have a job or command that needs to mix predefined and user-defined steps. When passed in to a command or job invocation, the steps passed as parameters are always defined as a sequence, even if only one step is provided.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "enum": [ - "steps" - ] - }, - "description": { - "type": "string" - }, - "default": { - "type": "array", - "items": { - "$ref": "#/definitions/step" - } - } - } - }, - { - "description": "https://circleci.com/docs/reusing-config#environment-variable-name\n\nThe environment variable name parameter is a string that must match a POSIX_NAME regexp (e.g. no spaces or special characters) and is a more meaningful parameter type that enables additional checks to be performed. ", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "enum": [ - "env_var_name" - ] - }, - "description": { - "type": "string" - }, - "default": { - "type": "string", - "pattern": "^[a-zA-Z][a-zA-Z0-9_-]+$" - } - } - } - ] - } - } - }, - "description": { - "description": "A string that describes the purpose of the command.", - "type": "string" - } - } - } - }, - "dockerExecutor": { - "description": "Options for the [docker executor](https://circleci.com/docs/configuration-reference#docker)", - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "image" - ], - "properties": { - "image": { - "description": "The name of a custom docker image to use", - "type": "string" - }, - "name": { - "description": "The name the container is reachable by. By default, container services are accessible through `localhost`", - "type": "string" - }, - "entrypoint": { - "description": "The command used as executable when launching the container", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "command": { - "description": "The command used as pid 1 (or args for entrypoint) when launching the container", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "user": { - "description": "Which user to run the command as", - "type": "string" - }, - "environment": { - "description": "A map of environment variable names and values", - "type": "object", - "additionalProperties": { - "type": [ - "string", - "number", - "boolean" - ] - } - }, - "auth": { - "description": "Authentication for registries using standard `docker login` credentials", - "type": "object", - "additionalProperties": false, - "properties": { - "username": { - "type": "string" - }, - "password": { - "type": "string" - } - } - }, - "aws_auth": { - "description": "Authentication for AWS EC2 Container Registry (ECR). You can use the access/secret keys or OIDC.", - "type": "object", - "additionalProperties": false, - "properties": { - "aws_access_key_id": { - "type": "string" - }, - "aws_secret_access_key": { - "type": "string" - }, - "oidc_role_arn": { - "type": "string" - } - } - } - } - } - }, - "machineExecutor": { - "description": "Options for the [machine executor](https://circleci.com/docs/configuration-reference#machine)", - "type": "object", - "required": [ - "image" - ], - "additionalProperties": false, - "properties": { - "image": { - "description": "The VM image to use. View [available images](https://circleci.com/docs/configuration-reference#available-machine-images). **Note:** This key is **not** supported on the installable CircleCI. For information about customizing machine executor images on CircleCI installed on your servers, see our [VM Service documentation](https://circleci.com/docs/vm-service).", - "type": "string", - "default": "ubuntu-2004:current" - }, - "docker_layer_caching": { - "description": "Set to `true` to enable [Docker Layer Caching](https://circleci.com/docs/docker-layer-caching). Note: If you haven't already, you must open a support ticket to have a CircleCI Sales representative contact you about enabling this feature on your account for an additional fee.", - "type": "boolean", - "default": "true" - } - } - }, - "macosExecutor": { - "description": "Options for the [macOS executor](https://circleci.com/docs/configuration-reference#macos)", - "type": "object", - "additionalProperties": false, - "required": [ - "xcode" - ], - "properties": { - "xcode": { - "description": "The version of Xcode that is installed on the virtual machine, see the [Supported Xcode Versions section of the Testing iOS](https://circleci.com/docs/testing-ios#supported-xcode-versions) document for the complete list.", - "oneOf": [ - { - "type": "number" - }, - { - "type": "string", - "minimum": 0 - } - ] - } - } - }, - "executorChoice": { - "oneOf": [ - { - "type": "object", - "required": [ - "docker" - ], - "properties": { - "docker": { - "$ref": "#/definitions/dockerExecutor" - } - } - }, - { - "type": "object", - "required": [ - "machine" - ], - "properties": { - "machine": { - "$ref": "#/definitions/machineExecutor" - } - } - }, - { - "type": "object", - "required": [ - "machine" - ], - "properties": { - "machine": { - "description": "Use the default machine executor image", - "type": "boolean" - } - } - }, - { - "type": "object", - "required": [ - "macos" - ], - "properties": { - "macos": { - "$ref": "#/definitions/macosExecutor" - } - } - } - ] - }, - "executors": { - "description": "Executors define the environment in which the steps of a job will be run, allowing you to reuse a single executor definition across multiple jobs.", - "type": "object", - "additionalProperties": { - "type": "object", - "$ref": "#/definitions/executorChoice", - "properties": { - "resource_class": { - "description": "Amount of CPU and RAM allocated to each container in a job. Note: A performance plan is required to access this feature.", - "type": "string", - "default": "medium", - "enum": [ - "small", - "medium+", - "xlarge", - "2xlarge", - "2xlarge+", - "arm.medium", - "arm.large", - "arm.xlarge", - "arm.2xlarge", - "gpu.nvidia.small", - "gpu.nvidia.medium", - "windows.gpu.nvidia.medium", - "macos.m1.medium.gen1", - "macos.m1.large.gen1" - ] - }, - "shell": { - "description": "Shell to use for execution command in all steps. Can be overridden by shell in each step (default: See [Default Shell Options](https://circleci.com/docs/configuration-reference#default-shell-options)", - "type": "string" - }, - "working_directory": { - "description": "In which directory to run the steps.", - "type": "string" - }, - "environment": { - "description": "A map of environment variable names and values.", - "type": "object", - "additionalProperties": { - "type": [ - "string", - "number" - ] - } - } - } - } - }, - "builtinSteps": { - "documentation": { - "run": { - "description": "https://circleci.com/docs/configuration-reference#run\n\nUsed for invoking all command-line programs, taking either a map of configuration values, or, when called in its short-form, a string that will be used as both the `command` and `name`. Run commands are executed using non-login shells by default, so you must explicitly source any dotfiles as part of the command." - }, - "checkout": { - "description": "https://circleci.com/docs/configuration-reference#checkout\n\nSpecial step used to check out source code to the configured `path` (defaults to the `working_directory`). The reason this is a special step is because it is more of a helper function designed to make checking out code easy for you. If you require doing git over HTTPS you should not use this step as it configures git to checkout over ssh." - }, - "setup_remote_docker": { - "description": "https://circleci.com/docs/configuration-reference#setup_remote_docker\n\nCreates a remote Docker environment configured to execute Docker commands." - }, - "save_cache": { - "description": "https://circleci.com/docs/configuration-reference#save_cache\n\nGenerates and stores a cache of a file or directory of files such as dependencies or source code in our object storage. Later jobs can restore this cache using the `restore_cache` step." - }, - "restore_cache": { - "description": "https://circleci.com/docs/configuration-reference#restore_cache\n\nRestores a previously saved cache based on a `key`. Cache needs to have been saved first for this key using the `save_cache` step." - }, - "deploy": { - "description": "https://circleci.com/docs/configuration-reference#deploy\n\nSpecial step for deploying artifacts. `deploy` uses the same configuration map and semantics as run step. Jobs may have more than one deploy step. In general deploy step behaves just like run with two exceptions:\n* In a job with parallelism, the deploy step will only be executed by node #0 and only if all nodes succeed. Nodes other than #0 will skip this step.\n* In a job that runs with SSH, the deploy step will not execute" - }, - "store_artifacts": { - "description": "https://circleci.com/docs/configuration-reference#store_artifacts\n\nStep to store artifacts (for example logs, binaries, etc) to be available in the web app or through the API." - }, - "store_test_results": { - "description": "https://circleci.com/docs/configuration-reference#storetestresults\n\nSpecial step used to upload test results so they display in builds' Test Summary section and can be used for timing analysis. To also see test result as build artifacts, please use the `store_artifacts` step." - }, - "persist_to_workspace": { - "description": "https://circleci.com/docs/configuration-reference#persist_to_workspace\n\nSpecial step used to persist a temporary file to be used by another job in the workflow" - }, - "attach_workspace": { - "description": "https://circleci.com/docs/configuration-reference#attach_workspace\n\nSpecial step used to attach the workflow's workspace to the current container. The full contents of the workspace are downloaded and copied into the directory the workspace is being attached at." - }, - "add_ssh_keys": { - "description": "https://circleci.com/docs/configuration-reference#add_ssh_keys\n\nSpecial step that adds SSH keys from a project's settings to a container. Also configures SSH to use these keys." - }, - "when": { - "description": "https://circleci.com/docs/configuration-reference#the-when-step-requires-version-21 \n\nConditional step to run on custom conditions (determined at config-compile time) that are checked before a workflow runs" - }, - "unless": { - "description": "https://circleci.com/docs/configuration-reference#the-when-step-requires-version-21 \n\nConditional step to run when custom conditions aren't met (determined at config-compile time) that are checked before a workflow runs" - } - }, - "configuration": { - "run": { - "allOf": [ - { - "$ref": "#/definitions/builtinSteps/documentation/run" - } - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "object", - "additionalProperties": false, - "required": [ - "command" - ], - "properties": { - "command": { - "description": "Command to run via the shell", - "type": "string" - }, - "name": { - "description": "Title of the step to be shown in the CircleCI UI (default: full `command`)", - "type": "string" - }, - "shell": { - "description": "Shell to use for execution command", - "type": "string" - }, - "environment": { - "description": "Additional environmental variables, locally scoped to command", - "type": "object", - "additionalProperties": { - "type": [ - "string", - "number" - ] - } - }, - "background": { - "description": "Whether or not this step should run in the background (default: false)", - "default": false, - "type": "boolean" - }, - "working_directory": { - "description": "In which directory to run this step (default: `working_directory` of the job", - "type": "string" - }, - "no_output_timeout": { - "description": "Elapsed time the command can run without output. The string is a decimal with unit suffix, such as \"20m\", \"1.25h\", \"5s\" (default: 10 minutes)", - "type": "string", - "pattern": "\\d+(\\.\\d+)?[mhs]", - "default": "10m" - }, - "when": { - "description": "Specify when to enable or disable the step. Takes the following values: `always`, `on_success`, `on_fail` (default: `on_success`)", - "enum": [ - "always", - "on_success", - "on_fail" - ] - }, - "max_auto_reruns": { - "description": "Maximum number of automatic reruns for this step", - "type": "integer", - "minimum": 1, - "maximum": 5 - }, - "auto_rerun_delay": { - "description": "Delay before automatic rerun of this step", - "type": "string", - "pattern": "^(10|[1-9])m|([1-9][0-9]*)s$" - } - }, - "if": { - "properties": { - "auto_rerun_delay": true - }, - "required": [ - "auto_rerun_delay" - ] - }, - "then": { - "required": [ - "max_auto_reruns" - ] - } - } - ] - }, - "checkout": { - "allOf": [ - { - "$ref": "#/definitions/builtinSteps/documentation/checkout" - } - ], - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "description": "Title of the step to be shown in the CircleCI UI", - "type": "string" - }, - "path": { - "description": "Checkout directory (default: job's `working_directory`)", - "type": "string" - }, - "method": { - "description": "The checkout method to be used ('blobless' or 'full', default 'full')", - "type": "string" - } - }, - "setup_remote_docker": { - "allOf": [ - { - "$ref": "#/definitions/builtinSteps/documentation/setup_remote_docker" - } - ], - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "description": "Title of the step to be shown in the CircleCI UI", - "type": "string" - }, - "docker_layer_caching": { - "description": "When `docker_layer_caching` is set to `true`, CircleCI will try to reuse Docker Images (layers) built during a previous job or workflow (Paid feature)", - "type": "boolean", - "default": false - }, - "version": { - "description": "If your build requires a specific docker image, you can set it as an image attribute", - "anyOf": [ - { - "type": "string", - "enum": [ - "20.10.24", - "20.10.23", - "20.10.18", - "20.10.17", - "20.10.14", - "20.10.12", - "20.10.11", - "20.10.7", - "20.10.6", - "20.10.2", - "19.03.13" - ] - }, - { - "type": "string" - } - ] - } - } - }, - "save_cache": { - "allOf": [ - { - "$ref": "#/definitions/builtinSteps/documentation/save_cache" - } - ], - "type": "object", - "additionalProperties": false, - "required": [ - "paths", - "key" - ], - "properties": { - "paths": { - "description": "List of directories which should be added to the cache", - "type": "array", - "items": { - "type": "string" - } - }, - "key": { - "description": "Unique identifier for this cache", - "type": "string" - }, - "name": { - "type": "string", - "description": "Title of the step to be shown in the CircleCI UI (default: 'Saving Cache')" - }, - "when": { - "description": "Specify when to enable or disable the step. Takes the following values: `always`, `on_success`, `on_fail` (default: `on_success`)", - "enum": [ - "always", - "on_success", - "on_fail" - ] - } - } - }, - "restore_cache": { - "allOf": [ - { - "$ref": "#/definitions/builtinSteps/documentation/restore_cache" - } - ], - "oneOf": [ - { - "type": "object", - "additionalProperties": false, - "required": [ - "key" - ], - "properties": { - "key": { - "type": "string", - "description": "Single cache key to restore" - }, - "name": { - "type": "string", - "description": "Title of the step to be shown in the CircleCI UI (default: 'Restoring Cache')" - } - } - }, - { - "type": "object", - "additionalProperties": false, - "required": [ - "keys" - ], - "properties": { - "name": { - "type": "string", - "description": "Title of the step to be shown in the CircleCI UI (default: 'Restoring Cache')" - }, - "keys": { - "description": "List of cache keys to lookup for a cache to restore. Only first existing key will be restored.", - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - }, - "deploy": { - "allOf": [ - { - "$ref": "#/definitions/builtinSteps/documentation/deploy" - }, - { - "$ref": "#/definitions/builtinSteps/configuration/run" - } - ] - }, - "store_artifacts": { - "allOf": [ - { - "$ref": "#/definitions/builtinSteps/documentation/store_artifacts" - } - ], - "type": "object", - "additionalProperties": false, - "required": [ - "path" - ], - "properties": { - "name": { - "description": "Title of the step to be shown in the CircleCI UI", - "type": "string" - }, - "path": { - "description": "Directory in the primary container to save as job artifacts", - "type": "string" - }, - "destination": { - "description": "Prefix added to the artifact paths in the artifacts API (default: the directory of the file specified in `path`)", - "type": "string" - } - } - }, - "store_test_results": { - "allOf": [ - { - "$ref": "#/definitions/builtinSteps/documentation/store_test_results" - } - ], - "type": "object", - "additionalProperties": false, - "required": [ - "path" - ], - "properties": { - "name": { - "description": "Title of the step to be shown in the CircleCI UI", - "type": "string" - }, - "path": { - "description": "Path (absolute, or relative to your `working_directory`) to directory containing subdirectories of JUnit XML or Cucumber JSON test metadata files", - "type": "string" - } - } - }, - "persist_to_workspace": { - "allOf": [ - { - "$ref": "#/definitions/builtinSteps/documentation/persist_to_workspace" - } - ], - "type": "object", - "additionalProperties": false, - "required": [ - "root", - "paths" - ], - "properties": { - "name": { - "description": "Title of the step to be shown in the CircleCI UI", - "type": "string" - }, - "root": { - "description": "Either an absolute path or a path relative to `working_directory`", - "type": "string" - }, - "paths": { - "description": "Glob identifying file(s), or a non-glob path to a directory to add to the shared workspace. Interpreted as relative to the workspace root. Must not be the workspace root itself.", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "attach_workspace": { - "allOf": [ - { - "$ref": "#/definitions/builtinSteps/documentation/attach_workspace" - } - ], - "type": "object", - "additionalProperties": false, - "required": [ - "at" - ], - "properties": { - "name": { - "description": "Title of the step to be shown in the CircleCI UI", - "type": "string" - }, - "at": { - "description": "Directory to attach the workspace to", - "type": "string" - } - } - }, - "add_ssh_keys": { - "allOf": [ - { - "$ref": "#/definitions/builtinSteps/documentation/add_ssh_keys" - } - ], - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "description": "Title of the step to be shown in the CircleCI UI", - "type": "string" - }, - "fingerprints": { - "description": "Directory to attach the workspace to", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "when": { - "allOf": [ - { - "$ref": "#/definitions/builtinSteps/documentation/when" - } - ], - "type": "object", - "additionalProperties": false, - "properties": { - "condition": { - "$ref": "#/definitions/logical" - }, - "steps": { - "description": "A list of steps to be performed", - "type": "array", - "items": { - "$ref": "#/definitions/step" - } - } - }, - "required": [ - "condition", - "steps" - ] - }, - "unless": { - "allOf": [ - { - "$ref": "#/definitions/builtinSteps/documentation/unless" - } - ], - "type": "object", - "additionalProperties": false, - "properties": { - "condition": { - "$ref": "#/definitions/logical" - }, - "steps": { - "description": "A list of steps to be performed", - "type": "array", - "items": { - "$ref": "#/definitions/step" - } - } - }, - "required": [ - "condition", - "steps" - ] - } - } - }, - "step": { - "anyOf": [ - { - "$ref": "#/definitions/builtinSteps/documentation/checkout", - "enum": [ - "checkout" - ] - }, - { - "$ref": "#/definitions/builtinSteps/documentation/setup_remote_docker", - "enum": [ - "setup_remote_docker" - ] - }, - { - "$ref": "#/definitions/builtinSteps/documentation/add_ssh_keys", - "enum": [ - "add_ssh_keys" - ] - }, - { - "description": "https://circleci.com/docs/reusing-config#invoking-reusable-commands\n\nA custom command defined via the top level commands key", - "type": "string", - "pattern": "^[a-z][a-z0-9_-]+$" - }, - { - "description": "https://circleci.com/docs/using-orbs#commands\n\nA custom command defined via an orb.", - "type": "string", - "pattern": "^[a-z][a-z0-9_-]+/[a-z][a-z0-9_-]+$" - }, - { - "type": "object", - "minProperties": 1, - "maxProperties": 1, - "properties": { - "run": { - "$ref": "#/definitions/builtinSteps/configuration/run" - }, - "checkout": { - "$ref": "#/definitions/builtinSteps/configuration/checkout" - }, - "setup_remote_docker": { - "$ref": "#/definitions/builtinSteps/configuration/setup_remote_docker" - }, - "save_cache": { - "$ref": "#/definitions/builtinSteps/configuration/save_cache" - }, - "restore_cache": { - "$ref": "#/definitions/builtinSteps/configuration/restore_cache" - }, - "deploy": { - "$ref": "#/definitions/builtinSteps/configuration/deploy" - }, - "store_artifacts": { - "$ref": "#/definitions/builtinSteps/configuration/store_artifacts" - }, - "store_test_results": { - "$ref": "#/definitions/builtinSteps/configuration/store_test_results" - }, - "persist_to_workspace": { - "$ref": "#/definitions/builtinSteps/configuration/persist_to_workspace" - }, - "attach_workspace": { - "$ref": "#/definitions/builtinSteps/configuration/attach_workspace" - }, - "add_ssh_keys": { - "$ref": "#/definitions/builtinSteps/configuration/add_ssh_keys" - }, - "when": { - "$ref": "#/definitions/builtinSteps/configuration/when" - }, - "unless": { - "$ref": "#/definitions/builtinSteps/configuration/unless" - } - }, - "patternProperties": { - "^[a-z][a-z0-9_-]+$": { - "description": "https://circleci.com/docs/reusing-config#invoking-reusable-commands\n\nA custom command defined via the top level commands key" - }, - "^[a-z][a-z0-9_-]+/[a-z][a-z0-9_-]+$": { - "description": "https://circleci.com/docs/using-orbs#commands\n\nA custom command defined via an orb." - } - } - } - ] - }, - "jobRef": { - "description": "Run a job as part of this workflow", - "type": "object", - "additionalProperties": true, - "properties": { - "requires": { - "description": "Jobs are run in parallel by default, so you must explicitly require any dependencies by their job name.", - "type": "array", - "items": { - "type": "string" - } - }, - "name": { - "description": "The name key can be used to ensure build numbers are not appended when invoking the same job multiple times (e.g., sayhello-1, sayhello-2). The name assigned needs to be unique, otherwise numbers will still be appended to the job name", - "type": "string" - }, - "context": { - "description": "Either a single context name, or a list of contexts. The default name is `org-global`", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ], - "default": "org-global" - }, - "type": { - "description": "A job defined under the `workflows:` section may specify a type but it can only be `approval`.\n`approval` jobs must be manually approved before downstream jobs may proceed.\nFor [other job types](https://circleci.com/docs/reference/configuration-reference/#job-type), they must be specified under the `jobs:` section. Please see the [`type` under `workflows:` docs](https://circleci.com/docs/reference/configuration-reference/#type) for more information.", - "enum": [ - "approval" - ] - }, - "filters": { - "description": "A map defining rules for execution on specific branches", - "type": "object", - "additionalProperties": false, - "properties": { - "branches": { - "$ref": "#/definitions/filter" - }, - "tags": { - "$ref": "#/definitions/filter" - } - } - }, - "matrix": { - "description": "https://circleci.com/docs/configuration-reference#matrix-requires-version-21\n\nThe matrix stanza allows you to run a parameterized job multiple times with different arguments.", - "type": "object", - "additionalProperties": false, - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "description": "A map of parameter names to every value the job should be called with", - "type": "object", - "additionalProperties": { - "type": "array" - } - }, - "exclude": { - "description": "A list of argument maps that should be excluded from the matrix", - "type": "array", - "items": { - "type": "object" - } - }, - "alias": { - "description": "An alias for the matrix, usable from another job's requires stanza. Defaults to the name of the job being executed", - "type": "string" - } - } - } - } - }, - "jobs": { - "description": "Jobs are collections of steps. All of the steps in the job are executed in a single unit, either within a fresh container or VM.", - "type": "object", - "additionalProperties": { - "type": "object", - "oneOf": [ - { - "$ref": "#/definitions/executorChoice" - }, - { - "type": "object", - "required": [ - "executor" - ], - "properties": { - "executor": { - "description": "The name of the executor to use (defined via the top level executors map).", - "type": "string" - } - } - }, - { - "type": "object", - "required": [ - "executor" - ], - "properties": { - "executor": { - "description": "Executor stanza to use for the job", - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "description": "The name of the executor to use (defined via the top level executors map).", - "type": "string" - } - } - } - } - } - ], - "required": [ - "steps" - ], - "properties": { - "type": { - "description": "[Job Types](https://circleci.com/docs/reference/configuration-reference/#job-type)\nThe job type. If not specified, defaults to `build`.", - "type": "string" - }, - "shell": { - "description": "Shell to use for execution command in all steps. Can be overridden by shell in each step", - "type": "string" - }, - "steps": { - "description": "A list of steps to be performed", - "type": "array", - "items": { - "$ref": "#/definitions/step" - } - }, - "working_directory": { - "description": "In which directory to run the steps. (default: `~/project`. `project` is a literal string, not the name of the project.) You can also refer the directory with `$CIRCLE_WORKING_DIRECTORY` environment variable.", - "type": "string", - "default": "~/project" - }, - "parallelism": { - "description": "Number of parallel instances of this job to run (default: 1)", - "default": 1, - "oneOf": [ - { - "type": "integer" - }, - { - "type": "string", - "pattern": "^<<.+\\..+>>$" - } - ] - }, - "environment": { - "description": "A map of environment variable names and variables (NOTE: these will override any environment variables you set in the CircleCI web interface).", - "type": "object", - "additionalProperties": { - "type": [ - "string", - "number" - ] - } - }, - "branches": { - "description": "A map defining rules for whitelisting/blacklisting execution of specific branches for a single job that is **not** in a workflow (default: all whitelisted). See Workflows for configuring branch execution for jobs in a workflow.", - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - } - }, - "id": "https://json.schemastore.org/circleciconfig.json", - "properties": { - "version": { - "description": "The version field is intended to be used in order to issue warnings for deprecation or breaking changes.", - "default": 2.1, - "enum": [ - 2, - 2.1 - ] - }, - "orbs": { - "$ref": "#/definitions/orbs" - }, - "commands": { - "$ref": "#/definitions/commands" - }, - "executors": { - "$ref": "#/definitions/executors" - }, - "jobs": { - "$ref": "#/definitions/jobs" - }, - "workflows": { - "description": "Used for orchestrating all jobs. Each workflow consists of the workflow name as a key and a map as a value", - "type": "object", - "properties": { - "version": { - "description": "The Workflows `version` field is used to issue warnings for deprecation or breaking changes during v2 Beta. It is deprecated as of CircleCI v2.1", - "enum": [ - 2 - ] - } - }, - "additionalProperties": { - "type": "object", - "additionalProperties": false, - "properties": { - "triggers": { - "description": "Specifies which triggers will cause this workflow to be executed. Default behavior is to trigger the workflow when pushing to a branch.", - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "schedule": { - "description": "A workflow may have a schedule indicating it runs at a certain time, for example a nightly build that runs every day at 12am UTC:", - "type": "object", - "properties": { - "cron": { - "description": "See the [crontab man page](http://pubs.opengroup.org/onlinepubs/7908799/xcu/crontab.html)", - "type": "string" - }, - "filters": { - "description": "A map defining rules for execution on specific branches", - "type": "object", - "additionalProperties": false, - "properties": { - "branches": { - "$ref": "#/definitions/filter" - } - } - } - } - } - } - } - }, - "max_auto_reruns": { - "description": "The maximum number of times a workflow will be automatically rerun if it fails", - "type": "integer", - "minimum": 1, - "maximum": 5 - }, - "jobs": { - "type": "array", - "items": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "object", - "additionalProperties": { - "type": "object", - "$ref": "#/definitions/jobRef" - } - } - ] - } - }, - "when": { - "description": "Specify when to run the workflow.", - "$ref": "#/definitions/logical" - }, - "unless": { - "description": "Specify when *not* to run the workflow.", - "$ref": "#/definitions/logical" - } - } - } - } - }, - "required": [ - "version" - ], - "title": "JSON schema for CircleCI configuration files", - "type": "object" - } -} \ No newline at end of file From c0cab2fdbdbdd9033e101a075e854a95c861e388 Mon Sep 17 00:00:00 2001 From: Parker Rowe Date: Fri, 17 Oct 2025 11:58:33 -0400 Subject: [PATCH 11/13] allow self-hosted resource_class --- schema.json | 51 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/schema.json b/schema.json index 231fdd4e..10ca959f 100644 --- a/schema.json +++ b/schema.json @@ -1578,27 +1578,36 @@ "additionalProperties": false }, "resource_class": { - "type": "string", - "default": "medium", - "enum": [ - "small", - "medium", - "medium+", - "large", - "xlarge", - "2xlarge", - "2xlarge+", - "arm.medium", - "arm.large", - "arm.xlarge", - "arm.2xlarge", - "gpu.nvidia.small", - "gpu.nvidia.medium", - "windows.gpu.nvidia.medium", - "macos.m1.medium.gen1", - "macos.m1.large.gen1" + "oneOf": [ + { + "type": "string", + "default": "medium", + "enum": [ + "small", + "medium", + "medium+", + "large", + "xlarge", + "2xlarge", + "2xlarge+", + "arm.medium", + "arm.large", + "arm.xlarge", + "arm.2xlarge", + "gpu.nvidia.small", + "gpu.nvidia.medium", + "windows.gpu.nvidia.medium", + "macos.m1.medium.gen1", + "macos.m1.large.gen1" + ] + }, + { + "title": "Self-hosted runner", + "type": "string", + "pattern": "^[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+$" + } ], - "markdownDescription": "Amount of CPU and RAM allocated to each container in a job. Note: A performance plan is required to access this feature." + "markdownDescription": "https://circleci.com/docs/reference/configuration-reference/#resourceclass\n\nResource class for the job. Can be either a predefined resource class (e.g., `medium`, `large`) or a self-hosted runner in the format `/`." }, "docker": { "type": "array", @@ -2965,4 +2974,4 @@ "required": [ "version" ] -} \ No newline at end of file +} From caf076757321c458b52917890a4e54c5c3a1c56f Mon Sep 17 00:00:00 2001 From: Parker Rowe Date: Fri, 17 Oct 2025 14:27:58 -0400 Subject: [PATCH 12/13] allow parameter interpolation as semver for orbs + improve description of orbs --- schema.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/schema.json b/schema.json index 10ca959f..3b541305 100644 --- a/schema.json +++ b/schema.json @@ -2322,15 +2322,18 @@ ], "markdownDescription": "https://circleci.com/docs/configuration-reference#orbs-requires-version-21\n\nOrbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects.", "additionalProperties": { + "markdownDescription": "An orb reference can be specified in multiple ways:\n\n**String with semantic version:**\n- `namespace/orb-name@1.2.3` - specific version\n- `namespace/orb-name@1.2` - latest patch version of 1.2.x\n- `namespace/orb-name@1` - latest minor and patch of 1.x.x\n- `namespace/orb-name@volatile` - most recent release\n- `namespace/orb-name@dev:branch-name` - development version\n\n**String with parameter substitution:**\n- `namespace/orb-name@<>`\n- `namespace/orb-name@<>`\n\n**Inline orb object:** Define jobs, commands, and executors directly in this configuration.\n\nSee [Orb Concepts](https://circleci.com/docs/orbs/author/orb-concepts/#semantic-versioning) and [Creating Inline Orbs](https://circleci.com/docs/reference/reusing-config/#writing-inline-orbs) for more details.", "oneOf": [ { "type": "string", - "pattern": "^[a-z][a-z0-9_-]+/[a-z][a-z0-9_-]+@(dev:[\\.a-z0-9_-]+|\\d+|\\d+\\.\\d+|\\d+\\.\\d+\\.\\d+|volatile)$", - "markdownDescription": "https://circleci.com/docs/creating-orbs#semantic-versioning-in-orbs\n\nAn orb to depend on and its semver range, or volatile for the most recent release." + "pattern": "^[a-z][a-z0-9_-]+/[a-z][a-z0-9_-]+@(dev:[\\.a-z0-9_-]+|\\d+|\\d+\\.\\d+|\\d+\\.\\d+\\.\\d+|volatile)$" + }, + { + "type": "string", + "pattern": "^[a-z][a-z0-9_-]+/[a-z][a-z0-9_-]+@ *<<.+>> *$" }, { "type": "object", - "markdownDescription": "https://circleci.com/docs/creating-orbs#creating-inline-orbs\n\nInline orbs can be handy during development of an orb or as a convenience for name-spacing jobs and commands in lengthy configurations, particularly if you later intend to share the orb with others.", "properties": { "jobs": { "markdownDescription": "Jobs are collections of steps. All of the steps in the job are executed in a single unit, either within a fresh container or VM.", From e9bc1df45ae9e3547215f1f999ed4d7be5e10e26 Mon Sep 17 00:00:00 2001 From: Parker Rowe Date: Fri, 17 Oct 2025 14:28:56 -0400 Subject: [PATCH 13/13] shellcheck orb in noErrors.yml should have a semver at the end --- pkg/services/testdata/noErrors.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/testdata/noErrors.yml b/pkg/services/testdata/noErrors.yml index d3167635..0a6d94d8 100644 --- a/pkg/services/testdata/noErrors.yml +++ b/pkg/services/testdata/noErrors.yml @@ -7,7 +7,7 @@ parameters: orbs: compass: atlassian-labs/compass@0.1.3 - shellcheck: circleci/shellcheck + shellcheck: circleci/shellcheck@3.4.0 other: atlassian-labs/compass@0.1.3 ccc: cci-dev/ccc@<>