diff --git a/docs/changelog.md b/docs/changelog.md index 923d32d9fa..e9bd8393ec 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -244,7 +244,7 @@ toc: ### Minor Changes -- Added Spot and Arazzo rules: `no-criteria-xpath`, `no-actions-type-end`, `criteria-unique`. +- Added Respect and Arazzo rules: `no-criteria-xpath`, `no-actions-type-end`, `criteria-unique`. ### Patch Changes diff --git a/docs/guides/lint-arazzo.md b/docs/guides/lint-arazzo.md index 1266d13f9f..795ee2cd40 100644 --- a/docs/guides/lint-arazzo.md +++ b/docs/guides/lint-arazzo.md @@ -82,7 +82,7 @@ extends: arazzoRules: sourceDescription-name-unique: warn - spot-supported-versions: error + respect-supported-versions: error ``` The configuration shown here gives some good entry-level linting using the `minimal` standard, and adds checks that we're using a supported version of Arazzo, and warns if each source description doesn't have a unique name. diff --git a/docs/rules/built-in-rules.md b/docs/rules/built-in-rules.md index 3a7f9f05c1..e2d22d5f05 100644 --- a/docs/rules/built-in-rules.md +++ b/docs/rules/built-in-rules.md @@ -115,7 +115,7 @@ Other rules such as the `spec` and `info.*` rules also apply to AsyncAPI. ## Arazzo rules -Within the Arazzo family of rules, there are rules for the main Arazzo specification format, and some additional rules for extensions supported by Spot, the Redocly testing utility. +Within the Arazzo family of rules, there are rules for the main Arazzo specification format, and some additional rules for extensions supported by Respect, the Redocly testing utility. ### Arazzo @@ -131,12 +131,12 @@ Within the Arazzo family of rules, there are rules for the main Arazzo specifica - [workflowId-unique](./arazzo/workflowId-unique.md): the `workflowId` property must be unique across all workflows - [sourceDescriptions-not-empty](./arazzo/sourceDescriptions-not-empty.md): the `sourceDescriptions` must be defined and the list must have at least one entry. -### Spot [ deprecated ] +### Respect [ deprecated ] -The below rules are being migrated to Spot: +The below rules are being migrated to Respect: -- [no-criteria-xpath](./spot/no-criteria-xpath.md): the `xpath` type criteria is not supported by Spot. -- [spot-supported-versions](./spot/spot-supported-versions.md): the `version` property must be one of the supported values. +- [no-criteria-xpath](./respect/no-criteria-xpath.md): the `xpath` type criteria is not supported by Respect. +- [respect-supported-versions](./respect/respect-supported-versions.md): the `version` property must be one of the supported values. ## Resources diff --git a/docs/rules/spot/no-criteria-xpath.md b/docs/rules/respect/no-criteria-xpath.md similarity index 100% rename from docs/rules/spot/no-criteria-xpath.md rename to docs/rules/respect/no-criteria-xpath.md diff --git a/docs/rules/spot/spot-supported-versions.md b/docs/rules/respect/respect-supported-versions.md similarity index 97% rename from docs/rules/spot/spot-supported-versions.md rename to docs/rules/respect/respect-supported-versions.md index f12e7442b7..5176493f69 100644 --- a/docs/rules/spot/spot-supported-versions.md +++ b/docs/rules/respect/respect-supported-versions.md @@ -1,4 +1,4 @@ -# spot-supported-versions +# respect-supported-versions The `version` property must be one of the supported values. diff --git a/docs/rules/ruleset-templates.md b/docs/rules/ruleset-templates.md index 9906de5c74..8d2f5a6c64 100644 --- a/docs/rules/ruleset-templates.md +++ b/docs/rules/ruleset-templates.md @@ -229,7 +229,7 @@ rules: parameters-unique: off step-onSuccess-unique: off step-onFailure-unique: off - spot-supported-versions: off + respect-supported-versions: off requestBody-replacements-unique: off no-criteria-xpath: off no-actions-type-end: off @@ -498,7 +498,7 @@ rules: parameters-unique: error step-onSuccess-unique: warn step-onFailure-unique: warn - spot-supported-versions: off + respect-supported-versions: off requestBody-replacements-unique: warn no-criteria-xpath: off no-actions-type-end: warn diff --git a/docs/rules/spec-ruleset.md b/docs/rules/spec-ruleset.md index af81151bed..5702143da5 100644 --- a/docs/rules/spec-ruleset.md +++ b/docs/rules/spec-ruleset.md @@ -10,7 +10,7 @@ All the rules are of severity `error`: - [struct](./arazzo/struct.md) - [criteria-unique](./arazzo/criteria-unique.md) - [sourceDescription-type](./arazzo/sourceDescriptions-type.md) -- [spot-supported-versions](./spot/spot-supported-versions.md) +- [respect-supported-versions](./respect/respect-supported-versions.md) - [workflowId-unique](./arazzo/workflowId-unique.md) - [stepId-unique](./arazzo/stepId-unique.md) - [sourceDescription-name-unique](./arazzo/sourceDescriptions-name-unique.md) @@ -20,5 +20,5 @@ All the rules are of severity `error`: - [step-onSuccess-unique](./arazzo/step-onSuccess-unique.md) - [step-onFailure-unique](./arazzo/step-onFailure-unique.md) - [requestBody-replacements-unique](./arazzo/requestBody-replacements-unique.md) -- [no-criteria-xpath](./spot/no-criteria-xpath.md) +- [no-criteria-xpath](./respect/no-criteria-xpath.md) - [criteria-unique](./arazzo/criteria-unique.md) diff --git a/docs/sidebars.yaml b/docs/sidebars.yaml index 24e09e0bdc..05ac07beb7 100644 --- a/docs/sidebars.yaml +++ b/docs/sidebars.yaml @@ -138,8 +138,8 @@ - page: rules/async/channels-kebab-case.md - page: rules/async/no-channel-trailing-slash.md - separator: Arazzo - - page: rules/spot/no-criteria-xpath.md - - page: rules/spot/spot-supported-versions.md + - page: rules/respect/no-criteria-xpath.md + - page: rules/respect/respect-supported-versions.md - page: rules/arazzo/criteria-unique.md - page: rules/arazzo/parameters-unique.md - page: rules/arazzo/requestBody-replacements-unique.md diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 493aae8846..f15d713a91 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -32,7 +32,7 @@ ### Patch Changes -- Added support for Arazzo version 1.0.1 in Spot validation rules. +- Added support for Arazzo version 1.0.1 in Respect validation rules. ## 1.28.1 @@ -73,13 +73,13 @@ ### Patch Changes -- Updated Spot validation rules. +- Updated Respect validation rules. ## 1.26.1 ### Patch Changes -- Removed the `no-actions-type-end` Spot rule. +- Removed the `no-actions-type-end` Respect rule. - Removed unused lodash.isequal dependency. ## 1.26.0 @@ -202,7 +202,7 @@ ### Minor Changes -- Added Spot and Arazzo rules: `no-criteria-xpath`, `no-actions-type-end`, `criteria-unique`. +- Added Respect and Arazzo rules: `no-criteria-xpath`, `no-actions-type-end`, `criteria-unique`. ### Patch Changes diff --git a/packages/core/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap b/packages/core/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap index 79176f7538..5686ce079b 100644 --- a/packages/core/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +++ b/packages/core/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap @@ -9,10 +9,10 @@ exports[`resolveConfig should ignore minimal from the root and read local file 1 "no-criteria-xpath": "off", "parameters-unique": "error", "requestBody-replacements-unique": "warn", + "respect-supported-versions": "off", "sourceDescription-name-unique": "error", "sourceDescription-type": "error", "sourceDescriptions-not-empty": "error", - "spot-supported-versions": "off", "step-onFailure-unique": "warn", "step-onSuccess-unique": "warn", "stepId-unique": "error", @@ -238,10 +238,10 @@ exports[`resolveStyleguideConfig should resolve extends with local file config w "no-criteria-xpath": "off", "parameters-unique": "error", "requestBody-replacements-unique": "warn", + "respect-supported-versions": "off", "sourceDescription-name-unique": "error", "sourceDescription-type": "error", "sourceDescriptions-not-empty": "error", - "spot-supported-versions": "off", "step-onFailure-unique": "warn", "step-onSuccess-unique": "warn", "stepId-unique": "error", diff --git a/packages/core/src/config/all.ts b/packages/core/src/config/all.ts index c9328b5550..10fd51f19c 100644 --- a/packages/core/src/config/all.ts +++ b/packages/core/src/config/all.ts @@ -222,7 +222,7 @@ const all: PluginStyleguideConfig<'built-in'> = { 'stepId-unique': 'error', 'sourceDescription-name-unique': 'error', 'sourceDescriptions-not-empty': 'error', - 'spot-supported-versions': 'off', + 'respect-supported-versions': 'off', 'workflowId-unique': 'error', 'workflow-dependsOn': 'error', }, diff --git a/packages/core/src/config/minimal.ts b/packages/core/src/config/minimal.ts index 91a9d2dbd0..e91cac8ebc 100644 --- a/packages/core/src/config/minimal.ts +++ b/packages/core/src/config/minimal.ts @@ -198,7 +198,7 @@ const minimal: PluginStyleguideConfig<'built-in'> = { 'step-onFailure-unique': 'off', 'stepId-unique': 'error', 'sourceDescription-name-unique': 'off', - 'spot-supported-versions': 'off', + 'respect-supported-versions': 'off', 'workflowId-unique': 'error', 'workflow-dependsOn': 'off', }, diff --git a/packages/core/src/config/recommended-strict.ts b/packages/core/src/config/recommended-strict.ts index 23fada42b8..d9689fecef 100644 --- a/packages/core/src/config/recommended-strict.ts +++ b/packages/core/src/config/recommended-strict.ts @@ -198,7 +198,7 @@ const recommendedStrict: PluginStyleguideConfig<'built-in'> = { 'stepId-unique': 'error', 'sourceDescription-name-unique': 'error', 'sourceDescriptions-not-empty': 'error', - 'spot-supported-versions': 'off', + 'respect-supported-versions': 'off', 'workflowId-unique': 'error', 'workflow-dependsOn': 'error', }, diff --git a/packages/core/src/config/recommended.ts b/packages/core/src/config/recommended.ts index a0ee58821b..6605b76f91 100644 --- a/packages/core/src/config/recommended.ts +++ b/packages/core/src/config/recommended.ts @@ -198,7 +198,7 @@ const recommended: PluginStyleguideConfig<'built-in'> = { 'stepId-unique': 'error', 'sourceDescription-name-unique': 'error', 'sourceDescriptions-not-empty': 'error', - 'spot-supported-versions': 'off', + 'respect-supported-versions': 'off', 'workflowId-unique': 'error', 'workflow-dependsOn': 'error', }, diff --git a/packages/core/src/config/spec.ts b/packages/core/src/config/spec.ts index 273bfb8699..edc37a312b 100644 --- a/packages/core/src/config/spec.ts +++ b/packages/core/src/config/spec.ts @@ -12,7 +12,7 @@ const spec: PluginStyleguideConfig<'built-in'> = { async3Rules: {}, arazzo1Rules: { 'sourceDescription-type': 'error', - 'spot-supported-versions': 'off', + 'respect-supported-versions': 'off', 'workflowId-unique': 'error', 'stepId-unique': 'error', 'sourceDescription-name-unique': 'error', diff --git a/packages/core/src/rules/arazzo/__tests__/no-criteria-xpath.test.ts b/packages/core/src/rules/arazzo/__tests__/no-criteria-xpath.test.ts index 5d32592d05..6d95a7a0ed 100644 --- a/packages/core/src/rules/arazzo/__tests__/no-criteria-xpath.test.ts +++ b/packages/core/src/rules/arazzo/__tests__/no-criteria-xpath.test.ts @@ -90,7 +90,7 @@ describe('Arazzo no-criteria-xpath', () => { "source": "arazzo.yaml", }, ], - "message": "The \`xpath\` type criteria is not supported by Spot.", + "message": "The \`xpath\` type criteria is not supported by Respect.", "ruleId": "no-criteria-xpath", "severity": "error", "suggest": [], @@ -103,7 +103,7 @@ describe('Arazzo no-criteria-xpath', () => { "source": "arazzo.yaml", }, ], - "message": "The \`xpath\` type criteria is not supported by Spot.", + "message": "The \`xpath\` type criteria is not supported by Respect.", "ruleId": "no-criteria-xpath", "severity": "error", "suggest": [], diff --git a/packages/core/src/rules/arazzo/__tests__/spot-supported-versions.test.ts b/packages/core/src/rules/arazzo/__tests__/respect-supported-versions.test.ts similarity index 93% rename from packages/core/src/rules/arazzo/__tests__/spot-supported-versions.test.ts rename to packages/core/src/rules/arazzo/__tests__/respect-supported-versions.test.ts index 3658d920eb..1663caec1f 100644 --- a/packages/core/src/rules/arazzo/__tests__/spot-supported-versions.test.ts +++ b/packages/core/src/rules/arazzo/__tests__/respect-supported-versions.test.ts @@ -3,7 +3,7 @@ import { lintDocument } from '../../../lint'; import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils'; import { BaseResolver } from '../../../resolve'; -describe('Arazzo spot-supported-versions', () => { +describe('Arazzo respect-supported-versions', () => { const documentWithUnsupportedVersion = parseYamlToDocument( outdent` arazzo: '1.0.2' @@ -67,7 +67,7 @@ describe('Arazzo spot-supported-versions', () => { externalRefResolver: new BaseResolver(), document: documentWithUnsupportedVersion, config: await makeConfig({ - rules: { 'spot-supported-versions': 'error' }, + rules: { 'respect-supported-versions': 'error' }, }), }); @@ -81,8 +81,8 @@ describe('Arazzo spot-supported-versions', () => { "source": "arazzo.yaml", }, ], - "message": "Only 1.0.1 Arazzo version is supported by Spot.", - "ruleId": "spot-supported-versions", + "message": "Only 1.0.1 Arazzo version is supported by Respect.", + "ruleId": "respect-supported-versions", "severity": "error", "suggest": [], }, @@ -95,7 +95,7 @@ describe('Arazzo spot-supported-versions', () => { externalRefResolver: new BaseResolver(), document: documentWithSupportedVersion, config: await makeConfig({ - rules: { 'spot-supported-versions': 'error' }, + rules: { 'respect-supported-versions': 'error' }, }), }); diff --git a/packages/core/src/rules/arazzo/index.ts b/packages/core/src/rules/arazzo/index.ts index e78e0e02ab..0eff588244 100644 --- a/packages/core/src/rules/arazzo/index.ts +++ b/packages/core/src/rules/arazzo/index.ts @@ -2,7 +2,7 @@ import { Struct } from '../common/struct'; import { Assertions } from '../common/assertions'; import { SourceDescriptionType } from '../arazzo/sourceDescription-type'; import { SourceDescriptionsNotEmpty } from './sourceDescriptions-not-empty'; -import { SpotSupportedVersions } from '../spot/spot-supported-versions'; +import { RespectSupportedVersions } from '../respect/respect-supported-versions'; import { WorkflowIdUnique } from './workflowId-unique'; import { StepIdUnique } from './stepId-unique'; import { SourceDescriptionsNameUnique } from './sourceDescriptions-name-unique'; @@ -11,7 +11,7 @@ import { ParametersUnique } from './parameters-unique'; import { StepOnSuccessUnique } from './step-onSuccess-unique'; import { StepOnFailureUnique } from './step-onFailure-unique'; import { RequestBodyReplacementsUnique } from './requestBody-replacements-unique'; -import { NoCriteriaXpath } from '../spot/no-criteria-xpath'; +import { NoCriteriaXpath } from '../respect/no-criteria-xpath'; import { CriteriaUnique } from './criteria-unique'; import type { Arazzo1Rule } from '../../visitors'; @@ -21,7 +21,7 @@ export const rules: Arazzo1RuleSet<'built-in'> = { struct: Struct as Arazzo1Rule, assertions: Assertions as Arazzo1Rule, 'sourceDescription-type': SourceDescriptionType, - 'spot-supported-versions': SpotSupportedVersions, + 'respect-supported-versions': RespectSupportedVersions, 'workflowId-unique': WorkflowIdUnique, 'stepId-unique': StepIdUnique, 'sourceDescription-name-unique': SourceDescriptionsNameUnique, diff --git a/packages/core/src/rules/spot/no-criteria-xpath.ts b/packages/core/src/rules/respect/no-criteria-xpath.ts similarity index 97% rename from packages/core/src/rules/spot/no-criteria-xpath.ts rename to packages/core/src/rules/respect/no-criteria-xpath.ts index b45839ccdd..7445dc2aff 100644 --- a/packages/core/src/rules/spot/no-criteria-xpath.ts +++ b/packages/core/src/rules/respect/no-criteria-xpath.ts @@ -10,7 +10,7 @@ export const NoCriteriaXpath: Arazzo1Rule = () => { } if (criteria?.type?.type === 'xpath' || criteria?.type === 'xpath') { report({ - message: 'The `xpath` type criteria is not supported by Spot.', + message: 'The `xpath` type criteria is not supported by Respect.', location: location.child(['type']), }); } diff --git a/packages/core/src/rules/spot/spot-supported-versions.ts b/packages/core/src/rules/respect/respect-supported-versions.ts similarity index 52% rename from packages/core/src/rules/spot/spot-supported-versions.ts rename to packages/core/src/rules/respect/respect-supported-versions.ts index 117f7b82d2..0aaabb7049 100644 --- a/packages/core/src/rules/spot/spot-supported-versions.ts +++ b/packages/core/src/rules/respect/respect-supported-versions.ts @@ -1,20 +1,20 @@ -import { ARAZZO_VERSIONS_SUPPORTED_BY_SPOT } from '../../typings/arazzo'; +import { ARAZZO_VERSIONS_SUPPORTED_BY_RESPECT } from '../../typings/arazzo'; import { pluralize } from '../../utils'; import type { Arazzo1Rule } from '../../visitors'; import type { UserContext } from '../../walk'; -export const SpotSupportedVersions: Arazzo1Rule = () => { - const supportedVersions = ARAZZO_VERSIONS_SUPPORTED_BY_SPOT.join(', '); +export const RespectSupportedVersions: Arazzo1Rule = () => { + const supportedVersions = ARAZZO_VERSIONS_SUPPORTED_BY_RESPECT.join(', '); return { Root: { enter(root, { report, location }: UserContext) { - if (!ARAZZO_VERSIONS_SUPPORTED_BY_SPOT.includes(root.arazzo)) { + if (!ARAZZO_VERSIONS_SUPPORTED_BY_RESPECT.includes(root.arazzo)) { report({ message: `Only ${supportedVersions} Arazzo ${pluralize( 'version is', - ARAZZO_VERSIONS_SUPPORTED_BY_SPOT.length - )} supported by Spot.`, + ARAZZO_VERSIONS_SUPPORTED_BY_RESPECT.length + )} supported by Respect.`, location: location.child('arazzo'), }); } diff --git a/packages/core/src/types/redocly-yaml.ts b/packages/core/src/types/redocly-yaml.ts index 0265304ac7..c6d06e6b0e 100644 --- a/packages/core/src/types/redocly-yaml.ts +++ b/packages/core/src/types/redocly-yaml.ts @@ -152,7 +152,7 @@ const builtInArazzo1Rules = [ 'parameters-unique', 'step-onSuccess-unique', 'step-onFailure-unique', - 'spot-supported-versions', + 'respect-supported-versions', 'requestBody-replacements-unique', 'no-criteria-xpath', 'criteria-unique', diff --git a/packages/core/src/typings/arazzo.ts b/packages/core/src/typings/arazzo.ts index a683904eb3..65b7e9153b 100644 --- a/packages/core/src/typings/arazzo.ts +++ b/packages/core/src/typings/arazzo.ts @@ -169,4 +169,4 @@ export interface ArazzoDefinition { export const VERSION_PATTERN = /^1\.0\.\d+(-.+)?$/; -export const ARAZZO_VERSIONS_SUPPORTED_BY_SPOT = ['1.0.1']; +export const ARAZZO_VERSIONS_SUPPORTED_BY_RESPECT = ['1.0.1']; diff --git a/packages/respect-core/src/modules/__tests__/flow-runner/run-step.test.ts b/packages/respect-core/src/modules/__tests__/flow-runner/run-step.test.ts index 487e631a44..17d9c0f33b 100644 --- a/packages/respect-core/src/modules/__tests__/flow-runner/run-step.test.ts +++ b/packages/respect-core/src/modules/__tests__/flow-runner/run-step.test.ts @@ -1547,7 +1547,7 @@ describe('runStep', () => { }); expect(displayChecks).toHaveBeenCalled(); - expect(checkCriteria).toHaveBeenCalledTimes(5); + expect(checkCriteria).toHaveBeenCalledTimes(3); }); it('should result with an error when onFailure step criteria with retry StepId and WorkflowId provided', async () => { @@ -1790,7 +1790,7 @@ describe('runStep', () => { }); expect(displayChecks).toHaveBeenCalled(); - expect(checkCriteria).toHaveBeenCalledTimes(5); + expect(checkCriteria).toHaveBeenCalledTimes(3); }); it('should execute onFailure step criteria with successful retry', async () => { diff --git a/packages/respect-core/src/modules/flow-runner/get-test-description-from-file.ts b/packages/respect-core/src/modules/flow-runner/get-test-description-from-file.ts index 6b24257734..c0c9f6dca0 100644 --- a/packages/respect-core/src/modules/flow-runner/get-test-description-from-file.ts +++ b/packages/respect-core/src/modules/flow-runner/get-test-description-from-file.ts @@ -34,7 +34,7 @@ export async function bundleArazzo(filePath: string) { extends: ['recommended-strict'], arazzo1Rules: { 'no-criteria-xpath': 'error', - 'spot-supported-versions': 'error', + 'respect-supported-versions': 'error', }, });