Skip to content

fixes getProjects(namespace, name) with a search - #208

Open
ctabin wants to merge 3 commits into
timols:masterfrom
ctabin:fix/getProjects
Open

fixes getProjects(namespace, name) with a search#208
ctabin wants to merge 3 commits into
timols:masterfrom
ctabin:fix/getProjects

Conversation

@ctabin

@ctabin ctabin commented May 18, 2017

Copy link
Copy Markdown
Contributor

Hello,

Here is a little contribution to fix the getProject(String namespace, String projectName) method, because in the Gitlab API, you can only access a project by its ID. Hence you need to do a search and compare it with retrieved projects.

Any feedback is welcomed :-)

Best regards,
Cédric

public GitlabProject getProject(String namespace, String projectName) throws IOException{
String tailUrl = GitlabProject.URL + "/" + namespace + "%2F" + projectName;
return retrieve().to(tailUrl, GitlabProject.class);
String fullName = namespace+" / "+projectName;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be?

String fullName = namespace + "/" + projectName;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested on our internal GitLab and we really have a space between each side of the slash. It's working with the changes.

However, may this be a GitLab configuration ?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmm. It might just be stripping whitespace?

@ctabin

ctabin commented May 31, 2017

Copy link
Copy Markdown
Contributor Author

Hi,

I changed slightly the implementation to check the Namespace name. It's safer now :-)

Best,
Cédric

@novalis

novalis commented Sep 19, 2017

Copy link
Copy Markdown
Contributor

I am able to access a project by namespace and name against Gitlab EE 9.4. It's important to escape the namespace (see #254).

@ctabin

ctabin commented Mar 17, 2019

Copy link
Copy Markdown
Contributor Author

@novalis I checked with the latest version (4.1.0) against our GitLab CE 11.8.1 and I still have the same problem... Maybe there is a difference on this between CE and EE ?

@novalis

novalis commented Mar 17, 2019

Copy link
Copy Markdown
Contributor

I won't be able to check this out until early June. Please pester me then. If it's more urgent, maybe @jhedwardyang can take a look. The space seems extremely unlikely, but what do I know?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants