-
Notifications
You must be signed in to change notification settings - Fork 71
Remote assistant refactoring (new) #2057
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
Conversation
da22ab5 to
77156d8
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## bootstrap_refactor #2057 +/- ##
===================================================
Coverage 51.87% 51.87%
===================================================
Files 387 387
Lines 41684 41697 +13
Branches 7743 7747 +4
===================================================
+ Hits 21623 21630 +7
- Misses 19295 19300 +5
- Partials 766 767 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4a19cc2 to
0c78444
Compare
Forgotten removed api
Decorator was moved to top level of the module, state now has a non-private property (that logs transitions) and was changed accordingly Minor fix: use .state and not ._state in decorator
Minor: forgotten 2 state comparison to str instead of new enum
This removes session finalization in all branches. It was added because the start_new_sesison function starts a new session, so it fails on the second iteration. The correct solution to this was not to spam finalize everywhere but to split that function up into start and select_test_plan (thanks me, I know you did this to me)
Minor: use new continue session function
9ba1984 to
77b2beb
Compare
fernando79513
left a comment
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.
Amazing work here!
Overall, everything is clearer than before, and it makes more sense. Thanks for all the docstrings and the renaming.
I didn't find any issues in the code. I went through the issues that you mention in the description, and I agree with the solutions you proposed.
I don't think there are many big changes on the behavior of the sessions after this refactor, but is the information in checkbox remote page still correct?
Co-authored-by: Fernando Bravo <[email protected]>
|
The session behaviour must be exactly the same after this PR. The code I've removed was a legacy resume mechanism that was even more brittle than the one we have right now. |
fernando79513
left a comment
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.
Yep, that was what I thought, but I wanted to double check it.
I think this is good to go then.
Great work!
* Full refactoring backported to remote_assistant.py * Backport controller refactoring Forgotten removed api * Fix unit tests by renaming apis and changing whats_up response * Refactored allowed_when and _state -> state Decorator was moved to top level of the module, state now has a non-private property (that logs transitions) and was changed accordingly Minor fix: use .state and not ._state in decorator * Renamed resume_session to prepare_resume_session Minor: forgotten 2 state comparison to str instead of new enum * Missing bootstrap_and_continue * Remove outdated resume machanism * Check that all states have a connection_strategy * Support optional parameters of interaction * Include test plan in session metadata * Move functions, rename functions that continue with _continue * Default value of resume_by_id should be empty dict * Propagate prepare_resume_session * Also update name in the test * Don't finalize the session until resume is decided This removes session finalization in all branches. It was added because the start_new_sesison function starts a new session, so it fails on the second iteration. The correct solution to this was not to spam finalize everywhere but to split that function up into start and select_test_plan (thanks me, I know you did this to me) * Port renames and new _continue process to tests * Also fix local changes to subcommands * Test test plan selection function Minor: use new continue session function * Disable fail-fast * Update checkbox-ng/checkbox_ng/launcher/controller.py Co-authored-by: Fernando Bravo <[email protected]> --------- Co-authored-by: Fernando Bravo <[email protected]>
* Rename bootstrap_todo_list to start_bootstrap and use the apis in silent bootstrap Minor: better docstring * Create bootstrapping API to avoid using flags directly * Rename resume_session to prepare_resume_session resume session doesn't really resume the session, more work is needed to get the session fully resumed * Also propagate the bootstrap api change to remote_assistant * Fix unit tests * Test new bootstrapping property * Backward compatible type hints using comments Python3.5 (sigh) doesn't implement pep526 * Bump REMOTE_API_VERSION * Fix typos in the docstrings * Fix outdated todo_list getter * Remote assistant refactoring (new) (#2057) * Full refactoring backported to remote_assistant.py * Backport controller refactoring Forgotten removed api * Fix unit tests by renaming apis and changing whats_up response * Refactored allowed_when and _state -> state Decorator was moved to top level of the module, state now has a non-private property (that logs transitions) and was changed accordingly Minor fix: use .state and not ._state in decorator * Renamed resume_session to prepare_resume_session Minor: forgotten 2 state comparison to str instead of new enum * Missing bootstrap_and_continue * Remove outdated resume machanism * Check that all states have a connection_strategy * Support optional parameters of interaction * Include test plan in session metadata * Move functions, rename functions that continue with _continue * Default value of resume_by_id should be empty dict * Propagate prepare_resume_session * Also update name in the test * Don't finalize the session until resume is decided This removes session finalization in all branches. It was added because the start_new_sesison function starts a new session, so it fails on the second iteration. The correct solution to this was not to spam finalize everywhere but to split that function up into start and select_test_plan (thanks me, I know you did this to me) * Port renames and new _continue process to tests * Also fix local changes to subcommands * Test test plan selection function Minor: use new continue session function * Disable fail-fast * Update checkbox-ng/checkbox_ng/launcher/controller.py Co-authored-by: Fernando Bravo <[email protected]> --------- Co-authored-by: Fernando Bravo <[email protected]> --------- Co-authored-by: Fernando Bravo <[email protected]>
* Rename bootstrap_todo_list to start_bootstrap and use the apis in silent bootstrap Minor: better docstring * Create bootstrapping API to avoid using flags directly * Rename resume_session to prepare_resume_session resume session doesn't really resume the session, more work is needed to get the session fully resumed * Also propagate the bootstrap api change to remote_assistant * Fix unit tests * Test new bootstrapping property * Backward compatible type hints using comments Python3.5 (sigh) doesn't implement pep526 * Bump REMOTE_API_VERSION * Fix typos in the docstrings * Fix outdated todo_list getter * Remote assistant refactoring (new) (#2057) * Full refactoring backported to remote_assistant.py * Backport controller refactoring Forgotten removed api * Fix unit tests by renaming apis and changing whats_up response * Refactored allowed_when and _state -> state Decorator was moved to top level of the module, state now has a non-private property (that logs transitions) and was changed accordingly Minor fix: use .state and not ._state in decorator * Renamed resume_session to prepare_resume_session Minor: forgotten 2 state comparison to str instead of new enum * Missing bootstrap_and_continue * Remove outdated resume machanism * Check that all states have a connection_strategy * Support optional parameters of interaction * Include test plan in session metadata * Move functions, rename functions that continue with _continue * Default value of resume_by_id should be empty dict * Propagate prepare_resume_session * Also update name in the test * Don't finalize the session until resume is decided This removes session finalization in all branches. It was added because the start_new_sesison function starts a new session, so it fails on the second iteration. The correct solution to this was not to spam finalize everywhere but to split that function up into start and select_test_plan (thanks me, I know you did this to me) * Port renames and new _continue process to tests * Also fix local changes to subcommands * Test test plan selection function Minor: use new continue session function * Disable fail-fast * Update checkbox-ng/checkbox_ng/launcher/controller.py Co-authored-by: Fernando Bravo <[email protected]> --------- Co-authored-by: Fernando Bravo <[email protected]> --------- Co-authored-by: Fernando Bravo <[email protected]>
* Rename bootstrap_todo_list to start_bootstrap and use the apis in silent bootstrap Minor: better docstring * Create bootstrapping API to avoid using flags directly * Rename resume_session to prepare_resume_session resume session doesn't really resume the session, more work is needed to get the session fully resumed * Also propagate the bootstrap api change to remote_assistant * Fix unit tests * Test new bootstrapping property * Backward compatible type hints using comments Python3.5 (sigh) doesn't implement pep526 * Bump REMOTE_API_VERSION * Fix typos in the docstrings * Fix outdated todo_list getter * Remote assistant refactoring (new) (#2057) * Full refactoring backported to remote_assistant.py * Backport controller refactoring Forgotten removed api * Fix unit tests by renaming apis and changing whats_up response * Refactored allowed_when and _state -> state Decorator was moved to top level of the module, state now has a non-private property (that logs transitions) and was changed accordingly Minor fix: use .state and not ._state in decorator * Renamed resume_session to prepare_resume_session Minor: forgotten 2 state comparison to str instead of new enum * Missing bootstrap_and_continue * Remove outdated resume machanism * Check that all states have a connection_strategy * Support optional parameters of interaction * Include test plan in session metadata * Move functions, rename functions that continue with _continue * Default value of resume_by_id should be empty dict * Propagate prepare_resume_session * Also update name in the test * Don't finalize the session until resume is decided This removes session finalization in all branches. It was added because the start_new_sesison function starts a new session, so it fails on the second iteration. The correct solution to this was not to spam finalize everywhere but to split that function up into start and select_test_plan (thanks me, I know you did this to me) * Port renames and new _continue process to tests * Also fix local changes to subcommands * Test test plan selection function Minor: use new continue session function * Disable fail-fast * Update checkbox-ng/checkbox_ng/launcher/controller.py Co-authored-by: Fernando Bravo <[email protected]> --------- Co-authored-by: Fernando Bravo <[email protected]> --------- Co-authored-by: Fernando Bravo <[email protected]>
* Rename bootstrap_todo_list to start_bootstrap and use the apis in silent bootstrap Minor: better docstring * Create bootstrapping API to avoid using flags directly * Rename resume_session to prepare_resume_session resume session doesn't really resume the session, more work is needed to get the session fully resumed * Also propagate the bootstrap api change to remote_assistant * Fix unit tests * Test new bootstrapping property * Backward compatible type hints using comments Python3.5 (sigh) doesn't implement pep526 * Bump REMOTE_API_VERSION * Fix typos in the docstrings * Fix outdated todo_list getter * Remote assistant refactoring (new) (#2057) * Full refactoring backported to remote_assistant.py * Backport controller refactoring Forgotten removed api * Fix unit tests by renaming apis and changing whats_up response * Refactored allowed_when and _state -> state Decorator was moved to top level of the module, state now has a non-private property (that logs transitions) and was changed accordingly Minor fix: use .state and not ._state in decorator * Renamed resume_session to prepare_resume_session Minor: forgotten 2 state comparison to str instead of new enum * Missing bootstrap_and_continue * Remove outdated resume machanism * Check that all states have a connection_strategy * Support optional parameters of interaction * Include test plan in session metadata * Move functions, rename functions that continue with _continue * Default value of resume_by_id should be empty dict * Propagate prepare_resume_session * Also update name in the test * Don't finalize the session until resume is decided This removes session finalization in all branches. It was added because the start_new_sesison function starts a new session, so it fails on the second iteration. The correct solution to this was not to spam finalize everywhere but to split that function up into start and select_test_plan (thanks me, I know you did this to me) * Port renames and new _continue process to tests * Also fix local changes to subcommands * Test test plan selection function Minor: use new continue session function * Disable fail-fast * Update checkbox-ng/checkbox_ng/launcher/controller.py Co-authored-by: Fernando Bravo <[email protected]> --------- Co-authored-by: Fernando Bravo <[email protected]> --------- Co-authored-by: Fernando Bravo <[email protected]>
Description
Currently:
whats_upis poorly documentedThis refactor fixes all the above issues
Resolved issues
Fixes: https://warthogs.atlassian.net/browse/CHECKBOX-1983
Documentation
Added documentation for many APIs
Tests
Metabox tests, nothing should change about the behaviour