Skip to content

Commit

Permalink
Merge branch 'develop' into feat/admin-3.0-returns
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperkristensen authored Mar 22, 2024
2 parents 8cd5443 + d24c819 commit 1dc549f
Show file tree
Hide file tree
Showing 204 changed files with 5,970 additions and 4,107 deletions.
5 changes: 5 additions & 0 deletions .changeset/breezy-clocks-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/user": patch
---

feat(user): invite expiry fix
6 changes: 6 additions & 0 deletions .changeset/calm-spoons-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@medusajs/core-flows": minor
"@medusajs/medusa": minor
---

Align the v2 product HTTP endpoints to follow conventions
5 changes: 5 additions & 0 deletions .changeset/happy-llamas-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/link-modules": patch
---

Recreate dismissed link
7 changes: 7 additions & 0 deletions .changeset/nine-parrots-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@medusajs/orchestration": patch
"@medusajs/workflows-sdk": patch
"@medusajs/core-flows": patch
---

Feat: workflow cancel
8 changes: 8 additions & 0 deletions .changeset/ninety-months-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@medusajs/medusa": patch
"@medusajs/event-bus-redis": patch
"@medusajs/modules-sdk": patch
"@medusajs/types": patch
---

feat: v2 - add worker mode
5 changes: 5 additions & 0 deletions .changeset/slow-plants-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/utils": patch
---

feat(utils): autogenerates create and update methods when dto is provided
5 changes: 5 additions & 0 deletions .changeset/small-guests-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---

fix(medusa): ensure feature flags are loaded properly in migrate command
5 changes: 5 additions & 0 deletions .changeset/violet-bikes-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/workflows-sdk": patch
---

Added idempotencyKey to workflow step context
8 changes: 8 additions & 0 deletions .changeset/violet-lizards-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@medusajs/medusa": patch
"medusa-test-utils": patch
"@medusajs/types": patch
"@medusajs/utils": patch
---

chore: v2 - deprecate extra in favor of driver options
79 changes: 75 additions & 4 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ jobs:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
outputs:
module-matrix: ${{ steps.set-module-matrix.outputs.matrix }}
module-chunks: ${{ steps.set-module-chunks.outputs.chunks }}
api-matrix: ${{ steps.set-api-matrix.outputs.matrix }}
api-chunks: ${{ steps.set-api-chunks.outputs.chunks }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -28,6 +33,28 @@ jobs:
with:
extension: pipeline

- id: set-module-chunks
name: Set Module Chunks
working-directory: integration-tests/modules
run: echo "chunks=$(yarn run jest --listTests --json | jq -cM '[_nwise(length / 3 | ceil)]')" >> $GITHUB_OUTPUT

- id: set-module-matrix
name: Set Module Matrix
run: echo "matrix=$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" >> $GITHUB_OUTPUT
env:
CHUNKS: ${{ steps.set-module-chunks.outputs.chunks }}

- id: set-api-chunks
name: Set API Chunks
working-directory: integration-tests/api
run: echo "chunks=$(yarn run jest --listTests --json | jq -cM '[_nwise(length / 3 | ceil)]')" >> $GITHUB_OUTPUT

- id: set-api-matrix
name: Set API Matrix
run: echo "matrix=$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" >> $GITHUB_OUTPUT
env:
CHUNKS: ${{ steps.set-api-chunks.outputs.chunks }}

unit-tests:
needs: setup
runs-on: ubuntu-latest
Expand Down Expand Up @@ -126,9 +153,14 @@ jobs:
DB_PASSWORD: postgres
DB_USERNAME: postgres

integration-tests-api:
integration-tests-api-matrix:
needs: setup
name: Shard (${{ matrix.chunk }}) API Integration Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
chunk: ${{ fromJSON(needs.setup.outputs.api-matrix) }}
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
Expand Down Expand Up @@ -181,11 +213,29 @@ jobs:
- name: Build Packages
run: yarn build

- name: Run integration tests
- name: Run API integration tests
run: yarn test:integration:api
env:
DB_PASSWORD: postgres
DB_USERNAME: postgres
DB_PASSWORD: postgres
NODE_OPTIONS: "--max_old_space_size=4096"
CHUNK: ${{ matrix.chunk }}
CHUNKS: ${{ needs.setup.outputs.api-chunks }}

integration-tests-api:
if: ${{ always() }}
runs-on: ubuntu-latest
needs: integration-tests-api-matrix
steps:
- run: exit 1
if: >-
${{
contains(needs.integration-tests-api-matrix.result, 'failure')
|| contains(needs.integration-tests-api-matrix.result, 'cancelled')
|| contains(needs.integration-tests-api-matrix.result, 'skipped')
}}
- run: exit 0
if: ${{ contains(needs.integration-tests-api-matrix.result, 'success') }}

integration-tests-plugins:
needs: setup
Expand Down Expand Up @@ -240,8 +290,12 @@ jobs:
DB_PASSWORD: postgres
NODE_OPTIONS: "--max_old_space_size=4096"

integration-tests-modules:
integration-tests-modules-matrix:
needs: setup
name: Shard (${{ matrix.chunk }}) Module Integration Tests
strategy:
matrix:
chunk: ${{ fromJSON(needs.setup.outputs.module-matrix) }}
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
Expand Down Expand Up @@ -292,6 +346,23 @@ jobs:
DB_USERNAME: postgres
DB_PASSWORD: postgres
NODE_OPTIONS: "--max_old_space_size=4096"
CHUNK: ${{ matrix.chunk }}
CHUNKS: ${{ needs.setup.outputs.module-chunks }}

integration-tests-modules:
if: ${{ always() }}
runs-on: ubuntu-latest
needs: integration-tests-modules-matrix
steps:
- run: exit 1
if: >-
${{
contains(needs.integration-tests-modules-matrix.result, 'failure')
|| contains(needs.integration-tests-modules-matrix.result, 'cancelled')
|| contains(needs.integration-tests-modules-matrix.result, 'skipped')
}}
- run: exit 0
if: ${{ contains(needs.integration-tests-modules-matrix.result, 'success') }}

integration-tests-repositories:
needs: setup
Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# All files not owned by other teams must be reviewed by the core team
* @medusajs/core
/.changeset/ @medusajs/engineering
/packages/ @medusajs/engineering
/integration-tests/ @medusajs/engineering
/docs-util/ @medusajs/docs
Expand Down
14 changes: 10 additions & 4 deletions integration-tests/api/__tests__/admin/price-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -1323,12 +1323,15 @@ describe("/admin/price-lists", () => {
it("should delete all the prices that are part of the price list for the specified product", async () => {
const api = useApi()

response = await api.get("/admin/price-lists/test-list", adminReqConfig)
let response = await api.get(
"/admin/price-lists/test-list",
adminReqConfig
)

expect(response.status).toBe(200)
expect(response.data.price_list.prices.length).toBe(3)

let response = await api.delete(
response = await api.delete(
`/admin/price-lists/test-list/products/${product1.id}/prices`,
adminReqConfig
)
Expand All @@ -1353,13 +1356,16 @@ describe("/admin/price-lists", () => {
it("should delete all the prices that are part of the price list for the specified variant", async () => {
const api = useApi()

response = await api.get("/admin/price-lists/test-list", adminReqConfig)
let response = await api.get(
"/admin/price-lists/test-list",
adminReqConfig
)

expect(response.status).toBe(200)
expect(response.data.price_list.prices.length).toBe(3)

const variant = product2.variants[0]
let response = await api.delete(
response = await api.delete(
`/admin/price-lists/test-list/variants/${variant.id}/prices`,
adminReqConfig
)
Expand Down
Loading

0 comments on commit 1dc549f

Please sign in to comment.