Deployment Freeze Checks
MediumIntervals · Atlassian
Teams are not allowed to deploy during freeze windows. You are given:
deployments: rows[team, timestamp].freeze_windows: rows[start, end, team]. A window blocks deployments byteamat any timetwithstart <= t <= end(both ends inclusive). A window whose team is"*"blocks every team.
Windows may overlap and are given in no particular order. Team names are case-sensitive.
Return a list of booleans, one per deployment in input order: True if the deployment is allowed, False if any applicable freeze window covers its timestamp.
Example 1
- Input:
- deployments = [["web", 5], ["core", 5], ["core", 12], ["data", 20]], freeze_windows = [[0, 10, "core"], [12, 12, "core"], [18, 25, "*"]]
- Output:
- [True, False, False, False]
- Explanation
webhas no window of its own and no global window covers time 5, so it may deploy.coreis frozen during 0..10 and again at exactly 12. At time 20 the global window 18..25 blocksdata.
Example 2
- Input:
- deployments = [["core", 0], ["core", 30], ["core", 31]], freeze_windows = [[0, 30, "core"]]
- Output:
- [False, False, True]
- Explanation
- Both ends of the window 0..30 are inclusive, so times 0 and 30 are blocked and 31 is the first allowed time.
Example 3
- Input:
- deployments = [["infra", 3]], freeze_windows = []
- Output:
- [True]
- Explanation
- With no freeze windows every deployment is allowed.
Constraints
0 <= deployments.length <= 10^50 <= freeze_windows.length <= 10^5-10^9 <= start <= end <= 10^9and-10^9 <= timestamp <= 10^9