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

Adding pagerduty_priority data source #219

Merged
merged 3 commits into from
Apr 29, 2020

Conversation

stmcallister
Copy link
Contributor

This adds the pagerduty_priority data source and fixes some bugs in the documentation. Addresses issues #216

Test results:

TF_ACC=1 go test -run "TestAccDataSourcePagerDutyPriority_*" ./pagerduty -v -timeout 120m
=== RUN   TestAccDataSourcePagerDutyPriority_Basic
--- PASS: TestAccDataSourcePagerDutyPriority_Basic (2.05s)
=== RUN   TestAccDataSourcePagerDutyPriority_P2
--- PASS: TestAccDataSourcePagerDutyPriority_P2 (2.32s)
PASS
ok  	github.com/terraform-providers/terraform-provider-pagerduty/pagerduty	5.387s

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.

Nice job! This LGTM 👍

@stmcallister stmcallister merged commit f1557a9 into PagerDuty:master Apr 29, 2020
Copy link

@ivssh ivssh left a comment

Choose a reason for hiding this comment

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

Have left a comment regarding the implementation of data source priority in ruleset_rule resource.

value = "P5DTL0K"
}
priority {
value = pagerduty_priority.p1.id
Copy link

Choose a reason for hiding this comment

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

I guess it should be data.pagerduty_priority.p1.id instead of pagerduty_priority.p1.id

Copy link

Choose a reason for hiding this comment

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

@stmcallister Any thoughts on this?

@pdecat
Copy link
Contributor

pdecat commented Aug 18, 2021

FTR, acceptance tests for priorities are failing with development accounts:

=== RUN   TestAccDataSourcePagerDutyPriority_Basic
    data_source_pagerduty_priority_test.go:11: Step 1/1 error: Error running pre-apply refresh: exit status 1

        Error: GET API call to https://api.pagerduty.com/priorities failed: 404 Not Found

          with data.pagerduty_priority.p1,
          on terraform_plugin_test.tf line 2, in data "pagerduty_priority" "p1":
           2: data "pagerduty_priority" "p1" {

--- FAIL: TestAccDataSourcePagerDutyPriority_Basic (1.20s)
=== RUN   TestAccDataSourcePagerDutyPriority_P2
    data_source_pagerduty_priority_test.go:27: Step 1/1 error: Error running pre-apply refresh: exit status 1

        Error: GET API call to https://api.pagerduty.com/priorities failed: 404 Not Found

          with data.pagerduty_priority.p2,
          on terraform_plugin_test.tf line 2, in data "pagerduty_priority" "p2":
           2: data "pagerduty_priority" "p2" {

This test could be skipped if the incident_priority_activated ability is not returned by the https://api.pagerduty.com/abilities endpoint

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

Successfully merging this pull request may close these issues.

4 participants