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

don't ask for confirmation if there is only one remote repository installed #4364

Closed
rezad1393 opened this issue Aug 9, 2021 · 7 comments · Fixed by #4382
Closed

don't ask for confirmation if there is only one remote repository installed #4364

rezad1393 opened this issue Aug 9, 2021 · 7 comments · Fixed by #4382
Labels
cli Issues involving the flatpak command enhancement

Comments

@rezad1393
Copy link

Linux distribution and version

archlinux

Flatpak version

Flatpak 1.11.2

Description of the problem

even though I have only one remote configured ,flatpak still ask me if I am sure that I want to use that repo when searching for an app to install

Steps to reproduce

only have the default flatpak repo installed then run:

flatpak install app/org.rolisteam.rolisteam/x86_64/stable
Looking for matches…
Found similar ref(s) for ‘app/org.rolisteam.rolisteam/x86_64/stable’ in remote ‘flathub’ (user).
Use this remote? [Y/n]:

the question is redundant when use only has one repo.

@mwleeds mwleeds added cli Issues involving the flatpak command enhancement labels Aug 23, 2021
mwleeds added a commit that referenced this issue Aug 23, 2021
The install command can search available remotes for a specified flatpak
when a remote wasn't specified. In case only one remote is configured,
or in case only one of the configured remotes matches the ref specified,
we currently prompt the user to confirm use of the remote anyway (unless
-y/--assumeyes was used). Skip this prompt even when -y/--assumeyes was
not used, since the remote to use will still effectively be confirmed
when the list of refs to be installed is presented for confirmation.

Fixes #4364
@mwleeds
Copy link
Collaborator

mwleeds commented Aug 23, 2021

Thanks for the bug report, fix available in #4382

@rezad1393
Copy link
Author

rezad1393 commented Aug 24, 2021

I dont know if it is also needed but I will add it here:

there are two scenarios with one remote installed.

first:
install with a general word like " flatpak install freefilesync" which is the one I should have used in my original post as an example because that would give the output :

flatpak install freefilesync
Looking for matches…
Found similar ref(s) for ‘freefilesync’ in remote ‘flathub’ (user).
Use this remote? [Y/n]: 
Found ref ‘app/org.freefilesync.FreeFileSync/x86_64/stable’ in remote ‘flathub’ (user).
Use this ref? [Y/n]: 

org.freefilesync.FreeFileSync permissions:
    ipc      network      pulseaudio      wayland      x11      file access [1]      dbus access [2]

    [1] host, xdg-run/gvfs, xdg-run/gvfsd
    [2] org.gtk.vfs, org.gtk.vfs.*


        ID                                              Branch            Op           Remote            Download
 1.     org.freefilesync.FreeFileSync.Locale            stable            i            flathub             < 6.2 MB (partial)
 2.     org.gnome.Platform.Locale                       40                i            flathub           < 333.7 MB (partial)
 3.     org.freefilesync.FreeFileSync                   stable            i            flathub            < 31.7 MB

Proceed with these changes to the user installation? [Y/n]:

the second scenario is when user installs with a complete name ( I dont know what is the technical word for it ) like "flatpak install org.freefilesync.FreeFileSync"

which would give :


 flatpak install org.freefilesync.FreeFileSync              
Looking for matches…
Found similar ref(s) for ‘org.freefilesync.FreeFileSync’ in remote ‘flathub’ (user).
Use this remote? [Y/n]: 

org.freefilesync.FreeFileSync permissions:
    ipc      network      pulseaudio      wayland      x11      file access [1]      dbus access [2]

    [1] host, xdg-run/gvfs, xdg-run/gvfsd
    [2] org.gtk.vfs, org.gtk.vfs.*


        ID                                              Branch            Op           Remote            Download
 1.     org.freefilesync.FreeFileSync.Locale            stable            i            flathub             < 6.2 MB (partial)
 2.     org.gnome.Platform.Locale                       40                i            flathub           < 333.7 MB (partial)
 3.     org.freefilesync.FreeFileSync                   stable            i            flathub            < 31.7 MB

Proceed with these changes to the user installation? [Y/n]: 

as can be seen the first scenario has the redundant question which is the question number one.

the second scenario has only one question but it the the first scenario's first question:

Found similar ref(s) for ‘org.freefilesync.FreeFileSync’ in remote ‘flathub’ (user).
Use this remote? [Y/n]: 

so if you remove the first scenario's first question then it may impact the second scenario too because the second scenario doesnt ask for

Found ref ‘app/org.freefilesync.FreeFileSync/x86_64/stable’ in remote ‘flathub’ (user).
Use this ref? [Y/n]: 

@mwleeds
Copy link
Collaborator

mwleeds commented Aug 24, 2021

Yeah the PR changes the behavior in both cases to avoid the Found similar ref(s)... question, which is okay because the user is still asked for confirmation before the installation proceeds. The reason you don't get the Found ref ... question in the second scenario is that the ref was specified precisely already (org.freefilesync.FreeFileSync).

@rezad1393
Copy link
Author

rezad1393 commented Aug 24, 2021

Yeah the PR changes the behavior in both cases to avoid the Found similar ref(s)... question, which is okay because the user is still asked for confirmation before the installation proceeds. The reason you don't get the Found ref ... question in the second scenario is that the ref was specified precisely already (org.freefilesync.FreeFileSync).

what I mean was that even in second scenario the user needs to see from what remote it is going to be installed. if you remove that found similar ref question the user still see that in 1st case but if you remove the question, then in second case user will not see the remote used in the installation.
I don't know if this will happen because I only have on default repo but I am saying it here so that others that may have more that one still benefit from the removing of redundant question but also know which remote is used.

for example imagine user has two repos, one defaut and one that has, say, firefox experimental builds.
now if he uses flatpak install org.mozilla.firefox-experimental

then the user should only get one question that combines both info into one.
so instead of asking if user is sure to use the exp-firefox-repo remote then NOT asking for ref just ask
Found similar ref(s) for ‘org.mozilla.firefox-experimental’ in remote ‘**exp-firefox-repo**’ (user).
Use this **ref**? [Y/n]:

this way when there is one ref, user only is asked one question that has repo info in too.

so overall I wanted to be a way (if possible) that if only one result is found, be it a general word or a specific ref , and be it in one repo only or one found in all the repos together, then user only is asked one question that has the ref and the repo name in it.

but I dont insist on this if it messes with the logic of it too much.
my original request is enough for me. the rest is user comfort related.

EDIT: i used bold for it but maybe because it is inside code snippet it gets shown as literal double stars.
those are supposed to be bold :)

@mwleeds
Copy link
Collaborator

mwleeds commented Aug 24, 2021

Yeah the PR changes the behavior in both cases to avoid the Found similar ref(s)... question, which is okay because the user is still asked for confirmation before the installation proceeds. The reason you don't get the Found ref ... question in the second scenario is that the ref was specified precisely already (org.freefilesync.FreeFileSync).

what I mean was that even in second scenario the user needs to see from what remote it is going to be installed. if you remove that found similar ref question the user still see that in 1st case but if you remove the question, then in second case user will not see the remote used in the installation.

No, the user will still see the remote being used even when they have more than one configured and don't explicitly specify which to use in the install command, since "Remote" is one of the columns in the table that precedes the question Proceed with these changes to ...

@rezad1393
Copy link
Author

Yeah the PR changes the behavior in both cases to avoid the Found similar ref(s)... question, which is okay because the user is still asked for confirmation before the installation proceeds. The reason you don't get the Found ref ... question in the second scenario is that the ref was specified precisely already (org.freefilesync.FreeFileSync).

what I mean was that even in second scenario the user needs to see from what remote it is going to be installed. if you remove that found similar ref question the user still see that in 1st case but if you remove the question, then in second case user will not see the remote used in the installation.

No, the user will still see the remote being used even when they have more than one configured and don't explicitly specify which to use in the install command, since "Remote" is one of the columns in the table that precedes the question Proceed with these changes to ...

you are right.
i forgot about that.
as I said I saw that you fixed my first issue.
just wanted to be sure that the fix wouldnt mess other people's routine or maybe even make their routine better.

thanks for the answer.

@mwleeds
Copy link
Collaborator

mwleeds commented Aug 24, 2021

Reopening this until the PR is merged

@mwleeds mwleeds reopened this Aug 24, 2021
smcv pushed a commit that referenced this issue Aug 24, 2021
The install command can search available remotes for a specified flatpak
when a remote wasn't specified. In case only one remote is configured,
or in case only one of the configured remotes matches the ref specified,
we currently prompt the user to confirm use of the remote anyway (unless
-y/--assumeyes was used). Skip this prompt even when -y/--assumeyes was
not used, since the remote to use will still effectively be confirmed
when the list of refs to be installed is presented for confirmation.

Fixes #4364
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Issues involving the flatpak command enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants