Use project names instead of their ids when connecting to Gitlab#7
Use project names instead of their ids when connecting to Gitlab#7
Conversation
* Search for projects directly instead of listing all available ones * Use the saved project name when creating a new issue
| @project_id ||= with_gitlab(gitlab_url, token) do |g| | ||
| g.projects.auto_paginate.detect { |p| p.path_with_namespace == project }.try(:id) | ||
| def urlized_project_name(project_name = options[:path_with_namespace]) | ||
| project_name.gsub('/', '%2F') |
There was a problem hiding this comment.
I'm not sure if its appropriate here, but you can use URI#encode if the intention is to encode the whole string. The second argument to encode is an additional set of characters to encode beyond the standard ones. URI.encode(project_name, '/') for example.
|
Looks good to me @stex. Do you want to write any tests or docs before we merge it? Are there any changes that users will have to make to upgrade from v1.0.1 to v1.0.2? |
|
@stevecrozz I'll write a test suite in the next days, definitely a good idea to have one.
Not as far as I know. I would have changed the major version if they'd have to. |
|
Are you still using this @stex? I'd be happy to hand you a commit bit if you want it. I'm finding this project has dropped a lot on my priority list. |
|
@stevecrozz We moved away from Errbit a while ago as we needed more detailed error reporting and I unfortunately haven't had much time for any open source project lately that wasn't directly part of my daily work. I totally forgot about this PR and will try to finish it as soon as possible, but I don't think I'll find the time to further contribute to this for the above mentioned reasons. Sorry about that and especially this old PR that was never finished... |
See #5
Gitlab::Client::#projectis used directly when creating issues and validating the issue tracker instead of iterating over all existing projects.