Skip to content

Commit

Permalink
feat(graphql): reimplement GraphQL API (#294)
Browse files Browse the repository at this point in the history
Co-authored-by: Atif Ali <[email protected]>
Co-authored-by: Atif Ali <[email protected]>
  • Loading branch information
3 people authored Apr 18, 2024
1 parent 2c22fac commit 2020298
Show file tree
Hide file tree
Showing 30 changed files with 4,470 additions and 274 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/pr-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,28 +270,28 @@ jobs:
body: commentBody
});
# compare-graphql-schema:
# needs: [update-schemas]
# runs-on: ubuntu-latest
# permissions:
# pull-requests: write
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: graphql-diff
# - name: Comment schema check result
# uses: actions/github-script@v6
# with:
# script: |
# const diffFmt = s => {
# return "```diff\n" + s + "\n```";
# };
# const commentBody = ${{ needs.update-schemas.outputs.GRAPHQL_STATUS }} == '0'
# ? `No GraphQL schema changes detected.`
# : `GraphQL schema change detected:\n\n${diffFmt(require('fs').readFileSync('${{ needs.update-schemas.outputs.GRAPHQL_DIFF_FILE }}'))}`;
# github.rest.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: commentBody
# });
compare-graphql-schema:
needs: [update-schemas]
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/download-artifact@v3
with:
name: graphql-diff
- name: Comment schema check result
uses: actions/github-script@v6
with:
script: |
const diffFmt = s => {
return "```diff\n" + s + "\n```";
};
const commentBody = ${{ needs.update-schemas.outputs.GRAPHQL_STATUS }} == '0'
? `No GraphQL schema changes detected.`
: `GraphQL schema change detected:\n\n${diffFmt(require('fs').readFileSync('${{ needs.update-schemas.outputs.GRAPHQL_DIFF_FILE }}'))}`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});
6 changes: 3 additions & 3 deletions compose/cryostat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ services:
QUARKUS_HTTP_HOST: "cryostat"
QUARKUS_HTTP_PORT: ${CRYOSTAT_HTTP_PORT}
QUARKUS_HIBERNATE_ORM_LOG_SQL: "true"
CRYOSTAT_DISCOVERY_JDP_ENABLED: "true"
CRYOSTAT_DISCOVERY_PODMAN_ENABLED: "true"
CRYOSTAT_DISCOVERY_DOCKER_ENABLED: "true"
CRYOSTAT_DISCOVERY_JDP_ENABLED: ${CRYOSTAT_DISCOVERY_JDP_ENABLED:-true}
CRYOSTAT_DISCOVERY_PODMAN_ENABLED: ${CRYOSTAT_DISCOVERY_PODMAN_ENABLED:-true}
CRYOSTAT_DISCOVERY_DOCKER_ENABLED: ${CRYOSTAT_DISCOVERY_DOCKER_ENABLED:-true}
JAVA_OPTS_APPEND: "-XX:+FlightRecorder -XX:StartFlightRecording=name=onstart,settings=default,disk=true,maxage=5m -XX:StartFlightRecording=name=startup,settings=profile,disk=true,duration=30s -Dcom.sun.management.jmxremote.autodiscovery=true -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9091 -Dcom.sun.management.jmxremote.rmi.port=9091 -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=false"
restart: unless-stopped
healthcheck:
Expand Down
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-openapi</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-graphql</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>smallrye-mutiny-vertx-web-client</artifactId>
Expand Down
76 changes: 76 additions & 0 deletions schema/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ components:
type: integer
downloadUrl:
type: string
jvmId:
type: string
metadata:
$ref: '#/components/schemas/Metadata'
name:
Expand Down Expand Up @@ -382,6 +384,31 @@ paths:
- SecurityScheme: []
tags:
- Recordings
/api/beta/fs/recordings/{jvmId}:
get:
parameters:
- in: path
name: jvmId
required: true
schema:
type: string
responses:
"200":
content:
application/json:
schema:
items:
$ref: '#/components/schemas/ArchivedRecordingDirectory'
type: array
description: OK
"401":
description: Not Authorized
"403":
description: Not Allowed
security:
- SecurityScheme: []
tags:
- Recordings
/api/beta/fs/recordings/{jvmId}/{filename}:
delete:
parameters:
Expand Down Expand Up @@ -519,6 +546,30 @@ paths:
- SecurityScheme: []
tags:
- Recordings
/api/beta/recordings/{connectUrl}/{filename}/upload:
post:
parameters:
- in: path
name: connectUrl
required: true
schema:
type: string
- in: path
name: filename
required: true
schema:
type: string
responses:
"200":
description: OK
"401":
description: Not Authorized
"403":
description: Not Allowed
security:
- SecurityScheme: []
tags:
- Recordings
/api/beta/recordings/{jvmId}:
get:
parameters:
Expand Down Expand Up @@ -1242,6 +1293,31 @@ paths:
description: OK
tags:
- Discovery
/api/v2.2/graphql:
get:
responses:
"200":
description: OK
"401":
description: Not Authorized
"403":
description: Not Allowed
security:
- SecurityScheme: []
tags:
- Graph QL
post:
responses:
"200":
description: OK
"401":
description: Not Authorized
"403":
description: Not Allowed
security:
- SecurityScheme: []
tags:
- Graph QL
/api/v2/rules:
get:
responses:
Expand Down
Loading

0 comments on commit 2020298

Please sign in to comment.