-
Notifications
You must be signed in to change notification settings - Fork 31
feat: generate standalone admin SDK #6000
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
12 commits
Select commit
Hold shift + click to select a range
52b7a7b
feat: generate private admin SDK
walker-tx e1b370d
feat: configure admin SDK transport
walker-tx 71c8f82
fix: lock admin mutation behavior
walker-tx bf3d8b7
chore: check generated admin SDK
walker-tx f92b382
fix: tighten admin SDK generation checks
walker-tx 9cb84a8
chore: watch oops codes for SDK generation
walker-tx 9d2befa
fix: preserve admin feature compatibility
walker-tx 461395f
fix: retain SDK generation workflow during resolution
walker-tx 8ff198a
test: cover workflow-based SDK checks
walker-tx deec509
fix: address admin SDK generation review
walker-tx 2063bb6
fix: simplify generated admin SDK names
walker-tx 999bbf1
test: require admin overlay operations
walker-tx 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 |
|---|---|---|
| @@ -1,8 +1,10 @@ | ||
| # Generated files - exclude from language stats and diffs | ||
| client/dashboard/src/sdk/** linguist-generated | ||
| client/admin/src/sdk/** linguist-generated -whitespace | ||
| server/gen/** linguist-generated | ||
| server/internal/**/*.sql.go linguist-generated | ||
| openrouter/** linguist-generated | ||
| .speakeasy/*.lock linguist-generated | ||
| .speakeasy/out.openapi.yaml linguist-generated | ||
| .speakeasy/out.admin.openapi.yaml linguist-generated | ||
| **/descriptors.pb linguist-generated |
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
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,89 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| #MISE description="Test generated artifact conflict resolution with a base missing a target" | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| tmpdir=$(mktemp -d) | ||
| trap 'rm -rf "$tmpdir"' EXIT | ||
| repo="$tmpdir/repo" | ||
| mkdir -p "$repo" "$tmpdir/bin" | ||
| cp .mise-tasks/gen/resolve.sh "$repo/resolve.sh" | ||
|
|
||
| cd "$repo" | ||
| git init -q -b main | ||
| git config user.email test@example.invalid | ||
| git config user.name "Resolve Test" | ||
| mkdir -p .speakeasy client/dashboard/src/sdk server/gen | ||
| cat >.speakeasy/workflow.yaml <<'EOF' | ||
| sources: | ||
| Gram-Internal: | ||
| output: .speakeasy/out.openapi.yaml | ||
| targets: | ||
| gram-internal: | ||
| output: client/dashboard/src/sdk | ||
| EOF | ||
| printf 'base\n' >.speakeasy/openapi-hooks.yaml | ||
| printf 'base\n' >.speakeasy/out.openapi.yaml | ||
| printf 'base\n' >.speakeasy/workflow.lock | ||
| printf 'base\n' >client/dashboard/src/sdk/marker | ||
| printf 'base\n' >server/gen/marker | ||
| git add . | ||
| git commit -qm base | ||
|
|
||
| git switch -qc feature | ||
| cat >.speakeasy/workflow.yaml <<'EOF' | ||
| sources: | ||
| Gram-Internal: | ||
| output: .speakeasy/out.openapi.yaml | ||
| Gram-Admin: | ||
| output: .speakeasy/out.admin.openapi.yaml | ||
| targets: | ||
| gram-internal: | ||
| output: client/dashboard/src/sdk | ||
| gram-admin: | ||
| output: client/admin/src/sdk | ||
| EOF | ||
| printf 'feature\n' >.speakeasy/openapi-hooks.yaml | ||
| printf 'feature\n' >.speakeasy/out.openapi.yaml | ||
| printf 'feature\n' >.speakeasy/out.admin.openapi.yaml | ||
| printf 'feature\n' >.speakeasy/workflow.lock | ||
| printf 'feature\n' >client/dashboard/src/sdk/marker | ||
| printf 'feature\n' >server/gen/marker | ||
| mkdir -p client/admin/src/sdk | ||
| printf 'feature\n' >client/admin/src/sdk/marker | ||
| git add . | ||
| git commit -qm feature | ||
|
|
||
| cat >"$tmpdir/bin/mise" <<'EOF' | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
| case "$*" in | ||
| "run gen:goa-server") touch server/gen/goa-regenerated ;; | ||
| "run gen:sdk") | ||
| test "$(cat .speakeasy/openapi-hooks.yaml)" = base | ||
| test "$(cat .speakeasy/out.openapi.yaml)" = base | ||
| test "$(cat .speakeasy/out.admin.openapi.yaml)" = feature | ||
| test "$(cat .speakeasy/workflow.lock)" = base | ||
| test "$(cat client/admin/src/sdk/marker)" = feature | ||
| mkdir -p client/dashboard/src/sdk | ||
| touch client/dashboard/src/sdk/sdk-regenerated | ||
| admin_output=$(awk '/^ gram-admin:/{ target = 1; next } target && /output:/{ print $2; exit }' .speakeasy/workflow.yaml) | ||
| test "$admin_output" = client/admin/src/sdk | ||
| mkdir -p "$admin_output" | ||
| touch "$admin_output/sdk-regenerated" | ||
| ;; | ||
| *) echo "unexpected mise invocation: $*" >&2; exit 1 ;; | ||
| esac | ||
| EOF | ||
| chmod +x "$tmpdir/bin/mise" | ||
| PATH="$tmpdir/bin:$PATH" bash ./resolve.sh | ||
|
|
||
| for marker in .speakeasy/openapi-hooks.yaml .speakeasy/out.openapi.yaml .speakeasy/workflow.lock client/dashboard/src/sdk/marker server/gen/marker; do | ||
| test "$(cat "$marker")" = base | ||
| done | ||
| grep -q '^ gram-admin:' .speakeasy/workflow.yaml | ||
| test -e server/gen/goa-regenerated | ||
| test -e client/dashboard/src/sdk/sdk-regenerated | ||
| test -e client/admin/src/sdk/sdk-regenerated | ||
| test "$(cat client/admin/src/sdk/marker)" = feature |
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
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.
Uh oh!
There was an error while loading. Please reload this page.