-
Notifications
You must be signed in to change notification settings - Fork 319
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 importer to resource_gitlab_project_push_rules #360
Merged
roidelapluie
merged 2 commits into
gitlabhq:master
from
armsnyder:201-push-rules-importer
Aug 1, 2020
Merged
Add importer to resource_gitlab_project_push_rules #360
roidelapluie
merged 2 commits into
gitlabhq:master
from
armsnyder:201-push-rules-importer
Aug 1, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks! |
sfang97
pushed a commit
to sfang97/terraform-provider-gitlab
that referenced
this pull request
Sep 8, 2020
* Add importer to resource_gitlab_project_push_rules * Fix apparent copy-paste problem and inconsistency in push rules debug logs
sfang97
pushed a commit
to sfang97/terraform-provider-gitlab
that referenced
this pull request
Sep 15, 2020
author Ringo De Smet <ringo@de-smet.name> 1592760067 +0200 committer sfang97 <sfang@gitlab.com> 1600137187 -0500 parent 1cbab81 author Ringo De Smet <ringo@de-smet.name> 1592760067 +0200 committer sfang97 <sfang@gitlab.com> 1600137111 -0500 parent 1cbab81 author Ringo De Smet <ringo@de-smet.name> 1592760067 +0200 committer sfang97 <sfang@gitlab.com> 1600136946 -0500 Fix required Go version Add instance clusters to Terraform provider Add support for instance level cluster management via the Gitlab Terraform provider. Add instance cluster to provider Add instance cluster go file Add instance clusters to website Only test read instance cluster for now Add functionality to CRUD Tests mostly passing now, except a weird invalid URL escape thing, will investigate this Remove instance_clusters.go from this PR Contributed the instance API file to the upstream repo github.com/xanzy/go-gitlab, so removing from this PR Readding instance_clusters for failed pipeline Replace required libary in go mod Replace vendor with upstream in go mod Remove vendor files Remove changes to gitlab go Remove instance clusters from README Add management project param back in Rerun CI build Removing line for CI build Rerun CI pipeline Undo change to xanzy README Undo another change to README Change the commit to replace go-gitlab requirement Add go mod vendor to travis Move go mod vendors command to lint stage Change function names based on vendor change Remove replace package feat: Add support to create projects from templates Undo cherry pick This reverts commit 5191839. Update go mod to latest go-gitlab Remove changes to travis Remove newline for new pipeline Update docs, no instance ID Add backlashes so no italics Remove instance from example usage Remove white space, change instance link Address PR comments Add forcenew back to auth type run make fmt Prepare changelog for release v2.11.0 Cleanup after v2.11.0 release Fix Jira Service error handling (gitlabhq#363) Fix nil pointer dereferences during error handling (gitlabhq#364) * Fix error handling when deleting deploy key There was the possibility of a panic if response was nil, and the GitLab client already treats the 204 code as a success, so the extra check was not needed. * Fix nil pointer dereference issues in error messages correct management_project_id argument in documentation (gitlabhq#368) Fix incorrect description of valid access levels (gitlabhq#342) This minor change corrects a mistake showing `master` as a valid level of `group_access_level`. Import group labels (gitlabhq#339) * add support for importing gitlab group labels * fix resource name in the acceptance test * convert group ID to string Co-authored-by: David Townshend <david.townshend@allangray.co.za> Add importer to resource_gitlab_project_push_rules (gitlabhq#360) * Add importer to resource_gitlab_project_push_rules * Fix apparent copy-paste problem and inconsistency in push rules debug logs Bump go-gitlab to v.0.34.1 (gitlabhq#378) * Fix variable passed to ListLabelsOptions Needed to fix nested struct format * Don't need go mod changes * Add back go mod * Bump to 0.34.1 * Add 0.34.1 to modules.txt * Revert "Add 0.34.1 to modules.txt" This reverts commit 2ac4e3e. * Add vendor files for bump Co-authored-by: sfang97 <sfang@gitlab.com> Renamed the Github organization after the migration to https://github.com/gitlabhq Change isRunningInEE test Fix import packages Call configure in provider test Only initialize provider in acceptance tests Remove undefined resource reference Add undefined testenvvar Had to run make fmt Remove unused variable Reference testenvvar resource correctly Add group_ldap_link to index Signed-off-by: Sune Keller <absukl@almbrand.dk> Adding project miorror and tests responding to PR comments, removing import state verify for acceptance test Setting all properties in SetToState removed commented out ignore adding docs page adding to index Store more attributes into the state Fix missing test checks in the resource user Allow to change user email address without creating a new resource Fix the external flag being mapped to admin instead Switching the external flag makes tests fail Add new data source gitlab_group_membership Allow to filter members by their access_level Add new doc page to gitlab.erb Update website/gitlab.erb Co-authored-by: Adam Snyder <armsnyder@gmail.com> Added Quotes in the example for group cluster Prepare changelog for release Cleanup after v2.11.0 release Fix Jira Service error handling (gitlabhq#363) Fix nil pointer dereferences during error handling (gitlabhq#364) * Fix error handling when deleting deploy key There was the possibility of a panic if response was nil, and the GitLab client already treats the 204 code as a success, so the extra check was not needed. * Fix nil pointer dereference issues in error messages correct management_project_id argument in documentation (gitlabhq#368) Fix incorrect description of valid access levels (gitlabhq#342) This minor change corrects a mistake showing `master` as a valid level of `group_access_level`. Import group labels (gitlabhq#339) * add support for importing gitlab group labels * fix resource name in the acceptance test * convert group ID to string Co-authored-by: David Townshend <david.townshend@allangray.co.za> Add importer to resource_gitlab_project_push_rules (gitlabhq#360) * Add importer to resource_gitlab_project_push_rules * Fix apparent copy-paste problem and inconsistency in push rules debug logs Bump go-gitlab to v.0.34.1 (gitlabhq#378) * Fix variable passed to ListLabelsOptions Needed to fix nested struct format * Don't need go mod changes * Add back go mod * Bump to 0.34.1 * Add 0.34.1 to modules.txt * Revert "Add 0.34.1 to modules.txt" This reverts commit 2ac4e3e. * Add vendor files for bump Co-authored-by: sfang97 <sfang@gitlab.com> Change isRunningInEE test Fix import packages Call configure in provider test Only initialize provider in acceptance tests Remove undefined resource reference Add undefined testenvvar Had to run make fmt Remove unused variable Reference testenvvar resource correctly Add group_ldap_link to index Signed-off-by: Sune Keller <absukl@almbrand.dk> Adding project miorror and tests responding to PR comments, removing import state verify for acceptance test Setting all properties in SetToState removed commented out ignore adding docs page adding to index Store more attributes into the state Fix missing test checks in the resource user Allow to change user email address without creating a new resource Fix the external flag being mapped to admin instead Switching the external flag makes tests fail Allow to filter members by their access_level Update website/gitlab.erb Co-authored-by: Adam Snyder <armsnyder@gmail.com> Added Quotes in the example for group cluster Remove redundant test func Add managed test Address PR comments Revert "Address PR comments" This reverts commit a963eaf. Remove managed and enabled for now
sfang97
added a commit
that referenced
this pull request
Sep 15, 2020
author Ringo De Smet <ringo@de-smet.name> 1592760067 +0200 committer sfang97 <sfang@gitlab.com> 1600137187 -0500 parent 1cbab81 author Ringo De Smet <ringo@de-smet.name> 1592760067 +0200 committer sfang97 <sfang@gitlab.com> 1600137111 -0500 parent 1cbab81 author Ringo De Smet <ringo@de-smet.name> 1592760067 +0200 committer sfang97 <sfang@gitlab.com> 1600136946 -0500 Fix required Go version Add instance clusters to Terraform provider Add support for instance level cluster management via the Gitlab Terraform provider. Add instance cluster to provider Add instance cluster go file Add instance clusters to website Only test read instance cluster for now Add functionality to CRUD Tests mostly passing now, except a weird invalid URL escape thing, will investigate this Remove instance_clusters.go from this PR Contributed the instance API file to the upstream repo github.com/xanzy/go-gitlab, so removing from this PR Readding instance_clusters for failed pipeline Replace required libary in go mod Replace vendor with upstream in go mod Remove vendor files Remove changes to gitlab go Remove instance clusters from README Add management project param back in Rerun CI build Removing line for CI build Rerun CI pipeline Undo change to xanzy README Undo another change to README Change the commit to replace go-gitlab requirement Add go mod vendor to travis Move go mod vendors command to lint stage Change function names based on vendor change Remove replace package feat: Add support to create projects from templates Undo cherry pick This reverts commit 5191839. Update go mod to latest go-gitlab Remove changes to travis Remove newline for new pipeline Update docs, no instance ID Add backlashes so no italics Remove instance from example usage Remove white space, change instance link Address PR comments Add forcenew back to auth type run make fmt Prepare changelog for release v2.11.0 Cleanup after v2.11.0 release Fix Jira Service error handling (#363) Fix nil pointer dereferences during error handling (#364) * Fix error handling when deleting deploy key There was the possibility of a panic if response was nil, and the GitLab client already treats the 204 code as a success, so the extra check was not needed. * Fix nil pointer dereference issues in error messages correct management_project_id argument in documentation (#368) Fix incorrect description of valid access levels (#342) This minor change corrects a mistake showing `master` as a valid level of `group_access_level`. Import group labels (#339) * add support for importing gitlab group labels * fix resource name in the acceptance test * convert group ID to string Co-authored-by: David Townshend <david.townshend@allangray.co.za> Add importer to resource_gitlab_project_push_rules (#360) * Add importer to resource_gitlab_project_push_rules * Fix apparent copy-paste problem and inconsistency in push rules debug logs Bump go-gitlab to v.0.34.1 (#378) * Fix variable passed to ListLabelsOptions Needed to fix nested struct format * Don't need go mod changes * Add back go mod * Bump to 0.34.1 * Add 0.34.1 to modules.txt * Revert "Add 0.34.1 to modules.txt" This reverts commit 2ac4e3e. * Add vendor files for bump Co-authored-by: sfang97 <sfang@gitlab.com> Renamed the Github organization after the migration to https://github.com/gitlabhq Change isRunningInEE test Fix import packages Call configure in provider test Only initialize provider in acceptance tests Remove undefined resource reference Add undefined testenvvar Had to run make fmt Remove unused variable Reference testenvvar resource correctly Add group_ldap_link to index Signed-off-by: Sune Keller <absukl@almbrand.dk> Adding project miorror and tests responding to PR comments, removing import state verify for acceptance test Setting all properties in SetToState removed commented out ignore adding docs page adding to index Store more attributes into the state Fix missing test checks in the resource user Allow to change user email address without creating a new resource Fix the external flag being mapped to admin instead Switching the external flag makes tests fail Add new data source gitlab_group_membership Allow to filter members by their access_level Add new doc page to gitlab.erb Update website/gitlab.erb Co-authored-by: Adam Snyder <armsnyder@gmail.com> Added Quotes in the example for group cluster Prepare changelog for release Cleanup after v2.11.0 release Fix Jira Service error handling (#363) Fix nil pointer dereferences during error handling (#364) * Fix error handling when deleting deploy key There was the possibility of a panic if response was nil, and the GitLab client already treats the 204 code as a success, so the extra check was not needed. * Fix nil pointer dereference issues in error messages correct management_project_id argument in documentation (#368) Fix incorrect description of valid access levels (#342) This minor change corrects a mistake showing `master` as a valid level of `group_access_level`. Import group labels (#339) * add support for importing gitlab group labels * fix resource name in the acceptance test * convert group ID to string Co-authored-by: David Townshend <david.townshend@allangray.co.za> Add importer to resource_gitlab_project_push_rules (#360) * Add importer to resource_gitlab_project_push_rules * Fix apparent copy-paste problem and inconsistency in push rules debug logs Bump go-gitlab to v.0.34.1 (#378) * Fix variable passed to ListLabelsOptions Needed to fix nested struct format * Don't need go mod changes * Add back go mod * Bump to 0.34.1 * Add 0.34.1 to modules.txt * Revert "Add 0.34.1 to modules.txt" This reverts commit 2ac4e3e. * Add vendor files for bump Co-authored-by: sfang97 <sfang@gitlab.com> Change isRunningInEE test Fix import packages Call configure in provider test Only initialize provider in acceptance tests Remove undefined resource reference Add undefined testenvvar Had to run make fmt Remove unused variable Reference testenvvar resource correctly Add group_ldap_link to index Signed-off-by: Sune Keller <absukl@almbrand.dk> Adding project miorror and tests responding to PR comments, removing import state verify for acceptance test Setting all properties in SetToState removed commented out ignore adding docs page adding to index Store more attributes into the state Fix missing test checks in the resource user Allow to change user email address without creating a new resource Fix the external flag being mapped to admin instead Switching the external flag makes tests fail Allow to filter members by their access_level Update website/gitlab.erb Co-authored-by: Adam Snyder <armsnyder@gmail.com> Added Quotes in the example for group cluster Remove redundant test func Add managed test Address PR comments Revert "Address PR comments" This reverts commit a963eaf. Remove managed and enabled for now Co-authored-by: Ringo De Smet <ringo@de-smet.name>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds an importer to the
gitlab_project_push_rules
resource.This closes #201, closes #239, and closes #352.
Note that I am not using the push rule resource ID as the import ID. I am instead using the project ID. The reason for this is that in practice, the project ID is the primary key. It's the only value used in the resource's Read function. I didn't want to change the resource ID because that would be a breaking change.
I've tested this import functionality using a local build and can verify that it works.