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

Fix issues with user's teams not set properly and update user's roles #138

Merged
merged 1 commit into from
Jul 19, 2019

Conversation

pengux
Copy link
Contributor

@pengux pengux commented Jul 19, 2019

This PR fixes 2 issues:

  1. Teams in the user's resource not set properly, related to r/pagerduty_escalation_policy: correctly set teams #129
  2. Fix acceptance tests not passing because of updated list of user roles

Acceptance test

TF_ACC=1 go test -run TestAccPagerDutyUser_Basic ./pagerduty -v -timeout 120m
=== RUN   TestAccPagerDutyUser_Basic
--- PASS: TestAccPagerDutyUser_Basic (18.44s)
PASS
ok      github.com/terraform-providers/terraform-provider-pagerduty/pagerduty   18.468s
TF_ACC=1 go test -run TestAccPagerDutyTeamMembership_Basic ./pagerduty -v -timeout 120m
=== RUN   TestAccPagerDutyTeamMembership_Basic
--- PASS: TestAccPagerDutyTeamMembership_Basic (16.71s)
PASS
ok      github.com/terraform-providers/terraform-provider-pagerduty/pagerduty   16.746s

Step to reproduce the issue:

Using terraform

Example HCL

resource "pagerduty_user" "foo" {
  name = "Foo"
  email = "foo@foo.com"
  teams = ["${pagerduty_team.foo.id}"]
}

resource "pagerduty_team" "foo" {
  name        = "Foo"
  description = "foo"
}

Setup user and team in Pagerduty based on the configuration from the HCL above.
Import the terraform HCL above with terraform import
Doing a terraform plan now shows a difference where the team information was not imported

Copy link
Collaborator

@heimweh heimweh left a comment

Choose a reason for hiding this comment

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

Hi @pengux,
thank you so much for this 🙏

This LGTM 👍

@heimweh heimweh merged commit 38eba13 into PagerDuty:master Jul 19, 2019
@islomar islomar deleted the pn/fix-users-team branch July 26, 2019 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants