client: show "install Podman" messages only in certain cases#7171
client: show "install Podman" messages only in certain cases#7171davidpanderson wants to merge 5 commits into
Conversation
Namely: - the client is attached to a project that has Docker apps - the client is using Science United Also: we had two separate chunks of code for parsing all_projects_list.xml. Combine these into one (in lib/util)
There was a problem hiding this comment.
2 issues found across 9 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="lib/util.cpp">
<violation number="1" location="lib/util.cpp:1003">
P2: Each project-list read leaks every `PROJECT_LIST_ENTRY` when its `ALL_PROJECTS_LIST` is destroyed. Add a destructor that calls `clear()` (or use owning pointers) so the temporary project lists release their entries.</violation>
</file>
<file name="lib/gui_rpc_client_ops.cpp">
<violation number="1" location="lib/gui_rpc_client_ops.cpp:1555">
P3: The `if (retval) return retval;` check after `pl.parse(rpc.xp)` is dead code because `ALL_PROJECTS_LIST::parse()` unconditionally returns 0. While harmless, this is a minor cleanup opportunity — the check can be removed to make the code clearer.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| retval = entry->parse(xp); | ||
| if (!retval) { | ||
| entry->is_account_manager = false; | ||
| projects.push_back(entry); |
There was a problem hiding this comment.
P2: Each project-list read leaks every PROJECT_LIST_ENTRY when its ALL_PROJECTS_LIST is destroyed. Add a destructor that calls clear() (or use owning pointers) so the temporary project lists release their entries.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At lib/util.cpp, line 1003:
<comment>Each project-list read leaks every `PROJECT_LIST_ENTRY` when its `ALL_PROJECTS_LIST` is destroyed. Add a destructor that calls `clear()` (or use owning pointers) so the temporary project lists release their entries.</comment>
<file context>
@@ -902,4 +905,130 @@ string docker_container_name(
+ retval = entry->parse(xp);
+ if (!retval) {
+ entry->is_account_manager = false;
+ projects.push_back(entry);
+ } else {
+ delete entry;
</file context>
| continue; | ||
| } | ||
| } | ||
| retval = pl.parse(rpc.xp); |
There was a problem hiding this comment.
P3: The if (retval) return retval; check after pl.parse(rpc.xp) is dead code because ALL_PROJECTS_LIST::parse() unconditionally returns 0. While harmless, this is a minor cleanup opportunity — the check can be removed to make the code clearer.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At lib/gui_rpc_client_ops.cpp, line 1555:
<comment>The `if (retval) return retval;` check after `pl.parse(rpc.xp)` is dead code because `ALL_PROJECTS_LIST::parse()` unconditionally returns 0. While harmless, this is a minor cleanup opportunity — the check can be removed to make the code clearer.</comment>
<file context>
@@ -1655,37 +1547,13 @@ int RPC_CLIENT::get_project_status(PROJECTS& p) {
- continue;
- }
- }
+ retval = pl.parse(rpc.xp);
+ if (retval) return retval;
</file context>
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
@davidpanderson, it looks like that the changed 'util.cpp' file now breaks the compilation of the 'PostInstall' project on Mac. Maybe some file is missed? Also, in the 'clint/client_state.cpp' file we still have a link to install 'Docker'. |
|
I can't figure out why the Mac build failed. Is there a more detailed error message? I'll fix the startup messages in a later PR. |
|
@davidpanderson, from the build log file: |
|
@davidpanderson, the same issue in 'Uninstaller': |
Namely:
Also: we had two separate chunks of code for parsing all_projects_list.xml. Combine these into one (in lib/util)
Summary by cubic
Show “Install Podman” only when it’s relevant, and consolidate
all_projects_list.xmlparsing intolib/utilto remove duplicate code and simplify lookups. Includes a small macOS build fix.New Features
dockerplatform.dont_use_dockerand, on Windows,dont_use_wsl; skip notices on unsupported Windows.Refactors
all_projects_list.xmlparsing tolib/utilasALL_PROJECTS_LISTwithparse(),read_file(),alpha_sort(), andlookup_id(); unified entries viaPROJECT_LIST_ENTRYwithidandis_account_manager.lib/gui_rpc_client*;get_all_projects_listnow usesALL_PROJECTS_LIST::parse(). Updated account attach to uselookup_id()andurl. Droppedproject_list.cppand the oldPROJECT_LISTmember.util.hinclientgui/mac/SetupSecurity.cppand rename the duplicatedtime()todtime2to fix the build.Written for commit 15b583c. Summary will update on new commits.