Skip to content

Fix interactive comand result fetching (infra)#1734

Merged
Hook25 merged 13 commits intofix_clear_old_sessionsfrom
fix_metabox_clear
Feb 19, 2025
Merged

Fix interactive comand result fetching (infra)#1734
Hook25 merged 13 commits intofix_clear_old_sessionsfrom
fix_metabox_clear

Conversation

@Hook25
Copy link
Copy Markdown
Collaborator

@Hook25 Hook25 commented Feb 17, 2025

Description

Currently interactive commands don't have a result. This is an issue as any interactive command may fail (As those ran with RunCmd), and we don't catch the result at all. This PR fixes this issue by fetching the result from the api via a daemon. The solution is similar to the one used by pylxd for the non-interactive run command linked in the file, but here we use a Thread as we want to be able to interact with the underlying process while it is running.

Note: this doesn't target main but fix_clear_old_sessions as that will make both PRs easier to review. This investigation and fix was sparked by a bug I couldn't debug in the other PR

Resolved issues

Fixes: CHECKBOX-1754

Documentation

Relevant hakcery links back to the original source and provides the reason it is done

Tests

Ran the new metabox first with the bug I was trying to debug: https://github.com/canonical/checkbox/actions/runs/13373883151/job/37348527458#step:7:8417
then after discovering the reason and fixing it: https://github.com/canonical/checkbox/actions/runs/13374110350

@Hook25 Hook25 force-pushed the fix_clear_old_sessions branch from 3b48ee2 to a361693 Compare February 19, 2025 10:38
Co-authored-by: Pierre Equoy <pierre.equoy@canonical.com>
@Hook25 Hook25 merged commit 36d1443 into fix_clear_old_sessions Feb 19, 2025
3 checks passed
@Hook25 Hook25 deleted the fix_metabox_clear branch February 19, 2025 14:32
fernando79513 pushed a commit that referenced this pull request Feb 19, 2025
* Fix top level args parsing in checkbox local

Minor: this fixes them all, including the debug level

* Minor: remove validator as it is wrong

last_job_start_time is mostly None as whenever a job finishes
it will be none

* Test the fixed clear-old-sessions message

Minor: also fix metabox as cmd was overwritten when a manifest was provided

* Fix the crash in remote as well

* Fix and add new unittest

* Test also args

* Also test the utils function

* Python3.5 :(

* Forgotten tool to corrupt sessions

* Implement feedback

* python3.5 :(

* Fix interactive comand result fetching (infra) (#1734)

* Result fetching for run_cmd

* Give the result half a second to materialize

* Add result to the ExecuteResult

* Preserve all fields on check

* Wrong check called

* Check is not a property

* Trace metabox output

* Rollback the binary load to test, make result array

* Set the cmd to none in non-interactive for now

* Revert trace logging

* Purge debug files

* Remove pointless append

* Use reference in the url comment

Co-authored-by: Pierre Equoy <pierre.equoy@canonical.com>

---------

Co-authored-by: Pierre Equoy <pierre.equoy@canonical.com>

---------

Co-authored-by: Pierre Equoy <pierre.equoy@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants