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

[packagechooser] netinstall-add method #2261

Open
udeved opened this issue Dec 27, 2023 · 10 comments
Open

[packagechooser] netinstall-add method #2261

udeved opened this issue Dec 27, 2023 · 10 comments

Comments

@udeved
Copy link
Contributor

udeved commented Dec 27, 2023

Describe the bug
If I set the packagechooser to netinstall-add, the netinstall module somehow gets a wrong datalist passed resulting is an empty item shown.
My suspicion would be, the GS value written does not match the netinstall required group data, the netgroup itself is listitem[0] of netinstallAdd GS. I think only the actual netinstall data should be written to GS? It would explain the attached screenshot, which is a slight showstopper atm.

To Reproduce
Steps to reproduce the behavior:

  • set 'netinstall-add' in packagechooser, define some choice and netinstall item list in the conf
  • example used:
items:
    - id: OpenRC
      name: openrc
      description: "OpenRC init system"
      screenshot: ":/images/calamares.png"
      netinstall:
        groups:
            - name: "OpenRC"
              description: "OpenRC init system"
              selected: false
              critical: true
              immutable: false
              expanded: true
              hidden: false
              packages:
                - audit-openrc

Expected behavior
The netinstall view should show the netgroup passed, and possible be expanded like set in the yaml

Screenshots and Logs
Screenshot-20231227-233359.png

Additional context
version 3.3.0 using qt5/kf5 artix linux build

@adriaandegroot
Copy link
Contributor

That's a pretty clear description of the issue, thanks.

@dalto8
Copy link
Contributor

dalto8 commented Dec 27, 2023

You don't use groups with netinstall-add. It basically takes the contents of a single group for each packagechooser item.

Try removing groups and not have array items directly under it. So:

netinstall:
              name: "OpenRC"
              description: "OpenRC init system"
              selected: false
              critical: true
              immutable: false
              expanded: true
              hidden: false
              packages:
                - audit-openrc

@udeved
Copy link
Contributor Author

udeved commented Dec 27, 2023

Try removing groups and not have array items directly under it. So:

Have you tried that?
That's not gonna fix it, no GS will be written, and a warning printed that it is not valid netinstall data if you remove the group.

@dalto8
Copy link
Contributor

dalto8 commented Dec 28, 2023

Have you tried that?

For reference, here is the config for EndeavourOS which uses netinstall-add: https://raw.githubusercontent.com/endeavouros-team/calamares/calamares/data/eos/modules/packagechooser.conf

That's not gonna fix it, no GS will be written, and a warning printed that it is not valid netinstall data if you remove the group.

You need to also take out the array below group.

@udeved
Copy link
Contributor Author

udeved commented Dec 28, 2023

You need to also take out the array below group.

Ok, this works, thanks, but I don't know if this is still a bug?
The netinstall data passed doesn't comply with the expected data and documentation.
I guess it depends if this needs fixing or updating documentation.

@dalto8
Copy link
Contributor

dalto8 commented Dec 28, 2023

That is definitely how it was designed to work. It adds a group and as a result expects the yaml to be the contents of a group.

That is what this means:

   The data in this field should follow the format of a group
   from the netinstall module documented in
   src/modules/netinstall/netinstall.conf.

Perhaps we could add an example to make it more clear.

@udeved
Copy link
Contributor Author

udeved commented Dec 28, 2023

That is what this means

Yes, but the crucial detail is to not have a sequence like netinstall yaml, but a netinstall map.

documented is ...

- name: foo

but to work:

name: foo

Anyhow, at least no show stopper any longer and I can move on. :)

@udeved
Copy link
Contributor Author

udeved commented Dec 30, 2023

@adriaandegroot

I would probably make this a related feature request to have the yaml definitions in a online yaml file similar to netinstall for the packagechooser.
I doubt I have the time, but if, I give it a shot including the netinstall LoaderQueue. However, this would require the data source to be "fixed" to yaml netinstall definitions.

Possible example:

items:
    - id: Foo
      name: foo
      description: "Foo description"
      screenshot: ":/images/foo.png"
      netinstall:
        groupsUrl: myurl/data.yaml

Screenshot-20231228-041024.png

Next screenshot would have application for a packagechooser item groupsUrl, where the init package definitions are loaded from url rather than local file.

Screenshot-20231228-041121.png

@dalto8
Copy link
Contributor

dalto8 commented Dec 30, 2023

documented is ...

- name: foo

but to work:

name: foo

It isn't actually different than what is documented. The groups element in netinstall yaml contains a list of groups.

However, the netinstall-add functionality requires a single group. The - indicates a list element. Using a - in the netinstall-add section would be incorrect.

@udeved
Copy link
Contributor Author

udeved commented Jan 2, 2024

There is another little shortcoming in the netinstall-add method.
If whatever the choice by packagechooser has conflicting packages associated to the selected value, it would be nice to eventually have a conf property to clear the global storage if "back" button is used to make a different choice if mode: required.
At the moment, the choices are merged in the packageOperations GS.

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

No branches or pull requests

3 participants