Skip to content

Commit

Permalink
Merge pull request #80 from middlewarehq/parse-filter
Browse files Browse the repository at this point in the history
Parse PR filter
  • Loading branch information
samad-yar-khan authored Apr 15, 2024
2 parents f6897c4 + f06d7c1 commit 49b5116
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions apiserver/dora/api/incidents.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

from flask import Blueprint
from voluptuous import Required, Schema, Coerce, All, Optional
from dora.service.code.pr_filter import apply_pr_filter
from dora.store.models.code.filter import PRFilter
from dora.store.models.settings import SettingType, EntityType
from dora.service.incidents.models.mean_time_to_recovery import ChangeFailureRateMetrics
from dora.service.deployments.deployment_service import (
get_deployments_service,
Expand Down Expand Up @@ -75,6 +78,10 @@ def get_deployments_with_related_incidents(
interval = Interval(from_time, to_time)
query_validator.team_validator(team_id)

pr_filter: PRFilter = apply_pr_filter(
pr_filter, EntityType.TEAM, team_id, [SettingType.EXCLUDED_PRS_SETTING]
)

deployments: List[
Deployment
] = get_deployments_service().get_team_all_deployments_in_interval(
Expand Down Expand Up @@ -173,6 +180,10 @@ def get_team_cfr(
interval = Interval(from_time, to_time)
query_validator.team_validator(team_id)

pr_filter: PRFilter = apply_pr_filter(
pr_filter, EntityType.TEAM, team_id, [SettingType.EXCLUDED_PRS_SETTING]
)

deployments: List[
Deployment
] = get_deployments_service().get_team_all_deployments_in_interval(
Expand Down Expand Up @@ -213,6 +224,10 @@ def get_team_cfr_trends(
interval = Interval(from_time, to_time)
query_validator.team_validator(team_id)

pr_filter: PRFilter = apply_pr_filter(
pr_filter, EntityType.TEAM, team_id, [SettingType.EXCLUDED_PRS_SETTING]
)

deployments: List[
Deployment
] = get_deployments_service().get_team_all_deployments_in_interval(
Expand Down

0 comments on commit 49b5116

Please sign in to comment.