-
Notifications
You must be signed in to change notification settings - Fork 7
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 showTrend to Question #173
Add showTrend to Question #173
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MartinodF - first off thank you for making these changes and sorry for taking so long to get back to you on this. If you have time, can you make the changes required, otherwise I can close this PR and resubmit a new PR with the required changes.
I've left 2 comments. To your point, lets exclude the PR making changes to the rule resource. This is subject to change again very soon. Besides the comments in the code, the following two functions also need to be updated (both in resource_question.go
): BuildQuestion
and BuildCreateQuestionInput
. We need to add the ShowTrend
variable to the question input. So the changes should look like:
func (qm *QuestionModel) BuildQuestion() client.QuestionUpdate {
q := client.QuestionUpdate{
Title: qm.Title.ValueString(),
Description: qm.Description.ValueString(),
Tags: qm.Tags,
ShowTrend: qm.ShowTrend.ValueBool(),
PollingInterval: client.SchedulerPollingInterval(qm.PollingInterval.ValueString()),
}
and
func (qm *QuestionModel) BuildCreateQuestionInput() client.CreateQuestionInput {
q := client.CreateQuestionInput{
Title: qm.Title.ValueString(),
Description: qm.Description.ValueString(),
PollingInterval: client.SchedulerPollingInterval(qm.PollingInterval.ValueString()),
ShowTrend: qm.ShowTrend.ValueBool(),
Tags: qm.Tags,
}
Let me know if you have any questions.
903214c
to
65cc612
Compare
Hey Chad, thank you for the feedback. I've applied the requested changes:
Let me know if there's anything else that needs to be addressed! |
Looks good thanks @MartinodF, one last thing and then I can approve, can you run a |
Expose the showTrend field to allow terraform users to read and update its value. Add tests for reading it (no update needed to cassettes, as they already contained it) and for validating it as a proper boolean.
65cc612
to
a4e8453
Compare
You are right. I did run |
This PR exposes the
showTrend
field on the Question object, allowing terraform users to read and update its value.I've added basic tests for reading it (no update needed to cassettes, as they already contained it) and for validating it as a proper boolean.
While re-generating the GraphQL client and related docs to add
showTrend
, a couple of additional fields and values were also updated:questionName
was removed from Ruletrigger_on_new_only
was added to RuleFIFTEEN_MINUTES
was added as an acceptable value for SchedulerPollingIntervalThose changes are in a separate commit in case you want to exclude them.