Skip to content

Commit d9031e7

Browse files
committed
Merge branch 'main' of github.com:wundergraph/cosmo into suvij/eng-6332-store-persisted-operation-content-in-the-database-and-show
2 parents 0983007 + f57904d commit d9031e7

File tree

50 files changed

+3692
-2585
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3692
-2585
lines changed

.github/workflows/router-ci.yaml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: Router CI
22
on:
33
pull_request:
44
paths:
5-
- "composition-go/**/*"
6-
- "demo/**/*"
7-
- "router/**/*"
8-
- "router-tests/**/*"
9-
- "connect/**/*"
10-
- ".github/workflows/router-ci.yaml"
5+
- 'composition-go/**/*'
6+
- 'demo/**/*'
7+
- 'router/**/*'
8+
- 'router-tests/**/*'
9+
- 'connect/**/*'
10+
- '.github/workflows/router-ci.yaml'
1111

1212
concurrency:
1313
group: ${{github.workflow}}-${{github.head_ref}}
@@ -150,6 +150,22 @@ jobs:
150150
password: ${{secrets.DOCKER_PASSWORD}}
151151
ports:
152152
- 6379:6379
153+
kafka:
154+
image: bitnami/kafka:3.7.0
155+
env:
156+
KAFKA_ENABLE_KRAFT: yes
157+
KAFKA_CFG_PROCESS_ROLES: controller,broker
158+
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
159+
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
160+
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
161+
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 1@localhost:9093
162+
KAFKA_CFG_TRANSACTION_PARTITION_VERIFICATION_ENABLE: false
163+
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
164+
KAFKA_CFG_NODE_ID: 1
165+
ALLOW_PLAINTEXT_LISTENER: yes
166+
KAFKA_KRAFT_CLUSTER_ID: XkpGZQ27R3eTl3OdTm2LYA # 16 byte base64-encoded UUID
167+
ports:
168+
- '9092:9092'
153169
steps:
154170
- uses: actions/checkout@v4
155171
- uses: ./.github/actions/go
@@ -205,14 +221,14 @@ jobs:
205221
dockerfile: router/Dockerfile
206222
token: ${{secrets.GITHUB_TOKEN}}
207223
image_name: router
208-
image_description: "Cosmo Router"
224+
image_description: 'Cosmo Router'
209225
image_platforms: 'linux/amd64'
210226
load_Image: 'true'
211227
push: 'false'
212228

213229
- uses: ./.github/actions/image-scan
214230
with:
215-
name: "Router"
231+
name: 'Router'
216232
github_token: ${{secrets.GITHUB_TOKEN}}
217233
image_ref: 'ghcr.io/wundergraph/cosmo/router:sha-${{ github.sha }}'
218234

@@ -233,4 +249,4 @@ jobs:
233249
dockerfile: router/Dockerfile
234250
token: ${{secrets.GITHUB_TOKEN}}
235251
image_name: router
236-
image_description: "Cosmo Router"
252+
image_description: 'Cosmo Router'

.github/workflows/studio-ci.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: Studio CI
22
on:
33
pull_request:
44
paths:
5-
- "studio/**/*"
6-
- "connect/**/*"
7-
- ".github/workflows/studio-ci.yaml"
5+
- 'studio/**/*'
6+
- 'connect/**/*'
7+
- 'shared/**/*'
8+
- 'composition/**/*'
9+
- '.github/workflows/studio-ci.yaml'
810

911
concurrency:
1012
group: ${{github.workflow}}-${{github.head_ref}}
@@ -69,4 +71,4 @@ jobs:
6971
dockerfile: studio/Dockerfile
7072
token: ${{secrets.GITHUB_TOKEN}}
7173
image_name: studio
72-
image_description: "Cosmo Studio"
74+
image_description: 'Cosmo Studio'

cli/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ Binaries are attached to the github release otherwise all images can be found [h
44
All notable changes to this project will be documented in this file.
55
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
66

7+
## [0.75.3](https://github.com/wundergraph/cosmo/compare/wgc@0.75.2...wgc@0.75.3) (2025-02-26)
8+
9+
### Bug Fixes
10+
11+
* improve wgc auth login and router compatibility-version ([#1636](https://github.com/wundergraph/cosmo/issues/1636)) ([6946363](https://github.com/wundergraph/cosmo/commit/6946363024e49b6170a9553728ac3ecc973ce394)) (@Aenimus)
12+
13+
## [0.75.2](https://github.com/wundergraph/cosmo/compare/wgc@0.75.1...wgc@0.75.2) (2025-02-26)
14+
15+
### Bug Fixes
16+
17+
* **cli:** resolve broken console outputs ([#1623](https://github.com/wundergraph/cosmo/issues/1623)) ([6aa67af](https://github.com/wundergraph/cosmo/commit/6aa67aff01f83de5f4a195de32e5674f337ec325)) (@SkArchon)
18+
719
## [0.75.1](https://github.com/wundergraph/cosmo/compare/wgc@0.75.0...wgc@0.75.1) (2025-02-25)
820

921
### Bug Fixes

cli/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wgc",
3-
"version": "0.75.1",
3+
"version": "0.75.3",
44
"description": "The official CLI tool to manage the GraphQL Federation Platform Cosmo",
55
"type": "module",
66
"main": "dist/src/index.js",
@@ -41,7 +41,6 @@
4141
"@connectrpc/connect": "^1.4.0",
4242
"@connectrpc/connect-node": "^1.4.0",
4343
"@graphql-tools/utils": "^10.2.2",
44-
"@scarf/scarf": "^1.3.0",
4544
"@wundergraph/composition": "workspace:*",
4645
"@wundergraph/cosmo-connect": "workspace:*",
4746
"@wundergraph/cosmo-shared": "workspace:*",

cli/src/commands/auth/commands/login.ts

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ import open from 'open';
33
import pc from 'picocolors';
44
import jwtDecode from 'jwt-decode';
55
import inquirer from 'inquirer';
6+
import { EnumStatusCode } from '@wundergraph/cosmo-connect/dist/common/common_pb';
7+
import ora from 'ora';
68
import { BaseCommandOptions } from '../../../core/types/types.js';
79
import { DecodedAccessToken, performDeviceAuth, startPollingForAccessToken } from '../utils.js';
810
import { updateConfigFile } from '../../../utils.js';
11+
import { getBaseHeaders } from '../../../core/config.js';
912

1013
export default (opts: BaseCommandOptions) => {
1114
const loginCommand = new Command('login');
@@ -45,16 +48,51 @@ export default (opts: BaseCommandOptions) => {
4548
program.error('Could not perform authentication. Please try again');
4649
}
4750

48-
const organizations = new Set(decoded.groups.map((group) => group.split('/')[1]));
51+
const organizationSlugs = new Set(decoded.groups.map((group) => group.split('/')[1]));
52+
53+
const organizationSlugByDisplayKey = new Map<string, string>();
54+
const organizationKeys: Array<string> = [];
55+
const spinner = ora('Fetching organizations...').start();
56+
for (const organizationSlug of organizationSlugs) {
57+
const headers = getBaseHeaders();
58+
const response = await opts.client.platform.getOrganizationBySlug(
59+
{
60+
slug: organizationSlug,
61+
},
62+
{
63+
headers: {
64+
...headers,
65+
authorization: `Bearer ${accessTokenResp.response.accessToken}`,
66+
'cosmo-org-slug': organizationSlug,
67+
},
68+
},
69+
);
70+
if (!response.response || response.response.code !== EnumStatusCode.OK || !response.organization) {
71+
organizationKeys.push(organizationSlug);
72+
organizationSlugByDisplayKey.set(organizationSlug, organizationSlug);
73+
continue;
74+
}
75+
const organizationKey = `${response.organization.name} (${organizationSlug})`;
76+
organizationKeys.push(organizationKey);
77+
organizationSlugByDisplayKey.set(organizationKey, organizationSlug);
78+
}
79+
80+
spinner.stop();
4981

5082
const selectedOrganization = await inquirer.prompt({
51-
name: 'organizationSlug',
83+
name: 'organizationKey',
5284
type: 'list',
5385
message: 'Select Organization:',
54-
choices: [...organizations],
86+
choices: organizationKeys,
5587
});
5688

57-
updateConfigFile({ ...accessTokenResp.response, organizationSlug: selectedOrganization.organizationSlug });
89+
const organizationSlug = organizationSlugByDisplayKey.get(selectedOrganization.organizationKey);
90+
91+
if (!organizationSlug) {
92+
program.error('Unable to login.');
93+
}
94+
95+
updateConfigFile({ ...accessTokenResp.response, organizationSlug });
5896

5997
console.log(pc.green('Logged in Successfully!'));
6098
});

cli/src/commands/router/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default (opts: BaseCommandOptions) => {
3131
);
3232

3333
cmd.hook('preAction', async (thisCmd) => {
34-
if (['compose', 'download-binary'].includes(thisCmd.args[0])) {
34+
if (['compose', 'download-binary', 'compatibility-version'].includes(thisCmd.args[0])) {
3535
return;
3636
}
3737
await checkAuth();

0 commit comments

Comments
 (0)