Open agraul opened 5 years ago
I will probably try to take that -- seems really like a good first issue!
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 ?
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?
from a google this looks like selenium glue code you're seeing.
lib/obs
andApiConnect
serves the same purpose, querying OBS via http. Only one library should be used to reduce duplication of logic. PlacesApiConnect
is currently used:app/controllers/obs_controller.rb:
response = ApiConnect.get("public/distributions")
app/controllers/download_controller.rb:
api_result_images = ApiConnect::get("/published/#{@project}/images")
api_result_iso = ApiConnect::get("/published/#{@project}/images/iso")
api_result = ApiConnect::get("/search/published/binary/id?match=project='#{escaped_prj}'+and+name='#{escaped_pkg}'")
pi_result = ApiConnect::get("/search/published/pattern/id?match=project='#{@project}'")
path = "/published/#{params[:project]}/#{params[:repository]}/#{params[:arch]}/#{params[:binary]}?view=ymp" [..] ApiConnect::get(path)
path = "/published/#{params[:project]}/#{params[:repository]}/#{params[:package]}?view=ymp" [...] ApiConnect::get(path)
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.