-
Notifications
You must be signed in to change notification settings - Fork 25
Convert E2Es to examples #379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
123 commits
Select commit
Hold shift + click to select a range
8564f67
setup
enisdenjo 7d8f967
refactor and convert mesh.config.ts serviceports
enisdenjo f21889b
transform mesh config
enisdenjo 9971019
log a lot
enisdenjo a1ba36e
throw, no silence
enisdenjo 97f7de2
lockfile
enisdenjo 5fae15a
transform services
enisdenjo 85def33
dest and write file
enisdenjo 5dbf035
logs
enisdenjo 9554e22
unused
enisdenjo ec5b733
package json
enisdenjo 08b1cf2
internal proc pkg
enisdenjo 14693d2
type module internal pks
enisdenjo b8e608a
scripts install and try
enisdenjo 918b43e
proc from proc and wait for port in proc
enisdenjo b6e4d86
test with waitforport
enisdenjo de8af19
dest must not exist
enisdenjo d778367
no prettify examples
enisdenjo 06c64f0
convert directly e2e and no zod
enisdenjo 82a212a
optionally start services and compose also in series
enisdenjo 4a0de58
comment
enisdenjo 4e5420b
workflow
enisdenjo 69db75f
shorter name
enisdenjo 690ea60
bin directly with tsx
enisdenjo 530c9a0
format and commit and only examples*
enisdenjo d376948
lockfile
enisdenjo ab15032
format
enisdenjo c4c9cc9
__dirname
enisdenjo 0dda049
from url
enisdenjo 0588efb
retain path when downloading
enisdenjo 85c9502
docs(examples): converted from e2es
enisdenjo 552bf90
sandbox config
enisdenjo 914912d
devbox
enisdenjo 4bf2683
try with sandbox config
enisdenjo 8dc3914
disable coommit
enisdenjo 9fe4177
devcontainer forces devbox
enisdenjo ae333f4
no run at start
enisdenjo 2b26335
run services in background
enisdenjo 2156a5e
sleep 3
enisdenjo f559ee5
remove extra quotes
enisdenjo 194feb9
runatstart
enisdenjo 9cab1de
run gateway
enisdenjo 273dc6f
service one by one and wait
enisdenjo 4fa5eb3
foo then bar
enisdenjo 0fda2b9
more retries
enisdenjo ea54c8c
ignore examples specifically
enisdenjo 40601b5
tasks, test, dispose and friends
enisdenjo 7ba4b3b
commit and clean
enisdenjo 840b82f
writefilemkdir codesandbox tasks
enisdenjo 8ce4e50
no commit author
enisdenjo 37cd2d1
docs(examples): converted from e2es
enisdenjo 9638cfb
longer service availability retry wait
enisdenjo e1f9c5b
resetauthor
enisdenjo b96e5e2
proper aborts on proper procs
enisdenjo 7ce86ee
more abort timeout for setup tasks
enisdenjo 78c3914
all files in examples are subject to commiting
enisdenjo aa081cf
diff and examples/
enisdenjo ad80295
include hidden files
enisdenjo e268da0
root examples
enisdenjo 6d1d49a
supergraph from root examples
enisdenjo 3a6dbd9
no leading slash
enisdenjo fd1b8b5
ommit author
enisdenjo fc1ff21
docs(examples): converted from e2es
github-actions[bot] 8dd87a5
transform service ports and begin with testing
enisdenjo 3361360
using opts directly
enisdenjo 0c6a284
we have lines, no need for numbering
enisdenjo 566e19b
use test files and better stuff
enisdenjo c563a74
waitforport needs protocol
enisdenjo 48bc2fb
docs(examples): converted from e2es
github-actions[bot] 32eb91e
typecheck internal tests
enisdenjo 995cd37
detect create example setup
enisdenjo 2dc0dd3
wip
enisdenjo 065bcc0
use ts parser and parse
enisdenjo a680259
convert example files
enisdenjo 2a38aa4
only copy non js files
enisdenjo 86655e5
no return
enisdenjo e28f177
copy mkdir
enisdenjo 22d7b83
has example setup
enisdenjo d46be2b
composes with apollo
enisdenjo 889778a
empty devdeps once moved
enisdenjo e23aca2
specify federation_version
enisdenjo f19f4eb
add federation-example
enisdenjo f3df1bc
break after finding services
enisdenjo 4c02b6f
perform healthcheck
enisdenjo d06da5c
transform gatway config
enisdenjo cb834be
custom parser
enisdenjo 16bcd8b
more examples
enisdenjo 3be395d
composes with apollo if not with mesh
enisdenjo 29f3f00
resolve workspace versions
enisdenjo 0bc260f
copy extras
enisdenjo 58d2d41
cpmkdir
enisdenjo c4391ee
run custom scripts
enisdenjo 25a6bfb
support https protocol
enisdenjo 0026ec7
apollo server in e2e hmac auth https
enisdenjo ae315f3
dont copy dockerfiles
enisdenjo 3425370
moreeee examples
enisdenjo ce00332
disclaimer
enisdenjo b307ecf
ignore internal tests for leaks
enisdenjo 1340de7
use 0.0.0.0 instead of localhost
enisdenjo 5adc80c
accept elv2 license
enisdenjo a1f68e0
dont fail fast for now
enisdenjo cf392bc
distinct names for artifact uploads
enisdenjo 8f43d37
no fail fast
enisdenjo eec6672
use pattern instead
enisdenjo ff539ea
merge multiple
enisdenjo c06384c
bot commits, inspect and skip
enisdenjo 57064b5
skip node_modules when uploading
enisdenjo fc79706
commit using bot
enisdenjo 0a871b9
docs(examples): converted from e2es
theguild-bot eed1b73
proc uses stack and missed replacer
enisdenjo c58dcef
custom interval
enisdenjo 05ca2cd
rename hmac-auth-https
enisdenjo 498c3e7
proper package name in e2e
enisdenjo 3dfd03d
use spawn from tenv
enisdenjo 7ae57e8
use whatwgnode fetch
enisdenjo 885c2fb
docs(examples): converted from e2es
theguild-bot c3a8763
ignore benchs
enisdenjo 349aa09
ignore .pem files globally
enisdenjo 27743c6
docs(examples): converted from e2es
theguild-bot b7e5223
no snaps
enisdenjo 65b6440
thanks windows
enisdenjo 429e38c
docs(examples): converted from e2es
theguild-bot 74c7088
remove stuff
enisdenjo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| name: Examples | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| # NOTE: github.event.head_commit.message is not available on pull_request events | ||
| head-commit: | ||
| name: Inspect head commit | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| message: ${{ steps.commit.outputs.message }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{github.event.pull_request.head.sha}} | ||
| - name: Inspect | ||
| id: commit | ||
| run: echo "message=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| convert: | ||
| needs: [head-commit] | ||
| if: "${{needs.head-commit.outputs.message != 'docs(examples): converted from e2es'}}" | ||
| strategy: | ||
| matrix: | ||
| e2e: | ||
| - extra-fields | ||
| - federation-example | ||
| - federation-mixed | ||
| - file-upload | ||
| - apq-subgraphs | ||
| - federation-subscriptions-passthrough | ||
| - hmac-auth-https | ||
| - interface-additional-resolvers | ||
| - json-schema-subscriptions | ||
| - openapi-additional-resolvers | ||
| - openapi-arg-rename | ||
| - openapi-javascript-wiki | ||
| - openapi-subscriptions | ||
| - programmatic-batching | ||
| - subscriptions-with-transforms | ||
| - type-merging-batching | ||
| name: Convert ${{matrix.e2e}} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Set up env | ||
| uses: the-guild-org/shared-config/setup@v1 | ||
| - name: Convert | ||
| run: yarn workspace @internal/examples run start ${{matrix.e2e}} true | ||
| - name: Upload | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: example-${{matrix.e2e}} | ||
| # include all files and folders starting with a dot (.) | ||
| include-hidden-files: true | ||
| # > If multiple paths are provided as input, the least common ancestor of all the search paths will be used as the root directory of the artifact. | ||
| # https://github.com/actions/upload-artifact#upload-using-multiple-paths-and-exclusions | ||
| # | ||
| # Because of this, we include the root README.md to maintain the paths during artifact downloads | ||
| path: | | ||
| README.md | ||
| examples/${{matrix.e2e}} | ||
| !examples/${{matrix.e2e}}/node_modules | ||
|
|
||
| commit: | ||
| needs: [convert] | ||
| name: Commit | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| token: ${{secrets.BOT_GITHUB_TOKEN}} | ||
| - name: Download | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: example-* | ||
| merge-multiple: true | ||
| - name: Diff | ||
| run: git diff --pretty | ||
| - name: Commit | ||
| uses: stefanzweifel/git-auto-commit-action@v5 | ||
| with: | ||
| file_pattern: examples/ | ||
| commit_message: 'docs(examples): converted from e2es' | ||
| commit_user_name: theguild-bot | ||
| commit_user_email: [email protected] | ||
| commit_author: theguild-bot <[email protected]> # dont use the actor as an author | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,3 +10,5 @@ tsconfig.tsbuildinfo | |
| sea-prep.blob | ||
| hive-gateway | ||
| .cache/ | ||
| *.pem | ||
| /examples/**/*/supergraph.graphql | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,4 @@ __generated__ | |
| !.changeset/config.json | ||
| .wrangler/ | ||
| *.Dockerfile | ||
| /examples/ | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| > [!CAUTION] | ||
| > These examples are auto-generated using the [e2e](/e2e) tests, do NOT modify them directly! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| "setupTasks": [ | ||
| { | ||
| "name": "Install", | ||
| "command": "npm i" | ||
| }, | ||
| { | ||
| "name": "Start service greetings", | ||
| "command": "npm run service:greetings &" | ||
| }, | ||
| { | ||
| "name": "Wait for service greetings", | ||
| "command": "curl --retry-connrefused --retry 10 --retry-delay 3 http://0.0.0.0:4001" | ||
| }, | ||
| { | ||
| "name": "Compose", | ||
| "command": "npm run compose" | ||
| } | ||
| ], | ||
| "tasks": { | ||
| "gateway": { | ||
| "name": "Hive Gateway", | ||
| "runAtStart": true, | ||
| "command": "npm run gateway", | ||
| "preview": { | ||
| "port": 4000 | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "name": "Node.js", | ||
| "image": "mcr.microsoft.com/devcontainers/javascript-node:20" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import { defineConfig } from '@graphql-hive/gateway'; | ||
|
|
||
| let fetchCnt = 0; | ||
| export const gatewayConfig = defineConfig({ | ||
| transportEntries: { | ||
| greetings: { | ||
| options: { | ||
| apq: true, | ||
| }, | ||
| }, | ||
| }, | ||
| plugins: () => [ | ||
| { | ||
| onFetch({ options }) { | ||
| fetchCnt++; | ||
| process.stdout.write(`fetch ${fetchCnt} ${options.body}\n`); | ||
| }, | ||
| }, | ||
| ], | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { | ||
| defineConfig, | ||
| loadGraphQLHTTPSubgraph, | ||
| } from '@graphql-mesh/compose-cli'; | ||
|
|
||
| export const composeConfig = defineConfig({ | ||
| subgraphs: [ | ||
| { | ||
| sourceHandler: loadGraphQLHTTPSubgraph('greetings', { | ||
| endpoint: `http://localhost:${4001}/graphql`, | ||
| }), | ||
| }, | ||
| ], | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will create workflows for each example which might cause a bigger queue. But instead maybe we can run this once and configure converted e2es in a file, no?