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(jvmId): correct query for Targets with null jvmId (backport #496) #502

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Jun 6, 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


Fixes: #495

Description of the change:

Corrects a database query. Previously it queried with find("id", (String) null), which generates a SQL query like select from Target where jvmId = null and returns no results, even when there are targets with null JVM IDs. The new query is slightly different: select from Target where jvmId is null, with the is null being the significant difference. With this the database query correctly comes back with the targets with a null JVM ID.

https://stackoverflow.com/questions/9581745/sql-is-null-and-null

Motivation for the change:

This fixes the Target persist hook that is responsible for checking if newly stored credentials apply to targets, checking for targets which do not yet have a JVM ID, and then using the new credentials to try to set the target's JVM ID.

How to manually test:

  1. Check out and build PR
  2. ./smoketest.bash -Ot
  3. Go to Topology, confirm that two of the vertx-fib-demo targets have a warning icon and no JVM ID
  4. Go to Security and define a new credential: target.alias.contains('andrew'), admin:adminpass123. The CredentialsStored notification should appear, and so should a target update notification for each target
  5. Go back to Topology. The two targets should now have no warning icon and should have a JVM ID

This is an automatic backport of pull request #496 done by [Mergify](https://mergify.com).

@andrewazores
Copy link
Member

/build_test

Copy link

github-actions bot commented Jun 6, 2024

Workflow started at 6/6/2024, 2:41:31 PM. View Actions Run.

Copy link

github-actions bot commented Jun 6, 2024

No OpenAPI schema changes detected.

Copy link

github-actions bot commented Jun 6, 2024

No GraphQL schema changes detected.

Copy link

github-actions bot commented Jun 6, 2024

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

@andrewazores andrewazores merged commit 819c451 into cryostat-v3.0 Jun 6, 2024
13 of 14 checks passed
@mergify mergify bot deleted the mergify/bp/cryostat-v3.0/pr-496 branch June 6, 2024 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant