jruesga / rview

A Gerrit client application for Android
Apache License 2.0
66 stars 21 forks source link

Gitweb link doesn't work #61

Closed vlotorev closed 6 years ago

vlotorev commented 6 years ago

There are two links available on the right of commit and parent SHAs in the change screen. Links seem to open browser with gitweb.

Clicking on links results with popup 'No browser detected. Cant open gitweb?p=...' and no browser is opened.

Our repository does have gitweb available.

jruesga commented 6 years ago

@vlotorev could you check a thing for me? Could you open the following url in a web browser:

https://< gerrit server >/changes/< legacy changeid >?o=DETAILED_ACCOUNTS&o=DETAILED_LABELS&o=ALL_REVISIONS&o=ALL_FILES&o=ALL_COMMITS&o=MESSAGES&o=REVIEWED&o=CHANGE_ACTIONS&o=CHECK&o=WEB_LINKS&o=DOWNLOAD_COMMANDS

Replace < gerrit server > by your gerrit server url and < legacy changeid > by the numeric value of the change you tried to open in gitweb.

It will allows you to download a json file and inside of this file there is at least a tag with name "web_links". Inside of it, it the link of the gitweb link. Is that url relative? How it looks? How is the real url link? Is it in the same domain that the gerrit instance?

BTW, all the public repos I tested working fine and have a absolute url:

"web_links": [ { "name": "gitiles", "url": "https://android.googlesource.com/platform/frameworks/base/+/be9621c6147ec7987eb9d397051edae984f5f08a", "target": "_blank" } ]

but maybe in your case is relative to your gerrit instance server and i have to append it to the gerrit server url to obtain a valid link.

Thx in advance

vlotorev commented 6 years ago

I'm failed to build url.

I've checked both

https://

/gerrit/#/c/6655/?o=DETAILED_ACCOUNTS&o=DETAILED_LABELS&o=ALL_REVISIONS&o=ALL_FILES&o=ALL_COMMITS&o=MESSAGES&o=REVIEWED&o=CHANGE_ACTIONS&o=CHECK&o=WEB_LINKS&o=DOWNLOAD_COMMANDS And https:// /gerrit/#/c/6655?o=DETAILED_ACCOUNTS&o=DETAILED_LABELS&o=ALL_REVISIONS&o=ALL_FILES&o=ALL_COMMITS&o=MESSAGES&o=REVIEWED&o=CHANGE_ACTIONS&o=CHECK&o=WEB_LINKS&o=DOWNLOAD_COMMANDS Also I checked this public url https://gerrit-review.googlesource.com/c/gerrit/+/146630?o=DETAILED_ACCOUNTS&o=DETAILED_LABELS&o=ALL_REVISIONS&o=ALL_FILES&o=ALL_COMMITS&o=MESSAGES&o=REVIEWED&o=CHANGE_ACTIONS&o=CHECK&o=WEB_LINKS&o=DOWNLOAD_COMMANDS But no json file was downloaded. Could you please give full url to any public project to download json?
jruesga commented 6 years ago

For example, for the AOSP change 146630 the url is https://gerrit-review.googlesource.com/changes/146630?o=DETAILED_ACCOUNTS&o=DETAILED_LABELS&o=ALL_REVISIONS&o=ALL_FILES&o=ALL_COMMITS&o=MESSAGES&o=REVIEWED&o=CHANGE_ACTIONS&o=CHECK&o=WEB_LINKS&o=DOWNLOAD_COMMANDS

You just need to replace the server and port (and the schema if not https) and change number for your gerrit instance.

jruesga commented 6 years ago

For your service (for your samples urls I supposed is deployed in "gerrit" context) the url for change 6655 should be https://< myserver >/gerrit/changes/6655?o=DETAILED_ACCOUNTS&o=DETAILED_LABELS&o=ALL_REVISIONS&o=ALL_FILES&o=ALL_COMMITS&o=MESSAGES&o=REVIEWED&o=CHANGE_ACTIONS&o=CHECK&o=WEB_LINKS&o=DOWNLOAD_COMMANDS

jruesga commented 6 years ago

@vlotorev don't worry i was able to reproduce the bug on the eclipse gerrit instance (https://git.eclipse.org/r/#/c/114753/). I will try to fix it. Thx for the support to try to give the information for fix this issue.

jruesga commented 6 years ago

Fixed in ccc4ce65cf858f2c020467f0a43bafd661b4b20e

Thanks for help me to trace down this bug.

vlotorev commented 6 years ago

@jruesga, thanks.