Skip to content
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

App instances count as available applications #646

Merged
merged 3 commits into from
Jun 17, 2024
Merged

Conversation

DavidePrincipi
Copy link
Member

@DavidePrincipi DavidePrincipi commented Jun 14, 2024

Even if there is no repository enabled I want to see Apps in the Software Center, and Core components too.

This PR changes the list_available() return value, to include those instances that do not belong to any repository (orphans).

Metadata (logo image included) of orphan apps is synthesized from the metadata.json and .png image installed in the cluster leader, if present. Also the image labels are retrieved from the leader image store.

The list_available function is called from many code points. It affects the results of the following actions, without impact on the output format:

  • list-modules
  • list-installed-modules
  • list-core-modules
  • list-updates
  • update-modules (invoked also by apply-updates command)

The ordering of available versions and installed versions has been implemented from newest to oldest.

Refs NethServer/dev#6947

The first item of installed modules and versions arrays are certainly the
latest available.

Installed modules are sorted by version number, like versions
available from remote repositories.
Even if all repositories are disabled, consider installed instances as a
repository itself and return synthesized metadata from list_available().

An installed application is always properly covered by its metadata.json and
image labels as fallback, in case a remote repository does not list it
any more.
The list is built starting from installed instances (instead of comparing
available instances from repositories to what is installed).

This is necessary to always capture the "core" module as installed.
@DavidePrincipi DavidePrincipi self-assigned this Jun 14, 2024
@DavidePrincipi
Copy link
Member Author

Warning: using user "cluster" credentials from the environment
<6>_fetch_metadata_json/open: [Errno 2] No such file or directory: '/var/lib/nethserver/cluster/ui/apps/scratchpad1/metadata.json'
<6>_fetch_metadata_json/glob: list index out of range
<6>_fetch_metadata_json/glob: list index out of range
<6>_fetch_metadata_json/glob: list index out of range
[]

The notice should contain the app/instance name to help fixing the missing logo.

Copy link
Contributor

@stephdl stephdl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, need to test it in action

@DavidePrincipi DavidePrincipi merged commit 31e7118 into main Jun 17, 2024
2 checks passed
@DavidePrincipi DavidePrincipi deleted the bug-6947 branch June 17, 2024 09:45
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