From f891f4324da54072d65b16caebc441972b330729 Mon Sep 17 00:00:00 2001 From: Victor Lyuboslavsky Date: Tue, 13 Aug 2024 16:08:23 +0200 Subject: [PATCH] Schedule maintenance window over "Free" events. (#21269) #21268 # Checklist for submitter If some of the following don't apply, delete the relevant line. - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information. - [x] Manual QA for all new/changed functionality --- changes/21268-calendar-free | 1 + ee/server/calendar/google_calendar.go | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 changes/21268-calendar-free diff --git a/changes/21268-calendar-free b/changes/21268-calendar-free new file mode 100644 index 0000000000..f51a103ecf --- /dev/null +++ b/changes/21268-calendar-free @@ -0,0 +1 @@ +Scheduled maintenance events will now be scheduled over calendar events marked "Free" (not busy) in Google Calendar. diff --git a/ee/server/calendar/google_calendar.go b/ee/server/calendar/google_calendar.go index 39c31d4807..7abbc6c4c6 100644 --- a/ee/server/calendar/google_calendar.go +++ b/ee/server/calendar/google_calendar.go @@ -597,6 +597,11 @@ func (c *GoogleCalendar) createEvent( continue } + if gEvent.Transparency == "transparent" { + // Ignore events that do not block time on the calendar (e.g. free events) + continue + } + // Ignore events that the user has declined var declined bool for _, attendee := range gEvent.Attendees {