Commit Graph

13 Commits

Author SHA1 Message Date
Shahed Nasser
cf387aafa2 chore: re-add oas tests for generated OAS (#9036)
* chore: re-add oas tests for generated OAS

* test fix
2024-09-07 08:01:22 +02:00
Adrien de Peretti
bbccd6481d chore(): start moving some packages to the core directory (#7215) 2024-05-03 13:37:41 +02:00
Adrien de Peretti
f88d75b0a7 feat(product, pricing, utils): Transaction issues and reference issues (#5533)
* feat(product, pricing, utils): Transaction issues and reference issues

* fixes decorators

* cleanup

* fix product module upsert

* fix missing active manager

* increase timeout

* revert package.json

* WIP

* try another node version based on findings with memory issues with jest introduced after 16.11 but fixed in 21

* re add bail

* fix variant options

* chore: bulk create pricing

* chore: workflow bulk

* Create big-chefs-dream.md

* fix missing update for upserty

* Add integration tests for product options upsert

* rm unnecessary return

* fix product prices workflow issue

* cleanup

* fix flag

* fix model

---------

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2023-11-06 12:24:29 +01:00
Carlos R. L. Rodrigues
d9c5e165cd chore: pipeline node version (#4896) 2023-08-28 19:41:47 +00:00
Andreas Deininger
88e68af501 chore(ci): Bump GitHub workflows to run on node 16 (#4876)
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-08-28 16:58:05 +02:00
Oliver Windall Juhl
cfd3e396cf chore(workflows): Force Node v16.10 version in CI (#4523) 2023-07-13 08:42:43 +02:00
Adrien de Peretti
a6c0825722 chore: Update node version in the pipeline to 16 (#4485)
* chore: Update node version in the pipeline to 16

* upgrade to node 16 (setup-server)
2023-07-10 12:17:30 +02:00
Oliver Windall Juhl
8277a74257 chore(ci): Don't ignore docs for required checks (#3749) 2023-04-06 15:22:21 +02:00
Patrick
240d0ea7b8 fix(ci,oas) move oas ci script to a package under the oas workspace (#3391)
* feat(ci,oas) run oas ci on all PRs

* fix(ci,oas) move oas ci script to a package under the oas workspace

* chore(changeset): patch
2023-03-07 10:33:12 +01:00
Patrick
3e274edb9e feat(docs): OAS circular reference check shall fail openapi:generate (#3269)
### What

Unhandled OAS circular references shall fail `openapi:generate` until they have been patched in `docs-util/redocly/config.yaml`

### Why

Prevent developers to commit new OAS changes that would cause to API documentation to crash.

Our API documentation rendering library will crash and not load if our OAS contains circular references. We have an automated mechanism to patch offending references but they must be identified and configured by hand.

### How

Let the `openapi:generate --dry-run` command reach OAS sanitization and circular reference check operations. 

Fail the build script if unhandled circular references are detected. 

Output the offending references to the stdout in order to help the developers identify and configure the required patch.

Since some the tooling involved only work with files, use the host system's temporary directory mechanism when using the `--dry-run` flag.

### Test

* Introduce a bug by removing an entry in `docs-util/redocly/config.yaml`
* Run `yarn openapi:generate --dry-run`
* Expect the script to exit before completing
* Expect the logs to contain `🔴 Unhandled circular references.`
* Expect the logs to contain an array of the offending references
2023-02-17 12:11:27 +00:00
Patrick
8137061908 feat(oas): medusa-oas-cli as OAS build tool (#3213)
## What

Introduce a CLI for extracting OAS from the core `medusa` package.

## Why

We need to decouple OAS tooling from documentation tooling in order to allow packages and external systems to leverage our OAS has a dependency.

## How

Introduce a new OAS workspace within packages in order to organize current and future OAS related package. Only 1 OAS package for now.

Introduce a new CLI only package to act as the main gateway for all upcoming OAS tooling. Only 1 command for now.

Update documentation tooling pertaining to OAS to use the CLI instead.

## Test

### Prerequisite
From the monorepo root:
* `yarn install`
* `yarn build`

### Documentation

#### Case - validation only - success
* Run `yarn openapi:generate --dry-run`
* Expect console output `🟢 Valid OAS` but no mention of `🔵 Exported OAS`

#### Case - validation only - invalid
* Introduce a bug by renaming `@schema Cart` to `@schema Kart` in [models/cart.ts](0adb0d9ff9/packages/medusa/src/models/cart.ts (L2))
* Run `yarn build` to update `@medusajs/medusa` package with the bug.
* Run `yarn openapi:generate --dry-run`
* Expect console output `🔴 Invalid OAS` with a stack trace of the issue.

#### Case - docs generation
* Run `yarn openapi:generate`
* Expect `docs/api/` directory to contain:
  * `admin.oas.json` (raw OAS)
  * `store.oas.json` (raw OAS)
  * `admin.oas.yaml` (sanitized OAS)
  * `store.oas.yaml` (sanitized OAS)
  * `admin/` (updated redocly split output)
  * `store/` (updated redocly split output)

### CLI

#### Case - crawl additional paths
* From a local medusa server (`medusa-starter-default`), add an `index.ts` file in `src/models/`
* In the `index.ts`, add dummy OAS JSDoc like `/** @schema Foobar */`
* From the root of the monorepo, run `yarn medusa-oas --type store --paths path-to-medusa-server/src`
* Expect a `store.oas.json` to be created at the root of the monorepo.
* The `store.oas.json` should contain an additional `Foobar` entry in `components.schemas`.
2023-02-15 14:55:58 +00:00
Shahed Nasser
076b41bb89 fix(docs): API reference bugs (#2119)
* fixed shipping method tax line schema name

* added dry run option to build openapi script

* fixed summary of endpoints

* fixed title of endpoint
2022-08-29 14:25:17 +03:00
Shahed Nasser
73383cc466 chore(docs): Refactor API Reference (#1883) 2022-08-05 14:06:12 +02:00