-
Notifications
You must be signed in to change notification settings - Fork 31
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(uploads): add maxFiles configuration policy to jvmId uploaded recordings #1333
feat(uploads): add maxFiles configuration policy to jvmId uploaded recordings #1333
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request blocked. web-client
submodule updates are performed automatically by CI when that repository is updated. Please revert or drop all changes to the web-client
submodule from this PR and perform any required frontend work by opening and merging a PR against cryostat-web.
757236b
to
4cb90b9
Compare
Test image available:
|
Thoughts before tests? |
4cb90b9
to
681e442
Compare
Test image available:
|
src/main/java/io/cryostat/net/web/http/api/beta/RecordingsFromIdPostHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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!
I was just seeing some front-end bug that renders duplicated archives. Try uploading an archive while in archive table view and there will be duplicate recordings.
Below, a single uploaded notifications renders an additional of 3 rows.
Probably another hook deps issue that eslint misses. Should be similar the upload table issue but we might forget to fix this too.
EDIT: See cryostatio/cryostat-web#820
I think PR is looking great. This bug probably can be solved separately on front-end.
Test image available:
|
Signed-off-by: Max Cao <macao@redhat.com>
d6e1bd9
to
6662bbe
Compare
Spotless? |
Test image available:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just needs a note added to the README describing the new variable.
Test image available:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me :D Worked well.
Welcome to Cryostat! 👋
Before contributing, make sure you have:
main
branch[chore, ci, docs, feat, fix, test]
git commit --amend --signoff
Fixes: #1306
Description of the change:
This change allows any client which posts a recording to the target-specific upload handler
RecordingsFromIdPostHandler
to specify the maxFiles parameter which keeps a set amount of archived recording files per target, depending on the given parameter. If the parameter is not specified, then it is defaulted to the env variableCRYOSTAT_PUSH_MAX_FILES
. If that env var is not specified, the global maxFiles value isInteger.MAX_INT
.Motivation for the change:
See #1306 for discussion.
How to manually test:
jvmId
.$ https --verify=no -f -v POST :8181/api/beta/recordings/${jvmId} recording@testfolder/jfr/quarkus-test-agent_default_20230109T001426Z.jfr maxFiles=1 --auth=user:pass
Notice the extra new paramter
maxFiles
. If we set it to 1, it will delete all archived files within the target except the one that was included in this upload form. If set to anything above 1, it will keep the old archived recording, plus the recent uploaded one that is included in the form.Experiment with settings, (e.g. without a
maxFiles
, this should default to the environment variable config that was either set, or defaulted toInteger.MAX_INT
)