Skip to content

Commit 7fa79a2

Browse files
chore: 🧪 release (feat: wip, introduce "respect") (#1916)
1 parent 84a6252 commit 7fa79a2

File tree

313 files changed

+121941
-268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

313 files changed

+121941
-268
lines changed

.github/workflows/smoke-plugins.yaml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -64,29 +64,3 @@ jobs:
6464
with:
6565
node-version: 18
6666
- run: bash ./__tests__/smoke-plugins/run-smoke.sh
67-
68-
run-smoke-plugins--npm--node-16:
69-
needs: prepare-smoke-plugins
70-
runs-on: ubuntu-latest
71-
steps:
72-
- uses: actions/cache@v3
73-
with:
74-
path: __tests__/smoke-plugins/
75-
key: cache-plugins-${{ github.run_id }}-${{ github.run_attempt }}
76-
- uses: actions/setup-node@v3
77-
with:
78-
node-version: 16
79-
- run: bash ./__tests__/smoke-plugins/run-smoke.sh
80-
81-
run-smoke-plugins--npm--node-14:
82-
needs: prepare-smoke-plugins
83-
runs-on: ubuntu-latest
84-
steps:
85-
- uses: actions/cache@v3
86-
with:
87-
path: __tests__/smoke-plugins/
88-
key: cache-plugins-${{ github.run_id }}-${{ github.run_attempt }}
89-
- uses: actions/setup-node@v3
90-
with:
91-
node-version: 14
92-
- run: bash ./__tests__/smoke-plugins/run-smoke.sh

.github/workflows/snapshot-release.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,14 @@ jobs:
3131
# Update Core package version
3232
jq ".version = \"$VERSION\"" packages/core/package.json > tmp.json && mv tmp.json packages/core/package.json
3333
34-
# Update CLI package version and the Core dependency
34+
# Update Respect Core package version and dependencies
35+
jq ".version = \"$VERSION\"" packages/respect-core/package.json > tmp.json && mv tmp.json packages/respect-core/package.json
36+
jq ".dependencies[\"@redocly/openapi-core\"] = \"$VERSION\"" packages/respect-core/package.json > tmp.json && mv tmp.json packages/respect-core/package.json
37+
38+
# Update CLI package version and dependencies
3539
jq ".version = \"$VERSION\"" packages/cli/package.json > tmp.json && mv tmp.json packages/cli/package.json
3640
jq ".dependencies[\"@redocly/openapi-core\"] = \"$VERSION\"" packages/cli/package.json > tmp.json && mv tmp.json packages/cli/package.json
41+
jq ".dependencies[\"@redocly/respect-core\"] = \"$VERSION\"" packages/cli/package.json > tmp.json && mv tmp.json packages/cli/package.json
3742
3843
# Add comment with installation instructions
3944
COMMENT="📦 A new experimental version **v$VERSION** of Redocly CLI has been published for testing.
@@ -66,5 +71,11 @@ jobs:
6671
6772
cd packages/core
6873
npm publish --tag snapshot
74+
sleep 10
75+
76+
cd ../respect-core
77+
npm publish --tag snapshot
78+
sleep 10
79+
6980
cd ../cli
7081
npm publish --tag snapshot

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: npm run e2e
2929
env:
3030
CI: true
31-
31+
SANDBOX_REBILLY_TOKEN: ${{ secrets.SANDBOX_REBILLY_TOKEN }}
3232
cli-package-test:
3333
runs-on: ubuntu-latest
3434
steps:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ output/
1313
*.tgz
1414
redoc-static.html
1515
packages/cli/README.md
16+
.env

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ lib/
44
output/
55
*snapshot.js
66
packages/core/src/rules/__tests__/fixtures/invalid-yaml.yaml
7+
packages/respect-core/src/modules/runtime-expressions/abnf-parser.js
78
__tests__/webpack-bundle/bundle-workflows/metafile.json
89
benchmark/api-definitions/
910
LICENSE.md

CONTRIBUTING.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,9 @@ To test local changes as a package, you can use the following steps:
7070

7171
1. Optionally, bump the version of the packages ([see details](#version-updating)).
7272

73-
1. Run `npm run pack:prepare` in the repository's root. This generates **redocly-cli.tgz** and **openapi-core.tgz** files and makes some changes to **packages/cli/package.json** file.
73+
1. Run `npm run pack:prepare` in the repository's root. This generates **redocly-cli.tgz**, **respect-core.tgz**, and **openapi-core.tgz** files.
7474

75-
1. Copy **redocly-cli.tgz** file to a destination folder and then run `npm install redocly-cli.tgz` there to install Redocly CLI. To install `openapi-core` do the same but with **openapi-core.tgz** file.
76-
77-
Don't forget to revert the changes to **package.json** files later.
75+
1. Copy those **.tgz** files to a destination folder and then run `npm install redocly-cli.tgz` there to install Redocly CLI. To install `openapi-core` do the same but with **openapi-core.tgz** file.
7876

7977
## Contribute documentation
8078

__tests__/helpers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ type CLICommands =
1616
| 'push'
1717
| 'split'
1818
| 'stats'
19-
| 'build-docs';
19+
| 'build-docs'
20+
| 'respect';
2021

2122
export function getParams(
2223
indexEntryPoint: string,
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`should send in request and proceed case-insensitive headers in runtime expressions 1`] = `
4+
"────────────────────────────────────────────────────────────────────────────────
5+

6+
Running workflow case-insensitive-headers.yaml / get-museum-hours
7+

8+
✓ GET /museum-hours - step get-museum-hours
9+
    ✓ success criteria check
10+
    ✓ success criteria check
11+
    ✓ success criteria check
12+
    ✓ status code check (Response code 200 matches one of description codes: [200, 400, 404])
13+
    ✓ content-type check
14+
    ✓ schema check
15+

16+

17+
  Summary for case-insensitive-headers.yaml
18+
  
19+
  Workflows: 1 passed, 1 total
20+
  Steps: 1 passed, 1 total
21+
  Checks: 6 passed, 6 total
22+
  Time: <test>ms
23+

24+

25+
┌───────────────────────────────────────────────────────────────────────┬────────────┬─────────┬─────────┬──────────┬─────────┐
26+
│ Filename │ Workflows │ Passed │ Failed │ Warnings │ Skipped │
27+
├───────────────────────────────────────────────────────────────────────┼────────────┼─────────┼─────────┼──────────┼─────────┤
28+
│ ✓ case-insensitive-headers.yaml │ 1 │ 1 │ - │ - │ - │
29+
└───────────────────────────────────────────────────────────────────────┴────────────┴─────────┴─────────┴──────────┴─────────┘
30+

31+
32+
"
33+
`;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { join } from 'path';
2+
import { getCommandOutput, getParams } from '../utils';
3+
4+
test('should send in request and proceed case-insensitive headers in runtime expressions', () => {
5+
const indexEntryPoint = join(process.cwd(), 'packages/cli/lib/index.js');
6+
const fixturesPath = join(__dirname, 'case-insensitive-headers.yaml');
7+
const args = getParams(indexEntryPoint, ['respect', fixturesPath]);
8+
9+
const result = getCommandOutput(args);
10+
expect(result).toMatchSnapshot();
11+
});
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
arazzo: 1.0.1
2+
info:
3+
title: Redocly Museum API
4+
description: >-
5+
Testing case insensitive headers in workflows
6+
version: 1.0.0
7+
8+
sourceDescriptions:
9+
- name: museum-api
10+
type: openapi
11+
url: museum-api.yaml
12+
13+
workflows:
14+
- workflowId: get-museum-hours
15+
description: >-
16+
This workflow demonstrates how to get the museum opening hours and buy tickets.
17+
parameters:
18+
- in: header
19+
name: Authorization
20+
value: Basic Og==
21+
steps:
22+
- stepId: get-museum-hours
23+
description: >-
24+
Get museum hours by resolving request details with getMuseumHours operationId from museum-api.yaml description.
25+
parameters:
26+
- in: header
27+
name: CammelCasedHeader
28+
value: custom-header
29+
- in: header
30+
name: CoNtenT-Type
31+
value: first
32+
- in: header
33+
name: ContenT-Type
34+
value: second
35+
- in: header
36+
name: ContenT-TypE
37+
value: third
38+
operationId: museum-api.getMuseumHours
39+
successCriteria:
40+
- condition: $request.header.content-type == 'third'
41+
- condition: $request.header.CammelCasedHeader == 'custom-header' && $response.header.X-Frame-Options == 'deny'
42+
- condition: $response.header.X-Content-Type-Options == 'nosniff'

0 commit comments

Comments
 (0)