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
API file by file #10
API file by file #10
Conversation
ada84a1
to
6f4b5bb
Compare
On 10 June 2015 at 11:52, Orestis Ioannou notifications@github.com wrote:
Thanks for the explanation along the PR, it's greatly appreciated. To
No problem, perfect that you updated the doc along.
Hm, that's a bit problematic. It would be better, for programs which
Would this address all the types of queries? Zack, what do you think? For the rest, here are a few notes:
Besides this, the API works fine on my machine. And kudos for all the |
Thanks for the quick review :) On 06/10/2015 08:54 PM, Matthieu Caneill wrote:
Ok works i ll think of that next time :) [snip]
IMHO that should be good for all the queries.
license_helper.py, copyright.py
ack
Well yes you are right it's better like that. We can also have What do you think? Add version as well or not? Cheers |
On Wed, Jun 10, 2015 at 11:54:20AM -0700, Matthieu Caneill wrote:
I'm not sure I'm reading correctly your example above, but I agree with If your meta-information above is meant to be a "group by" key, then we Cheers.Stefano Zacchiroli . . . . . . . zack@upsilon.cc . . . . o . . . o . o |
6f4b5bb
to
aad81f6
Compare
So i have reworked most of the things (thats why i didn't keep old commits).. Changes:
Here are some routes: /copyright/api/gnubg/doc/gnubg/gnubg.html/ Missing:
|
Hi. The API works great for me here ! I haven't looked at the code yet though. Something I'm not sure about are the routes. (Question, I couldn't test it as I wasn't sure how to add a package: What happens if we have a package named 'sha256' ? Since we removed the /[file] prefix, this could clash with /api/sha256) We now have 3 type of routes for the different APIs we have in Debsources:
(Another subject of discussion, I mentionned it on IRC, the sources api begins with /api/src/, while the copyright api goes with /copyright/api/, we should either go with /api/[component] or /[component]/api, not both) Since Debsources might host other components in the future, I think it's important to have one standard. I'm not certain how we can achieve this though. Proposal (not quite satisfied with this yet, it's up for debate!): Copyright by file: /file/[package]/[version|suite|all]/[path] -- this would bring back /file that you removed though! Copyright by checksum: /sha256/[package|all]/[version|suite|all]/checksum Let me know what you think :) |
Thanks for the review :) On 06/11/2015 03:31 AM, Jason Pleau wrote:
hm, no idea. I think it will search inside the sha256 package since
well the /copyright is the prefix of the blueprint we can't do much
I like that. A user on a file on s.d.n will just have to add the
I prefer the way it is since it is the same with the sources api ( i.e Cheers! |
aad81f6
to
c5a0e95
Compare
I reintroduced the /file/ suffix in the api as without it i found some errors. I introduced the url schema proposed by jpleau. new routes now are /api/file/package/version/path with version being:
I had to modify the version handling to achieve this (minor diffs, passing the endpoint as a parameter) hence the new commit. |
c5a0e95
to
cdde7d3
Compare
On 11 June 2015 at 10:57, Orestis Ioannou notifications@github.com wrote:
Yes, that's great, I wanted to ask you that. Better not to have any All the rest looks super good, but I couldn't test it yet. I'll keep |
cdde7d3
to
bd5c35f
Compare
This PR is about the file-by-file API. It implements:
Compared to the api doc there are two differences:
url for file name & package search is slightly different using
/copyright/api/file/path/?package=--
instead of
/copyright/api/file/?path=--&package=--
as it is easier and better to handle paths
The json output for filename and package search differs as if the user doesn't specify a suite name the results can be > 1 with different checksums. The solution was to include everything in a result field. I didn't update the doc for this one as you might have a better solution to come up with.