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

Add support for fetching project's resources by namespace. #8

Merged
merged 9 commits into from
Apr 9, 2014

Conversation

fudanchii
Copy link
Contributor

Also add support for parsing hook payload.

Gitlab use URL-escaped `/' for API to fetch project related
resources by its namespace, so it's looks like:

    namespace%2Fproject-name

The problem is Go's `http.NewRequest` use `url.Parse`
which in turn unescape the `%2F' automatically.
The only way to keep the escaped char is to use Opaque params at URL
as noted at: http://golang.org/pkg/net/url/#URL

Here is the first attempt to work-around the limitation,
we introduces another version of `ResourceUrl` and `buildAndExecRequest`
each called `ResourceUrlRaw` and `buildAndExecRequestRaw`, respectively.
`ResourceUrlRaw` will returns concatenated url and the opaque params, and
`buildAndExecRequestRaw` may accept opaque params in addition of url.
fudanchii added a commit to fudanchii/drone that referenced this pull request Apr 4, 2014
… import path.

At least until plouc/go-gitlab-client#8
accepted or Drone officially fork it to `drone/go-gitlab` or
when we have package management which can do something like this:

gom 'github.com/plouc/go-gitlab-client',
  :github => 'fudanchii/go-gitlab-client', :branch => 'raw-request'
@luxifer
Copy link

luxifer commented Apr 7, 2014

👍

plouc added a commit that referenced this pull request Apr 9, 2014
Add support for fetching project's resources by namespace.
@plouc plouc merged commit 80398ca into plouc:master Apr 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants