openSUSE / software-o-o

The site behind https://software.opensuse.org. It is the default web interface to download openSUSE distributions and to search for OBS packages. Packaged at https://build.opensuse.org/project/show/openSUSE:infrastructure:software.opensuse.org
https://software.opensuse.org/
GNU General Public License v2.0
137 stars 111 forks source link

Use lib/obs instead of ApiConnect #491

Open agraul opened 5 years ago

agraul commented 5 years ago

lib/obs and ApiConnect serves the same purpose, querying OBS via http. Only one library should be used to reduce duplication of logic. Places ApiConnect is currently used:

app/controllers/obs_controller.rb:

app/controllers/download_controller.rb:

Most of these API calls don't have a method in lib/obs yet. For them a new method should be implemented. For the others, an appropriate method call should be used.

letsfindaway commented 3 years ago

I will probably try to take that -- seems really like a good first issue!

letsfindaway commented 3 years ago

Ask for help:

I started implementing this issue and public/distributions and search/published/binary/id should be ok. Now I'm struggling with /search/published/pattern/id, which is used when invoking https://s.o.o/download/pattern?project=<project>&pattern=<pattern>. Just for testing I want to see what is returned by the OBS API and whether I process the results correctly. But I could not find any suitable values for the parameters so that a pattern would be returned. I would expect that

https://software.opensuse.org/download/pattern?project=openSUSE:Leap:15.2&pattern=kde

would give me some usable result. But whatever I try: I get "No result".

Does somebody have any example for me how to correctly invoke this function? Perhaps @agraul ?

letsfindaway commented 3 years ago

A similar question to the people who know better about the software and its history: What are the appliances used for? They access https://api.opensuse.org/published/${project}/images and https://api.opensuse.org/published/${project}/images/iso on the API, but both calls return some JavaScript but no usable information. I have tried it with project openSUSE:Leap:15.2 and smilar, and each time I get

try { Object.defineProperty(screen, "availTop", { value: 0 }); } catch (e) {} try { Object.defineProperty(screen, "availLeft", { value: 0 }); } catch (e) {} try { Object.defineProperty(screen, "availWidth", { value: 1920 }); } catch (e) {} try { Object.defineProperty(screen, "availHeight", { value: 1080 }); } catch (e) {} try { Object.defineProperty(screen, "colorDepth", { value: 24 }); } catch (e) {} try { Object.defineProperty(screen, "pixelDepth", { value: 24 }); } catch (e) {} try { Object.defineProperty(navigator, "hardwareConcurrency", { value: 8 }); } catch (e) {} try { Object.defineProperty(navigator, "appVersion", { value: "5.0 (X11)" }); } catch (e) {} try { Object.defineProperty(navigator, "doNotTrack", { value: "unspecified" }); } catch (e) {} try { window.screenY = 0 } catch (e) { } try { window.screenTop = 0 } catch (e) { } try { window.top.window.outerHeight = 1015 } catch (e) { } try { window.screenX = 0 } catch (e) { } try { window.screenLeft = 0 } catch (e) { } try { window.top.window.outerWidth = window.screen.width } catch (e) { } 

Any enlightment for me?

coolo commented 3 years ago

from a google this looks like selenium glue code you're seeing.