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

fix(graphql): use boolean parameter for StartRecordingMutator restart #1406

Merged
merged 3 commits into from
Mar 14, 2023

Conversation

maxcao13
Copy link
Member

@maxcao13 maxcao13 commented Mar 14, 2023

Welcome to Cryostat! 👋

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 the last commit: git commit --amend --signoff

Fixes: #1403

Description of the change:

Allows restart to be specified by a boolean parameter.

How to manually test:

Try a query like:

// will fail
query($episode: String! = "ASD") { 
    targetNodes(filter: { annotations: "PORT == 9093" }) {
        doStartRecording(recording: { 
            name: "graph-itest", 
            duration: 30,
            template: "Profiling", 
            templateType: "TARGET", 
            metadata: {
                labels: {
                    cryostatiotopologygroup: $episode,
                } 
            },
            restart: "true",
        })
        { 
            name state duration 
        }
    } 
}

vs

// correct
query($episode: String! = "ASD") { 
    targetNodes(filter: { annotations: "PORT == 9093" }) {
        doStartRecording(recording: { 
            name: "graph-itest", 
            duration: 30,
            template: "Profiling", 
            templateType: "TARGET", 
            metadata: {
                labels: {
                    cryostatiotopologygroup: $episode,
                } 
            },
            restart: true,
        })
        { 
            name state duration 
        }
    } 
}

@maxcao13 maxcao13 added the fix label Mar 14, 2023
@maxcao13 maxcao13 requested review from andrewazores and tthvo March 14, 2023 02:22
@mergify mergify bot added the safe-to-test label Mar 14, 2023
@maxcao13 maxcao13 force-pushed the fix-graphql-recording-mutator branch from 1835723 to 7e9613d Compare March 14, 2023 02:23
@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1406-7e9613d7ca8ce13cb667c386e9e87c5ce2ef7267 sh smoketest.sh

tthvo
tthvo previously approved these changes Mar 14, 2023
Copy link
Member

@tthvo tthvo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks for helping :D

@andrewazores
Copy link
Member

Anything else expected or can this PR be unmarked as draft?

Signed-off-by: Max Cao <macao@redhat.com>
@maxcao13 maxcao13 marked this pull request as ready for review March 14, 2023 07:16
@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1406-ef14dfaf8903ab893f728101ebf3081ed4aa057a sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1406-64a845f27ab544395dd3626895cb823b8abb6294 sh smoketest.sh

@andrewazores andrewazores merged commit 806c2d7 into cryostatio:main Mar 14, 2023
@maxcao13 maxcao13 deleted the fix-graphql-recording-mutator branch March 14, 2023 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug] GraphQL mutator for starting recordings cannot accept restart param
3 participants