clj-commons / clj-commons/tentacles
Tentacles URL use of ".../git/..." is wrong
- Dominant language
- Clojure
- Stars
- 84
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
#Summary by example:
`(api-call :get "repos/%s/%s/git/commits/%s" [user repo sha] options)` uses the wrong URL.
`(api-call :get "repos/%s/%s/commits/%s" [user repo sha] options)` uses the right URL but is broken in tentacles.
The URLs behave similarly but not identically, particularly in the presence of media type specifications.
#Details:
Tentacles uses tolerated but incorrect 'git/' embedded in many Github API URLs.
For example:
https://github.com/irresponsible/tentacles/blob/master/src/tentacles/data.clj#L25
While these mostly work when used against the Github API services, they do not work identically, and they are not what Github documents. Github does not have the "git/" in their URLs.
I spent the morning trying to get the diffs on a commit with the `data/commit` function, passing in {:accept "application/vnd.github.diff"}. But the results were the same regardless of the media type I passed.
So I checked it with `curl` using the same URL generated by tentacles and got the same results, and I was stymied. Tried paging parameters, all kinds of things.
Turns out that if you remove the 'git/' from the tentacles generated URL, _then_ you get the diffs with the above media type header (which is what I wanted and expected). At least in `curl`. Unfortunately if you try a tentacles `api-call` with the modified URL it gets some ISeq error because there seems to be some reliance on the `git/` text in the url that I haven't figured out yet.
Anyway, this seems to me a rather serious and pervasive error in the tentacles library. Perhaps there's some historical basis for it, I'm new to both tentacles and the Github API, so I don't know.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with src/tentacles/data.clj around the referenced URL and trace data/commit through api-call. Find the reliance on the embedded "git/" text and identify the other affected GitHub API URLs. Done means documented URL forms work through tentacles, including the media type needed to retrieve commit diffs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100