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

Handle Gitlab subgroups #74

Open
mspangdal opened this issue May 21, 2019 · 4 comments
Open

Handle Gitlab subgroups #74

mspangdal opened this issue May 21, 2019 · 4 comments

Comments

@mspangdal
Copy link

mspangdal commented May 21, 2019

The {{ownerName}} and {{repoName}} doesn't seem to be correctly populated given a gitlab url such as:
https://gitlab.server/Group/SubGroup/Project.git

In this case ownerName is set to SubGroup and Group is ignored
More on subgroups in Gitlab: https://docs.gitlab.com/ee/user/group/subgroups/

For our use case it would be sufficient if Subgroups are treated as part of the Project name ownerName is set to the parent Group as would be expected

But I suppose this introduces more edge cases where gitlab is not hosted at the root of the domain?

@mspangdal mspangdal changed the title Handle gitlab groups Handle Gitlab subgroups May 21, 2019
mspangdal added a commit to mspangdal/git-changelog-lib that referenced this issue May 21, 2019
mspangdal added a commit to mspangdal/git-changelog-lib that referenced this issue May 21, 2019
@tomasbjerre
Copy link
Owner

Are you working on a PR for this @mspangdal ?

How do you use the library? Jenkins plugin?

@mspangdal
Copy link
Author

Yeah, Jenkins plugin. I don't have a clear idea of how to solve it yet so just looking at the code for now

@tomasbjerre
Copy link
Owner

Ok. When using it in Jenkins, in a pipeline, you can probably determine the group somehow using plain old groovy code. And then use that value in the template... So that Groovy will substitute that variable first, before Mustache will substitute the other variables. Something like this:

 def groupName = //TODO: parse values from git clone URL here...

 def changelogString = gitChangelog returnType: 'STRING',
  from: [type: 'REF', value: 'git-changelog-1.50'],
  to: [type: 'REF', value: 'master'],
  template: """
GroupName: ${groupName}
...
Rest of the template here...
  """

@mspangdal
Copy link
Author

Thats a good point, quick way forward!

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

No branches or pull requests

2 participants