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

Sort package by trust level and filter out packages from ports (ARM, PowerPC) #296

Merged
merged 55 commits into from
May 30, 2018

Conversation

guoyunhe
Copy link
Contributor

@guoyunhe guoyunhe commented May 17, 2018

Ordered by trust level (official packages first)

Search result will be ordered by trust level:

  • 3: official package (user's choice)
  • 2: official package in Factory
  • 1: experimental package
  • 0: community package

For package with the same level, package with shorter name will be shown first.

Before (MozillaFirefox is at 5th):

screenshot-2018-5-17 search

After (MozillaFirefox is at 1st):
screenshot-2018-5-17 search 1

Initial baseproject and other search settings

For fresh installed system (without cookies), the search settings modal popup and let users choose their system.

screenshot_20180519_163246

Filter out packages different from architecture of users' chosen baseproject

For normal distributions, filter out ARM and PowerPC

Settings saved in cookies instead of URL

Settings in modal will be stored in cookies and send with every request. The advantage of using cookies is:

  • Share link safely. If we share a link on wiki or forum with baseproject parameter, clicking it will modify users' cookies. However, others' settings are probably not for you. So URL parameter should only contains something common for users to share, like q=Firefox is common, but baseproject=openSUSE:Leap:42.1 from an old article is not.
  • On the same machine, people don't change baseproject, search_devel etc. that much.
  • It becomes possible to ask user for their choice of baseproject when not set.

@guoyunhe
Copy link
Contributor Author

guoyunhe commented May 17, 2018

build symbols, language packages, devel packages should have lowest priority. they are not filtered out by user settings, which causes many unwanted results.

@guoyunhe
Copy link
Contributor Author

Now language, buildsymbols, devel package can be filtered out.
screenshot-2018-5-17 search 2

@guoyunhe guoyunhe changed the title Sort package by trust level Sort package by trust level and filter out packages from ports (ARM, PowerPC) May 18, 2018
@guoyunhe
Copy link
Contributor Author

guoyunhe commented May 18, 2018

Detect User-Agent of HTTP request, we can filter out packages that doesn't match users' system architecture. On x86_64 system, none of ARM, PowerPC, zSystems packages show.

Compare wireshark page:

Before

screenshot_20180518_174945

After

screenshot_20180518_175026

@guoyunhe
Copy link
Contributor Author

Fix #301 #299 #137

@guoyunhe guoyunhe mentioned this pull request May 18, 2018
@agraul
Copy link
Member

agraul commented May 18, 2018

This does not seem to work properly for me, this happened when I searched for Firefox:
screenshot from 2018-05-18 17-26-00

It is an improvement, but the user still has to know which to pick.

For the removal of showing packages that have a different arch, I don't like that the user has no control over that. Le't say you have a RPi and want to search for available software from your PC, this does not work if ARM results are filtered out by User-Agent. There should be a way to have them displayed.
I also wonder if querying OBS for all the packages and then throwing them away is the best approach.

On a different note, I think we should not put all this the controller. I'd say we should have a package model with this kind of logic (priority etc), but that is out of scope for this PR.

@guoyunhe
Copy link
Contributor Author

For fresh installed system (without cookies), the search settings modal popup and let users choose their system.

screenshot_20180519_163246

elchevive and others added 19 commits May 25, 2018 12:34
Currently translated at 100.0% (198 of 198 strings)

Translation: software-o-o/master
Translate-URL: https://l10n.opensuse.org/projects/software-o-o/master/pt_BR/
Currently translated at 92.9% (184 of 198 strings)

Translation: software-o-o/master
Translate-URL: https://l10n.opensuse.org/projects/software-o-o/master/de/
Currently translated at 77.7% (154 of 198 strings)

Translation: software-o-o/master
Translate-URL: https://l10n.opensuse.org/projects/software-o-o/master/zh_CN/
Currently translated at 77.7% (197 of 198 strings)

Translation: software-o-o/master
Translate-URL: https://l10n.opensuse.org/projects/software-o-o/master/zh_CN/
Currently translated at 100.0% (198 of 198 strings)

Translation: software-o-o/master
Translate-URL: https://l10n.opensuse.org/projects/software-o-o/master/zh_CN/
Currently translated at 77.7% (154 of 198 strings)

Translation: software-o-o/master
Translate-URL: https://l10n.opensuse.org/projects/software-o-o/master/zh_TW/
Currently translated at 99.4% (197 of 198 strings)

Translation: software-o-o/master
Translate-URL: https://l10n.opensuse.org/projects/software-o-o/master/zh_CN/
Currently translated at 85.8% (170 of 198 strings)

Translation: software-o-o/master
Translate-URL: https://l10n.opensuse.org/projects/software-o-o/master/it/
Currently translated at 99.4% (197 of 198 strings)

Translation: software-o-o/master
Translate-URL: https://l10n.opensuse.org/projects/software-o-o/master/zh_CN/
Currently translated at 89.3% (177 of 198 strings)

Translation: software-o-o/master
Translate-URL: https://l10n.opensuse.org/projects/software-o-o/master/da/
Final iso does not have the -Current anymore
Remove -Current from 15.0 iso name
@dmacvicar dmacvicar self-assigned this May 29, 2018
@dmacvicar
Copy link
Member

I am looking at this one locally. I get a failed test, which I am trying to fix.

@dmacvicar
Copy link
Member

I thought the test needed to be adapted but the problem is that the modal buttons are not working, so that the settings dialog does not get closed.

@guoyunhe
Copy link
Contributor Author

If you click on ok button, it will save cookies and refresh page. If you click cancel button, settings will be reset and modal will be closed.

@dmacvicar
Copy link
Member

dmacvicar commented May 30, 2018

I understand. I am trying to find why I can't get the tests to run locally, even if they are passing on Travis. I also locally don't get the modal to work correctly.

@dmacvicar
Copy link
Member

Got it. I am refactoring trust_level and adding a test before merging.

@dmacvicar dmacvicar merged commit 75e74b4 into openSUSE:master May 30, 2018
@guoyunhe guoyunhe deleted the search-result-official-first branch May 30, 2018 10:31
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.