Skip to content
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

Apply shift swap requests to schedule events #2677

Merged
merged 6 commits into from
Jul 28, 2023
Merged

Conversation

matiasb
Copy link
Contributor

@matiasb matiasb commented Jul 28, 2023

Reflect swap requests details in schedule events.

@matiasb matiasb added the pr:no public docs Added to a PR that does not require public documentation updates label Jul 28, 2023
Q(**User.build_permissions_query(RBACPermission.Permissions.SCHEDULES_WRITE, organization))
& (Q(username__in=usernames) | Q(email__lower__in=emails))
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Iterating over schedule events and getting users with an OR query doesn't seem better than going the original path (did some testing). Also, when applying swaps, if a user wasn't part of the original schedule, we don't get that user information.

@matiasb matiasb marked this pull request as ready for review July 28, 2023 15:08
@matiasb matiasb requested a review from a team July 28, 2023 15:08
Comment on lines -125 to +178
# TODO: implement the actual override logic in https://github.com/grafana/oncall/issues/2590
# make sure final schedule ical representation is updated
refresh_ical_final_schedule.apply_async((self.schedule.pk,))
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

@matiasb matiasb force-pushed the matiasb/take-swap-request branch from 0328aa3 to 7cd0b77 Compare July 28, 2023 17:11
@matiasb matiasb force-pushed the matiasb/take-swap-request branch from 7cd0b77 to 11f5b80 Compare July 28, 2023 17:40
@@ -61,7 +60,6 @@
def users_in_ical(
usernames_from_ical: typing.List[str],
organization: "Organization",
users_to_filter: typing.Optional["UserQuerySet"] = None,
) -> typing.Sequence["User"]:
Copy link
Contributor

Choose a reason for hiding this comment

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

we can probably change the return type here. I believe it was like this to accommodate the union between a list and a queryset

@matiasb matiasb force-pushed the matiasb/take-swap-request branch from 058fb09 to fd95dc8 Compare July 28, 2023 18:14
@matiasb matiasb force-pushed the matiasb/take-swap-request branch from fd95dc8 to c788b93 Compare July 28, 2023 18:25
@matiasb matiasb added this pull request to the merge queue Jul 28, 2023
Merged via the queue into dev with commit ddd98e0 Jul 28, 2023
@matiasb matiasb deleted the matiasb/take-swap-request branch July 28, 2023 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:no public docs Added to a PR that does not require public documentation updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants