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

Use Action API instead of Gerrit API when getting the URLs of extensions #800

Open
lens0021 opened this issue Oct 2, 2023 · 0 comments
Open

Comments

@lens0021
Copy link
Member

lens0021 commented Oct 2, 2023

branch_info_url = "https://gerrit.wikimedia.org/r/projects/mediawiki%2F#{type}s%2F#{name}/branches/#{MEDIAWIKI_BRANCH}"
puts "Fetching the infomation of #{name} from #{branch_info_url}"
response = Net::HTTP.get(URI(branch_info_url))
# Response starts with a magic prefix line ")]}'\n", so strip it.
# See:
# https://gerrit-review.googlesource.com/Documentation/rest-api.html#output
response = response[5..-1]
sha = JSON.parse(response)['revision']
"https://extdist.wmflabs.org/dist/#{type}s/#{name}-#{MEDIAWIKI_BRANCH}-#{sha[0..6]}.tar.gz\n out=#{name}.tar.gz\n"

The ExtensionDistributor API can
get you download URLs, e.g. this:
https://www.mediawiki.org/wiki/Special:ApiSandbox#action=query&format=json&list=extdistbranches&formatversion=2&edbexts=WikiEditor

--
https://lists.wikimedia.org/hyperkitty/list/[email protected]/message/5DORJSQFXFBDW4W5WXSDYBFB3T3ZBMD3/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To do
Development

No branches or pull requests

1 participant