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

provider/gitlab: Add gitlab_group resource #14490

Merged
merged 2 commits into from
May 24, 2017

Conversation

richardc
Copy link
Contributor

This adds a gitlab_group resource, as suggested in #14471

This combined with #14483 should allow you to create projects in a
group (untested)

The implementation of this is a little ugly as go-gitlab doesn't have a
function already present for EditGroup, so we hack it into being as part
of the implementation of resourceGitlabGroupUpdate

@richardc
Copy link
Contributor Author

richardc commented May 15, 2017

TODO

  • Add documentation
  • Add tests
  • Try and clean up the hack of there being no UpdateGroup in go-gitlab with a fix there, or decide to live with this particular small aspect of technical debt.

@richardc
Copy link
Contributor Author

I'm working on a patch to add EditGroup to go-gitlab but until I've proposed that I can't speak to the cadence of getting that integrated neatly; in the interim I'm fairly comfortable with the implementation of resourceGitlabGroupUpdate to propose this as-is and then double back to rework once it is part of the go-gitlab api.

@richardc richardc changed the title [WIP] provider/gitlab: Add gitlab_group resource provider/gitlab: Add gitlab_group resource May 19, 2017
@richardc
Copy link
Contributor Author

Hah. In the time since thinking about this, the go-gitlab project has gained UpdateGroup; so hold on this; I need to bump the vendoring and then rework in terms of the new API; shouldn't be much work

@richardc richardc changed the title provider/gitlab: Add gitlab_group resource [WIP] provider/gitlab: Add gitlab_group resource May 19, 2017
Update go-gitlab to master@e6c11e.  This brings in UpdateGroup in
addition to fuller management of other attributes.
@richardc richardc changed the title [WIP] provider/gitlab: Add gitlab_group resource provider/gitlab: Add gitlab_group resource May 19, 2017
@richardc
Copy link
Contributor Author

Once again should be good to go.

This adds a gitlab_group resource.

This combined with hashicorp#14483 will allow you to create projects in a
group.
@stack72
Copy link
Contributor

stack72 commented May 24, 2017

Hi @richardc

Please can you tell me, does this remove the need to merge #14483 ?

Paul

@richardc
Copy link
Contributor Author

richardc commented May 24, 2017

It doesn't, I imagine that this will be used in conjunction with the addition of namespace_id in #14483, but it's not superceding that change.

Having said that it might make sense, with @hauleth's blessings, to combine that PR into this one as it'll allow for fairly simple acceptance tests to be added for gitlab_group#namepsace_id in terms of gitlab_group.foo.id

@stack72
Copy link
Contributor

stack72 commented May 24, 2017

Ok, I can merge them both locally and test them :) Thanks for the feedback

@stack72
Copy link
Contributor

stack72 commented May 24, 2017

This part LGTM!

% make testacc TEST=./builtin/providers/gitlab                                                                                             ✭
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/24 12:58:24 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/gitlab -v  -timeout 120m
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccGitlabDeployKey_basic
--- PASS: TestAccGitlabDeployKey_basic (34.11s)
=== RUN   TestAccGitlabGroup_basic
--- PASS: TestAccGitlabGroup_basic (20.91s)
=== RUN   TestAccGitlabProjectHook_basic
--- PASS: TestAccGitlabProjectHook_basic (27.07s)
=== RUN   TestAccGitlabProject_basic
--- PASS: TestAccGitlabProject_basic (30.81s)
=== RUN   TestGitlab_validation
--- PASS: TestGitlab_validation (0.00s)
=== RUN   TestGitlab_visbilityHelpers
--- PASS: TestGitlab_visbilityHelpers (0.00s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/gitlab	112.902s

Will test the other PR as well now

@stack72 stack72 merged commit 9e90e77 into hashicorp:master May 24, 2017
@hauleth
Copy link
Contributor

hauleth commented May 24, 2017

One thing. AFAIK new versions of GitLab allows to namespacing groups as well.

@richardc
Copy link
Contributor Author

@hauleth that's not reflected in the v3 api that I can see. Do you have api reference I should look at for a future enhancement?

@richardc richardc deleted the feature/add_gitlab_group branch May 24, 2017 12:20
@hauleth
Copy link
Contributor

hauleth commented May 24, 2017

@richardc I see it is named differently here, so maybe you've already support it: https://docs.gitlab.com/ee/api/groups.html#new-group as parent_id.

@richardc
Copy link
Contributor Author

@hauleth no, that's the v4 api, so it's not currently supported. I'll make an issue later to track things that will need to be revisited once go-gitlab supports the v4 api and put that on there. You can't have it before then

@hauleth
Copy link
Contributor

hauleth commented May 24, 2017

@richardc ok

@richardc
Copy link
Contributor Author

Meta-ticket for v4 upgrades created as #14823

@ghost
Copy link

ghost commented Apr 12, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants