Skip to content
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

feat(graphQL): add missing subqueries/mutations #319

Merged
merged 18 commits into from
Apr 13, 2024

Conversation

aali309
Copy link
Contributor

@aali309 aali309 commented Mar 7, 2024

Welcome to Cryostat3! 👋

Before contributing, make sure you have:

  • Read the contributing guidelines
  • Linked a relevant issue which this PR resolves
  • Linked any other relevant issues, PR's, or documentation, if any
  • Resolved all conflicts, if any
  • Rebased your branch PR on top of the latest upstream main branch
  • Attached at least one of the following labels to the PR: [chore, ci, docs, feat, fix, test]
  • Signed all commits using a GPG signature

To recreate commits with GPG signature git fetch upstream && git rebase --force --gpg-sign upstream/main


Based on: #315
Fixes #322

Description of the change:

This change allows an environment variable to be configured so that...

Motivation for the change:

This change is helpful because users may want to...

How to manually test:

  1. cd src/main/webui
  2. checkout to correspondig PR gh pr checkout 1227 or git checkout + PR
  3. cd -
  4. ./mvnw clean package ; podman image prune -f ; ./smoketest.bash -O
  5. Create a new recording or using the existing recordings try to add new labels, edit the labels and delete/remove and verify all work as expected.
  6. Archive the recordings and try the same, add, edit and delete the labels and see they work as expected.

@aali309
Copy link
Contributor Author

aali309 commented Mar 13, 2024

/build_test

Copy link

Workflow started at 3/13/2024, 1:21:37 PM. View Actions Run.

Copy link

CI build and push: At least one test failed ❌ (JDK17)
https://github.com/cryostatio/cryostat3/actions/runs/8268916468

Copy link

CI build and push: At least one test failed ❌ (JDK21)
https://github.com/cryostatio/cryostat3/actions/runs/8268916468

@aali309
Copy link
Contributor Author

aali309 commented Mar 13, 2024

/build_test

Copy link

Workflow started at 3/13/2024, 1:47:04 PM. View Actions Run.

Copy link

CI build and push: All tests pass ✅ (JDK21)
https://github.com/cryostatio/cryostat3/actions/runs/8269236271

Copy link

CI build and push: At least one test failed ❌ (JDK17)
https://github.com/cryostatio/cryostat3/actions/runs/8269236271

@aali309
Copy link
Contributor Author

aali309 commented Mar 13, 2024

/build_test

Copy link

Workflow started at 3/13/2024, 4:20:25 PM. View Actions Run.

Copy link

CI build and push: All tests pass ✅ (JDK21)
https://github.com/cryostatio/cryostat3/actions/runs/8271051291

Copy link

CI build and push: All tests pass ✅ (JDK17)
https://github.com/cryostatio/cryostat3/actions/runs/8271051291

@andrewazores
Copy link
Member

Looking good. Could you also prepare a corresponding -web PR to update the frontend? It will have similar changes to what I did here: cryostatio/cryostat-web#1224

The end result of this PR and the frontend PR should be that you can edit recording labels (on both active and archived recordings):

image

@andrewazores
Copy link
Member

It might be easier to rebase on top of #315 since that's what also makes the target { recordings { archived } } -> target { archivedRecordings { } } change.

Copy link

CI build and push: At least one test failed ❌ (JDK17)
https://github.com/cryostatio/cryostat3/actions/runs/8394488950

Copy link

CI build and push: All tests pass ✅ (JDK21)
https://github.com/cryostatio/cryostat3/actions/runs/8394488950

Copy link

OpenAPI schema change detected:

diff --git a/schema/openapi.yaml b/schema/openapi.yaml
index 95010a6..ef6a8d4 100644
--- a/schema/openapi.yaml
+++ b/schema/openapi.yaml
@@ -24,20 +24,22 @@ components:
             type: string
           type: object
       type: object
     ArchivedRecording:
       properties:
         archivedTime:
           format: int64
           type: integer
         downloadUrl:
           type: string
+        jvmId:
+          type: string
         metadata:
           $ref: '#/components/schemas/Metadata'
         name:
           type: string
         reportUrl:
           type: string
         size:
           format: int64
           type: integer
       type: object
@@ -375,20 +377,45 @@ paths:
                 type: array
           description: OK
         "401":
           description: Not Authorized
         "403":
           description: Not Allowed
       security:
         - 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:
         - in: path
           name: filename
           required: true
           schema:
             type: string
         - in: path
           name: jvmId
@@ -1240,20 +1267,45 @@ paths:
             application/json:
               schema:
                 additionalProperties:
                   additionalProperties:
                     type: string
                   type: object
                 type: object
           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:
         "200":
           content:
             application/json:
               schema:
                 $ref: '#/components/schemas/V2Response'
           description: OK
         "401":

@aali309
Copy link
Contributor Author

aali309 commented Mar 22, 2024

/build_test

Copy link

Workflow started at 3/22/2024, 4:07:44 PM. View Actions Run.

Copy link

CI build and push: All tests pass ✅ (JDK21)
https://github.com/cryostatio/cryostat3/actions/runs/8395852036

Copy link

OpenAPI schema change detected:

diff --git a/schema/openapi.yaml b/schema/openapi.yaml
index 95010a6..ef6a8d4 100644
--- a/schema/openapi.yaml
+++ b/schema/openapi.yaml
@@ -24,20 +24,22 @@ components:
             type: string
           type: object
       type: object
     ArchivedRecording:
       properties:
         archivedTime:
           format: int64
           type: integer
         downloadUrl:
           type: string
+        jvmId:
+          type: string
         metadata:
           $ref: '#/components/schemas/Metadata'
         name:
           type: string
         reportUrl:
           type: string
         size:
           format: int64
           type: integer
       type: object
@@ -375,20 +377,45 @@ paths:
                 type: array
           description: OK
         "401":
           description: Not Authorized
         "403":
           description: Not Allowed
       security:
         - 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:
         - in: path
           name: filename
           required: true
           schema:
             type: string
         - in: path
           name: jvmId
@@ -1240,20 +1267,45 @@ paths:
             application/json:
               schema:
                 additionalProperties:
                   additionalProperties:
                     type: string
                   type: object
                 type: object
           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:
         "200":
           content:
             application/json:
               schema:
                 $ref: '#/components/schemas/V2Response'
           description: OK
         "401":

Copy link

CI build and push: All tests pass ✅ (JDK17)
https://github.com/cryostatio/cryostat3/actions/runs/8395852036

@aali309
Copy link
Contributor Author

aali309 commented Apr 1, 2024

/build_test

Copy link

github-actions bot commented Apr 1, 2024

Workflow started at 4/1/2024, 3:19:51 PM. View Actions Run.

Copy link

github-actions bot commented Apr 1, 2024

CI build and push: All tests pass ✅ (JDK21)
https://github.com/cryostatio/cryostat3/actions/runs/8512578578

Copy link

github-actions bot commented Apr 1, 2024

OpenAPI schema change detected:

diff --git a/schema/openapi.yaml b/schema/openapi.yaml
index 95010a6..ef6a8d4 100644
--- a/schema/openapi.yaml
+++ b/schema/openapi.yaml
@@ -24,20 +24,22 @@ components:
             type: string
           type: object
       type: object
     ArchivedRecording:
       properties:
         archivedTime:
           format: int64
           type: integer
         downloadUrl:
           type: string
+        jvmId:
+          type: string
         metadata:
           $ref: '#/components/schemas/Metadata'
         name:
           type: string
         reportUrl:
           type: string
         size:
           format: int64
           type: integer
       type: object
@@ -375,20 +377,45 @@ paths:
                 type: array
           description: OK
         "401":
           description: Not Authorized
         "403":
           description: Not Allowed
       security:
         - 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:
         - in: path
           name: filename
           required: true
           schema:
             type: string
         - in: path
           name: jvmId
@@ -1240,20 +1267,45 @@ paths:
             application/json:
               schema:
                 additionalProperties:
                   additionalProperties:
                     type: string
                   type: object
                 type: object
           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:
         "200":
           content:
             application/json:
               schema:
                 $ref: '#/components/schemas/V2Response'
           description: OK
         "401":

Copy link

github-actions bot commented Apr 1, 2024

CI build and push: All tests pass ✅ (JDK17)
https://github.com/cryostatio/cryostat3/actions/runs/8512578578

@andrewazores
Copy link
Member

Server side looks great, just a couple of minor notes above but otherwise this is just about ready to merge.

@aali309
Copy link
Contributor Author

aali309 commented Apr 13, 2024

/build_test

Copy link

Workflow started at 4/12/2024, 8:58:45 PM. View Actions Run.

Copy link

OpenAPI schema change detected:

diff --git a/schema/openapi.yaml b/schema/openapi.yaml
index 95010a6..ef6a8d4 100644
--- a/schema/openapi.yaml
+++ b/schema/openapi.yaml
@@ -24,20 +24,22 @@ components:
             type: string
           type: object
       type: object
     ArchivedRecording:
       properties:
         archivedTime:
           format: int64
           type: integer
         downloadUrl:
           type: string
+        jvmId:
+          type: string
         metadata:
           $ref: '#/components/schemas/Metadata'
         name:
           type: string
         reportUrl:
           type: string
         size:
           format: int64
           type: integer
       type: object
@@ -375,20 +377,45 @@ paths:
                 type: array
           description: OK
         "401":
           description: Not Authorized
         "403":
           description: Not Allowed
       security:
         - 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:
         - in: path
           name: filename
           required: true
           schema:
             type: string
         - in: path
           name: jvmId
@@ -1240,20 +1267,45 @@ paths:
             application/json:
               schema:
                 additionalProperties:
                   additionalProperties:
                     type: string
                   type: object
                 type: object
           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:
         "200":
           content:
             application/json:
               schema:
                 $ref: '#/components/schemas/V2Response'
           description: OK
         "401":

Copy link

CI build and push: All tests pass ✅ (JDK17)
https://github.com/cryostatio/cryostat3/actions/runs/8669811913

@andrewazores andrewazores merged commit f23774c into cryostatio:graphql Apr 13, 2024
8 checks passed
@aali309 aali309 deleted the missingSubqueries branch July 23, 2024 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request safe-to-test
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants