Skip to content

Commit

Permalink
fix: speculative fix for typegate_prisma_test.ts (#898)
Browse files Browse the repository at this point in the history
- Assigns special schemas for each test that relies on the
`runtimes/prisma/prisma.py` typegraph.
- Bumps version tag to 0.5.0-rc4
- Fixes issues in release pipeline
- Disables all but the `test-full` job when the test pipeline is run
with tmate enabled.

The flakeout of `typegate_prisma_test.ts` has proved difficult to
recreate. Looking at the code and going from recent similar cases, I
suspect it happens due to the old code reusing the same pg schema for
multiple tests. Assigning special schemas for each tests should
hopefully help.


#### Migration notes

N/A

---

- [x] The change comes with new or modified tests

---------

Signed-off-by: Yohe-Am <[email protected]>
  • Loading branch information
Yohe-Am authored Nov 1, 2024
1 parent bb42c00 commit 18a13d6
Show file tree
Hide file tree
Showing 37 changed files with 982 additions and 102 deletions.
52 changes: 30 additions & 22 deletions .ghjk/lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,29 @@
],
"allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y"
},
"ghjkEnvProvInstSet___ci": {
"installs": [
"bciqbx637744bfiyvprs77xdnvdt7uuwmtlntfjpwmkda672gklkbpmi",
"bciqdtuhf425g6prb5fyupbcokttmkill6wyqk7bkphx3ueltl5mvu4q",
"bciqmvgsg7h3ohj3m7das4bznahgt6tyq7mamta3n2vorulqvml7mywq",
"bciqicdqw36v63cbrscwsgtu2htrmwmgtfoxexv4rx5d2y24vytxbuma",
"bciqe33uhsuaesrjk6luzxrbbimwg5ydt6x2lrieelwbr7aft4g2qwsy",
"bciqfjvqemdy7d6axvwkywcm6v66wogddvk7k6e6rps4e6zidkjvm4fy",
"bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y",
"bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a",
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy",
"bciqezep4ufkgwesldlm5etyfkgdsiickfudx7cosydcz6xtgeorn2hy",
"bciqaixkkacuuligsvtjcfdfgjgl65owtyspiiljb3vmutlgymecsiwq",
"bciqlt27ioikxnpkqq37hma7ibn5e5wpzfarbvoh77zwdkarwghtvzxa",
"bciqojan3zglnfctnmqyxvnxaha46yrnlhj77j3kw4mxadvauqepqdba",
"bciqcnbruy2q6trpvia52n2yis4t27taoz4mxkeguqz5aif7ex6rp26y",
"bciqpu7gxs3zm7i4gwp3m3cfdxwz27ixvsykdnbxrl5m5mt3xbb3b4la",
"bciqjme7csfq43oenkrsakdhaha34hgy6vdwkfffki2ank3kf6mjcguq"
],
"allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y"
},
"ghjkEnvProvInstSet____ecma": {
"installs": [
"bciqezep4ufkgwesldlm5etyfkgdsiickfudx7cosydcz6xtgeorn2hy",
Expand Down Expand Up @@ -992,28 +1015,6 @@
],
"allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y"
},
"ghjkEnvProvInstSet___ci": {
"installs": [
"bciqdtuhf425g6prb5fyupbcokttmkill6wyqk7bkphx3ueltl5mvu4q",
"bciqmvgsg7h3ohj3m7das4bznahgt6tyq7mamta3n2vorulqvml7mywq",
"bciqicdqw36v63cbrscwsgtu2htrmwmgtfoxexv4rx5d2y24vytxbuma",
"bciqe33uhsuaesrjk6luzxrbbimwg5ydt6x2lrieelwbr7aft4g2qwsy",
"bciqfjvqemdy7d6axvwkywcm6v66wogddvk7k6e6rps4e6zidkjvm4fy",
"bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y",
"bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a",
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy",
"bciqezep4ufkgwesldlm5etyfkgdsiickfudx7cosydcz6xtgeorn2hy",
"bciqaixkkacuuligsvtjcfdfgjgl65owtyspiiljb3vmutlgymecsiwq",
"bciqlt27ioikxnpkqq37hma7ibn5e5wpzfarbvoh77zwdkarwghtvzxa",
"bciqojan3zglnfctnmqyxvnxaha46yrnlhj77j3kw4mxadvauqepqdba",
"bciqcnbruy2q6trpvia52n2yis4t27taoz4mxkeguqz5aif7ex6rp26y",
"bciqpu7gxs3zm7i4gwp3m3cfdxwz27ixvsykdnbxrl5m5mt3xbb3b4la",
"bciqjme7csfq43oenkrsakdhaha34hgy6vdwkfffki2ank3kf6mjcguq"
],
"allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y"
},
"ghjkEnvProvInstSet_______task_env_gen-subs-protoc": {
"installs": [
"bciqm2rvnfe77sj6jekrm65oayuywt5lbrw33qezqjcg5rzaioc6uszy",
Expand Down Expand Up @@ -1131,6 +1132,12 @@
"id": "tasks",
"config": {
"tasks": {
"clean-node": {
"ty": "denoFile@v1",
"key": "clean-node",
"desc": "Remove all node_modules directories in tree and other js artifacts.",
"envKey": "bciqcm5whsy4tzjafjheomwtxzjxz2avqxwgb6ss5kav6fxmmy3lu4ma"
},
"clean-rust": {
"ty": "denoFile@v1",
"key": "clean-rust",
Expand Down Expand Up @@ -1355,6 +1362,7 @@
}
},
"tasksNamed": [
"clean-node",
"clean-rust",
"version-bump",
"version-print",
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/autoupdate.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: pre-commit auto-updater
on:
schedule:
- cron: "0 2 1 * *"
Expand All @@ -10,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: browniebroke/pre-commit-autoupdate-action@main
- uses: peter-evans/create-pull-request@v6
- uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pre-commit-hooks
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: nightly docker builds
on:
schedule:
- cron: "0 2 * * *"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: pr title check
run-name: checking pr title for ${{ github.event.pull_request.title || github.ref }}
on:
pull_request_target:
types:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish-website.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: publish website
run-name: publish website jobs for ${{ github.ref }}
on:
push:
branches:
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: release jobs
run-name: release jobs for ${{ github.ref }}
on:
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -319,10 +321,13 @@ jobs:
# avoid publishing pre-release versions as they don't
# support it
[[ "$(ghjk x version-print)" != *-* ]] \
&& ([ ${{ github.event_name == 'workflow_dispatch' && inputs.ovewriteArtifacts }} == 'true' ] \
&& pnpm run vscode:publish -p ${{ secrets.AZURE_DEVOPS_TOKEN }} --skip-duplicate \
|| pnpm run vscode:publish -p ${{ secrets.AZURE_DEVOPS_TOKEN }})
if [[ "$(ghjk x version-print)" != *-* ]]; then
if [ ${{ github.event_name == 'workflow_dispatch' && inputs.ovewriteArtifacts }} == 'true' ]; then
pnpm run vscode:publish -p ${{ secrets.AZURE_DEVOPS_TOKEN }} --skip-duplicate
else
pnpm run vscode:publish -p ${{ secrets.AZURE_DEVOPS_TOKEN }}
fi
fi
- uses: svenstaro/upload-release-action@v2
with:
tag: ${{ steps.latest-tag.outputs.tag }}
Expand Down Expand Up @@ -352,7 +357,10 @@ jobs:
ghjk x version-bump prerelease
echo "version=$(ghjk x version-print)" >> $GITHUB_OUTPUT
git cliff --output CHANGELOG.md
- uses: peter-evans/create-pull-request@v6
# exclude .ghjk from the changeset to avoid modifying
# the lockfile
git checkout -- .ghjk
- uses: peter-evans/create-pull-request@v7
with:
branch: bump-${{ steps.bump.outputs.version }}
delete-branch: true
Expand All @@ -364,4 +372,4 @@ jobs:
# on them, we create it as a draft PR
# the actions will then run when it's readied for review
# https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
draft: always-true
draft: "always-true"
18 changes: 10 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Test Suite
run-name: Test Suite for ${{ github.ref }}
name: test suite
run-name: test suite for ${{ github.event.pull_request.title || github.ref }}
on:
workflow_dispatch:
inputs:
debug_enabled:
tmate_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
description: |
Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate).
This disables all but the test-full jobs.
required: false
default: false
push:
Expand Down Expand Up @@ -102,7 +104,7 @@ jobs:
lint-compat:
needs: changes
if: ${{ needs.changes.outputs.full == 'true' }}
if: ${{ needs.changes.outputs.full == 'true' && !(github.event_name == 'workflow_dispatch' && inputs.tmate_enabled) }}
runs-on: "${{ matrix.os }}"
strategy:
matrix:
Expand Down Expand Up @@ -147,7 +149,7 @@ jobs:
test-website:
needs: changes
if: ${{ needs.changes.outputs.website == 'true' }}
if: ${{ needs.changes.outputs.website == 'true' && !(github.event_name == 'workflow_dispatch' && inputs.tmate_enabled) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -172,7 +174,7 @@ jobs:
bulid-docker:
needs: changes
if: ${{ needs.changes.outputs.typegate == 'true' }}
if: ${{ needs.changes.outputs.typegate == 'true' && !(github.event_name == 'workflow_dispatch' && inputs.tmate_enabled) }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -235,7 +237,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup tmate session
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
if: ${{ github.event_name == 'workflow_dispatch' && inputs.tmate_enabled }}
uses: mxschmitt/action-tmate@v3
with:
detached: true
Expand Down
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exclude = [
]

[workspace.package]
version = "0.5.0-rc.3"
version = "0.5.0-rc.4"
edition = "2021"

[workspace.dependencies]
Expand Down
6 changes: 3 additions & 3 deletions examples/templates/deno/api/example.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Policy, t, typegraph } from "jsr:@typegraph/[email protected].3/index.ts";
import { PythonRuntime } from "jsr:@typegraph/[email protected].3/runtimes/python.ts";
import { DenoRuntime } from "jsr:@typegraph/[email protected].3/runtimes/deno.ts";
import { Policy, t, typegraph } from "jsr:@typegraph/[email protected].4/index.ts";
import { PythonRuntime } from "jsr:@typegraph/[email protected].4/runtimes/python.ts";
import { DenoRuntime } from "jsr:@typegraph/[email protected].4/runtimes/deno.ts";

await typegraph("example", (g) => {
const pub = Policy.public();
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/deno/compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
typegate:
image: ghcr.io/metatypedev/typegate:v0.5.0-rc.3
image: ghcr.io/metatypedev/typegate:v0.5.0-rc.4
restart: always
ports:
- "7890:7890"
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/node/compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
typegate:
image: ghcr.io/metatypedev/typegate:v0.5.0-rc.3
image: ghcr.io/metatypedev/typegate:v0.5.0-rc.4
restart: always
ports:
- "7890:7890"
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dev": "MCLI_LOADER_CMD='npm x tsx' meta dev"
},
"dependencies": {
"@typegraph/sdk": "^0.5.0-rc.3"
"@typegraph/sdk": "^0.5.0-rc.4"
},
"devDependencies": {
"tsx": "^3.13.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/python/compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
typegate:
image: ghcr.io/metatypedev/typegate:v0.5.0-rc.3
image: ghcr.io/metatypedev/typegate:v0.5.0-rc.4
restart: always
ports:
- "7890:7890"
Expand Down
4 changes: 2 additions & 2 deletions examples/templates/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[tool.poetry]
name = "example"
version = "0.5.0-rc.3"
version = "0.5.0-rc.4"
description = ""
authors = []

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
typegraph = "0.5.0-rc.3"
typegraph = "0.5.0-rc.4"

[build-system]
requires = ["poetry-core"]
Expand Down
20 changes: 20 additions & 0 deletions ghjk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ if (Deno.build.os == "linux" && !Deno.env.has("NO_MOLD")) {
});
env("dev").install(mold);
env("oci").install(mold);
env("ci").install(mold);
}

env("_ecma").install(
Expand Down Expand Up @@ -177,3 +178,22 @@ task(
]),
{ inherit: "_rust", desc: "Clean cache of all cargo workspaces in repo." },
);

task(
"clean-node",
($) =>
$.co([
$.path("./docs/metatype.dev/node_modules"),
$.path("./docs/metatype.dev/build"),
$.path("./tests/e2e/nextjs/apollo/node_modules"),
$.path("./tests/runtimes/temporal/worker/node_modules"),
].map(async (path) => {
if (await path.exists()) {
await path.remove({ recursive: true });
}
})),
{
inherit: "_ecma",
desc: "Remove all node_modules directories in tree and other js artifacts.",
},
);
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[tool.poetry]
name = "metatype"
version = "0.5.0-rc.3"
version = "0.5.0-rc.4"
description = ""
authors = []

Expand Down
Loading

0 comments on commit 18a13d6

Please sign in to comment.