-
Notifications
You must be signed in to change notification settings - Fork 17
RHELMISC-4745: Add ability to bring up previous session #487
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
base: master
Are you sure you want to change the base?
Conversation
a94ca1f
to
71d5c6c
Compare
I'm not a fan of this idea. It brings significant complexity similar to |
71d5c6c
to
7e1ff8a
Compare
7e1ff8a
to
8a79a7e
Compare
8a79a7e
to
0ba68bc
Compare
72f53ca
to
dd5ec70
Compare
a63b74b
to
0f480a0
Compare
0f480a0
to
df1cc61
Compare
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.
The current implementation will leave an immature session if an error happens before clients get configured. Save the session after it is fully initialized (i.e., all clients are configured).
But this is one of features, you can bring up VM`s for checking what's goin on and where it's crash |
df1cc61
to
1684f10
Compare
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 Overview
This PR adds the ability to bring up a previous session by introducing session management and adjusting workspace and client configuration flows accordingly. Key changes include:
- Introducing a new Session model (lib/session.rb) with save/load functionality.
- Updating project initialization and workspace restoration logic (lib/project.rb and related files).
- Extending CLI options to support session-related arguments and refining client and test configurations based on session status.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
lib/setupmanagers/qemuhck/qemu_machine.rb | Added "configured" flag to the machine options hash and adjusted instance variable usage. |
lib/setupmanagers/hckstudio.rb | Early return added when project is restored to prevent redundant pool creation. |
lib/setupmanagers/hckclient.rb | Modified client configuration logic to account for a restored session condition. |
lib/session.rb | New Session model added, providing save and load methods for session management. |
lib/project.rb | Updated initialization to accept a session, introduced workspace restore and save. |
lib/engines/hcktest/tools.rb | Modified conditional expression for results handling (potential issue identified). |
lib/engines/hcktest/tests.rb | Removed an extraneous blank line. |
lib/engines/hcktest/hcktest.rb | Adjusted restored session handling, updated snapshot options, and refined test logic. |
lib/cli.rb | Refactored CLI options using T::Struct and added session parameters. |
lib/all.rb | Added autoload for the new Session module. |
b6b7346
to
76061d7
Compare
76061d7
to
ca47498
Compare
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.
Please look at unresolved comments:
808104f
to
7158cf5
Compare
7158cf5
to
af17bd2
Compare
lib/engines/hcktest/hcktest.rb
Outdated
@@ -249,12 +250,24 @@ def prepare_tests | |||
@project.logger.info('HLK test target is not defined, allow in manual mode') | |||
end | |||
|
|||
@tests.verify_target if @project.restored? |
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.
What is it for?
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.
I actually don't clearly remember it but, i think it was some error relatet to target creation back then
Anyway it's works without it now
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.
The new version removed the condition, but @tests.verify_target
is still there.
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.
I, [2025-05-29T09:11:23.184397 #1941716] INFO -- CmdRun PID:1943108: Command finished with code 0
F, [2025-05-29T09:11:23.184889 #1941716] FATAL -- : (NoMethodError) undefined method `[]' for nil
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/engines/hcktest/tests.rb:61:in `update_tests'
-- /home/jedoku/HCK/repos/AutoHCK.git/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.12020/lib/types/private/methods/call_validation.rb:282:in `bind_call'
-- /home/jedoku/HCK/repos/AutoHCK.git/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.12020/lib/types/private/methods/call_validation.rb:282:in `validate_call'
-- /home/jedoku/HCK/repos/AutoHCK.git/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.12020/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/engines/hcktest/hcktest.rb:253:in `prepare_tests'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/engines/hcktest/hcktest.rb:281:in `block in run_tests_without_config'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/auxiliary/resource_scope.rb:29:in `block (2 levels) in open'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/auxiliary/resource_scope.rb:28:in `handle_interrupt'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/auxiliary/resource_scope.rb:28:in `block in open'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/auxiliary/resource_scope.rb:27:in `handle_interrupt'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/auxiliary/resource_scope.rb:27:in `open'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/engines/hcktest/hcktest.rb:279:in `run_tests_without_config'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/engines/hcktest/hcktest.rb:271:in `block in auto_run'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/auxiliary/resource_scope.rb:29:in `block (2 levels) in open'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/auxiliary/resource_scope.rb:28:in `handle_interrupt'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/auxiliary/resource_scope.rb:28:in `block in open'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/auxiliary/resource_scope.rb:27:in `handle_interrupt'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/auxiliary/resource_scope.rb:27:in `open'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/engines/hcktest/hcktest.rb:267:in `auto_run'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/engines/hcktest/hcktest.rb:329:in `run'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/project.rb:48:in `run'
-- bin/auto_hck:30:in `block (2 levels) in <module:AutoHCK>'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/auxiliary/resource_scope.rb:29:in `block (2 levels) in open'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/auxiliary/resource_scope.rb:28:in `handle_interrupt'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/auxiliary/resource_scope.rb:28:in `block in open'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/auxiliary/resource_scope.rb:27:in `handle_interrupt'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/auxiliary/resource_scope.rb:27:in `open'
-- bin/auto_hck:27:in `block in <module:AutoHCK>'
-- /home/jedoku/HCK/repos/AutoHCK.git/lib/auto_hck.rb:14:in `run'
-- bin/auto_hck:9:in `<module:AutoHCK>'
-- bin/auto_hck:8:in `<main>'
D, [2025-05-29T09:11:23.185073 #1941716] DEBUG -- : Closing AutoHCK project
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.
That's why it was there
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.
The log indicates the underlying problem is that HCKClient#add_target_to_project
is not called because
configure_and_synchronize_clients
is skipped. Letting configure_and_synchronize_clients
call HCKClient#add_target_to_project
would be a proper fix.
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.
Project was configured once and already has target, it'll cause error if we trying to add new one
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.
Right. We need another method to call search_target
instead.
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.
What's wrong with verify_target?
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.
There are a few problems:
- It is unclear why
verify_target
is needed. If we callsearch_target
fromconfigure_and_synchronize_clients
, it will be obvious that it is compensating the operations skipped inconfigure_and_synchronize_clients
. - It doesn't update
HCKClient#target
, which is supposed not to benil
. - It calls
Playlist#update_target
, which is unnecessary if the target is notnil
in the first place.
af17bd2
to
dd1caeb
Compare
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.
Two of the last comments are not addressed.
|
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.
I replied to the comments so please check them out.
3daf6f0
to
52ca3a4
Compare
Signed-off-by: Vitalii Chulak <[email protected]>
52ca3a4
to
74c4785
Compare
Please ask @kostyanf14 for further review.
WIP