Create NotificationRule request contains property activeStatus not defined in openapi
- Dominant language
- TypeScript
- Stars
- 117
- Forks
- 51
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 4
Description
## About the bug
**Steps to reproduce:**
List the minimal actions needed to reproduce the behavior.
1. create a check
2. create an endpoint
3. click create endpoint
4. select the previously created check and endpoint
5. Open developer tools > network
6. save
7. In developer tools inspect the response
**Expected behavior:**
Expect the generated request body POSTed to the server to include only properties defined for the API by openapi.
**Actual behavior:**
The request contains a property `activeStatus` which is not found in the current openApi spec.
The response body also does not include this property.
**Visual Proof:**
The request (from developer tools)
```
{
"type":"http",
"every":"10m",
"offset":"0s",
"url":"",
"orgID":"9c5955fc99a60b8f",
"name":"Test Rule",
"activeStatus":"active",
"status":"active",
"endpointID":"0a0bd2fd79fd1000",
"tagRules":[],
"labels":[],
"statusRules":
[
{"currentLevel":"CRIT","period":"1h","count":1}
],
"description":""
}
```
The response - no field `activeStatus`
```
{
"id":"0a0bd30f0ee26000",
"name":"Test Rule",
"endpointID":"0a0bd2fd79fd1000",
"orgID":"9c5955fc99a60b8f",
"ownerID":"04f1860f2f5a0573",
"taskID":"0a0bd30f11e14000",
"every":"10m",
"offset":"0s",
"runbookLink":"",
"statusRules":
[
{
"currentLevel":"CRIT",
"previousLevel":null
}
],
"createdAt":"2022-09-27T14:16:57.14795364Z",
"updatedAt":"2022-09-27T14:16:57.14795364Z",
"type":"http",
"labels":[],
"links":
{
"self":"/api/v2/notificationRules/0a0bd30f0ee26000",
"labels":"/api/v2/notificationRules/0a0bd30f0ee26000/labels",
"members":"/api/v2/notificationRules/0a0bd30f0ee26000/members",
"owners":"/api/v2/notificationRules/0a0bd30f0ee26000/owners",
"query":"/api/v2/notificationRules/0a0bd30f0ee26000/query"
},
"status":"active",
"latestCompleted":"2022-09-27T14:16:57Z",
"latestScheduled":"2022-09-27T14:16:57Z",
"taskID":"0a0bd30f11e14000"
}
```
Grep for activeStatus in openapi project
```
~/bonitoo/prjs/github.com/influxdata/openapi$ grep -Rn "activeStatus" *
~/bonitoo/prjs/github.com/influxdata/openapi$
```
OpenAPI NotificationRuleBase.yml (no property activeStatus defined)
```
type: object
required:
- orgID
- status
- name
- statusRules
- endpointID
properties:
latestCompleted:
description: A timestamp ([RFC3339 date/time format]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run.
type: string
format: date-time
readOnly: true
lastRunStatus:
readOnly: true
type: string
enum:
- failed
- success
- canceled
lastRunError:
readOnly: true
type: string
id:
readOnly: true
type: string
endpointID:
type: string
orgID:
description: The ID of the organization that owns this notification rule.
type: string
taskID:
description: The ID of the task associated with this notification rule.
type: string
ownerID:
description: The ID of creator used to create this notification rule.
type: string
readOnly: true
createdAt:
type: string
format: date-time
readOnly: true
updatedAt:
type: string
format: date-time
readOnly: true
status:
$ref: "./TaskStatusType.yml"
name:
description: Human-readable name describing the notification rule.
type: string
sleepUntil:
type: string
every:
description: The notification repetition interval.
type: string
offset:
description: Duration to delay after the schedule, before executing check.
type: string
runbookLink:
type: string
limitEvery:
description: Don't notify me more than times every seconds. If set, limit cannot be empty.
type: integer
limit:
description: Don't notify me more than times every seconds. If set, limitEvery cannot be empty.
type: integer
tagRules:
description: List of tag rules the notification rule attempts to match.
type: array
items:
$ref: "./TagRule.yml"
description:
description: An optional description of the notification rule.
type: string
statusRules:
description: List of status rules the notification rule attempts to match.
type: array
minItems: 1
items:
$ref: "./StatusRule.yml"
labels:
$ref: "./Labels.yml"
links:
type: object
readOnly: true
example:
self: "/api/v2/notificationRules/1"
labels: "/api/v2/notificationRules/1/labels"
members: "/api/v2/notificationRules/1/members"
owners: "/api/v2/notificationRules/1/owners"
query: "/api/v2/notificationRules/1/query"
properties:
self:
description: URL for this endpoint.
$ref: "./Link.yml"
labels:
description: URL to retrieve labels for this notification rule.
$ref: "./Link.yml"
members:
description: URL to retrieve members for this notification rule.
$ref: "./Link.yml"
owners:
description: URL to retrieve owners for this notification rule.
$ref: "./Link.yml"
query:
description: URL to retrieve flux script for this notification rule.
$ref: "./Link.yml"
```
## About your environment
**Environment info:**
Testing against remocal K8SIDPE...
Latest commit in openapi
```
commit ad64ba87e7dd666feb80bbb85d1757b3d290d6c3 (HEAD -> master, origin/master, origin/HEAD)
Author: wiedld
Date: Thu Sep 22 10:01:37 2022 -0700
```
Testing in K8SIDPE - latest commit
```
commit d3c2922e6c43cc6d7708a1622d6d2d7b1943b769 (HEAD -> master, origin/master, origin/HEAD)
Author: influx-acs[bot] <107396960+influx-acs[bot]@users.noreply.github.com>
Date: Tue Sep 27 01:45:24 2022 +0000
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.