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

chore(db): apply active record validation constraints #257

Merged
merged 4 commits into from
Jan 23, 2024

Conversation

andrewazores
Copy link
Member

@andrewazores andrewazores commented Jan 22, 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: #256
Fixes #259

How to manually test (JPA validation changes):

  1. These NotNull/NotBlank/etc. changes should be mostly invisible in normal operation, since the UI and the API layer already perform checks and validations on these things so that nice UI messages can be displayed to the user as hints before submitting requests, or so that the server can return informative error messages on bad requests that do come through. Applying these checks at the persistence layer is the last line of defense to ensure that invalid data is not entered into the database.
  2. The other @JsonProperty etc. changes ensure that particular fields do not get read or written when they should not be. For example, on Credential, they ensure that if we make a mistake and write out a Credential object through the API layer, the username and password are not actually sent out to the client.
  3. ./mvnw clean verify ; podman image prune -f
  4. ./smoketest.bash -Ogtr
  5. Open web UI and test out various features, make sure things still work the same as before this PR.

How to manually test (Discovery tree changes):

  1. ./mvnw clean verify ; podman image prune -f
  2. ./smoketest.bash -Ogtr and wait some time for startup to complete and agents to register
  3. http --auth=user:pass :8080/api/v3/targets and ensure all targets, including Cryostat Agent instances, appear
  4. http --auth=user:pass :8080/api/v3/discovery and ensure all targets, including Cryostat Agent instances, appear

@andrewazores andrewazores added the chore Refactor, rename, cleanup, etc. label Jan 22, 2024
@andrewazores
Copy link
Member Author

/build_test

Copy link

Workflow started at 1/22/2024, 2:29:45 PM. View Actions Run.

Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat3/actions/runs/7616363983

1 similar comment
Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat3/actions/runs/7616363983

@andrewazores andrewazores force-pushed the activerecord-validations branch from ff121fe to 27fa381 Compare January 22, 2024 20:26
@andrewazores
Copy link
Member Author

/build_test

Copy link

Workflow started at 1/22/2024, 3:36:54 PM. View Actions Run.

Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat3/actions/runs/7617055530

1 similar comment
Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat3/actions/runs/7617055530

@andrewazores
Copy link
Member Author

/build_test

Copy link

Workflow started at 1/22/2024, 5:33:18 PM. View Actions Run.

Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat3/actions/runs/7618232099

1 similar comment
Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat3/actions/runs/7618232099

@andrewazores andrewazores merged commit cfa3230 into cryostatio:main Jan 23, 2024
11 checks passed
@andrewazores andrewazores deleted the activerecord-validations branch January 23, 2024 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Refactor, rename, cleanup, etc.
Projects
None yet
2 participants