Skip to content

Conversation

@bernardjkim
Copy link
Contributor

@bernardjkim bernardjkim commented Sep 11, 2025

Supports: #51682, #55075
RFD: #57334
Requires: #59007

Changelog: Enabled use of schedules within automatic review and notification access_monitoring_rules

Base automatically changed from bernard/amr-schedules to master September 30, 2025 21:52
@bernardjkim bernardjkim force-pushed the bernard/condition-schedules branch from e7e61ea to 9607e8e Compare September 30, 2025 23:01
@bernardjkim bernardjkim force-pushed the bernard/condition-schedules branch from 9607e8e to ef4e98a Compare September 30, 2025 23:10
@bernardjkim bernardjkim marked this pull request as ready for review October 1, 2025 02:42
@github-actions github-actions bot requested review from atburke and ryanclark October 1, 2025 02:43
Copy link
Collaborator

@r0mant r0mant left a comment

Choose a reason for hiding this comment

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

@bernardjkim I've a question about the UX. Why is access_request.spec.creation_time.in_schedule(xxx) required at all as a part of the predicate condition? Would there be a downside to simplifying this and always applying the schedules if they're defined on the AMR?

@hugoShaka
Copy link
Contributor

@bernardjkim I've a question about the UX. Why is access_request.spec.creation_time.in_schedule(xxx) required at all as a part of the predicate condition? Would there be a downside to simplifying this and always applying the schedules if they're defined on the AMR?

I think that being explicit is better because you can combine with other rules, do OR, ... This is way more versatile than gluing a generic rule with an AND on top of the expression. This can also be extended if we add more data into the context. The design is inspired by what the OPA does.

@bernardjkim
Copy link
Contributor Author

@r0mant as discussed offline, I've simplified the implementation to remove the need for schedule conditions, and consider all schedules by default.

@hugoShaka we agree that the schedule conditions would provide a lot more versatility when configuring rules. However, we thought it might be best to keep it simple for now, and focus on the initial scope of the feature request. Open to discussing it more if you have strong opinions.

@bernardjkim bernardjkim requested review from r0mant and removed request for atburke and ryanclark October 1, 2025 22:22
@bernardjkim bernardjkim force-pushed the bernard/condition-schedules branch from 3cd53c6 to 46b4f85 Compare October 15, 2025 19:24
continue
}
if len(rule.GetSpec().GetSchedules()) != 0 && !isInSchedules {
continue
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here and below, should we log that we're skipping the request because the schedule doesn't match?

@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from hugoShaka October 15, 2025 22:22
@bernardjkim bernardjkim added this pull request to the merge queue Oct 15, 2025
Merged via the queue into master with commit bb166ff Oct 15, 2025
39 checks passed
@bernardjkim bernardjkim deleted the bernard/condition-schedules branch October 15, 2025 23:55
@backport-bot-workflows
Copy link
Contributor

@bernardjkim See the table below for backport results.

Branch Result
branch/v18 Create PR

mmcallister pushed a commit that referenced this pull request Nov 6, 2025
* Implement schedules conditions

* Fix lint

* Remove schedules predicate expression

Consider all configured schedules by default

* Support schedules within notification rules

* Use timezone during evaluation

* Add debug logs
mmcallister pushed a commit that referenced this pull request Nov 19, 2025
* Implement schedules conditions

* Fix lint

* Remove schedules predicate expression

Consider all configured schedules by default

* Support schedules within notification rules

* Use timezone during evaluation

* Add debug logs
mmcallister pushed a commit that referenced this pull request Nov 20, 2025
* Implement schedules conditions

* Fix lint

* Remove schedules predicate expression

Consider all configured schedules by default

* Support schedules within notification rules

* Use timezone during evaluation

* Add debug logs
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.

5 participants