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

Fix "Warning: failed to assign" bug #98

Open
ChrisBAshton opened this issue Dec 19, 2024 · 0 comments
Open

Fix "Warning: failed to assign" bug #98

ChrisBAshton opened this issue Dec 19, 2024 · 0 comments

Comments

@ChrisBAshton
Copy link
Contributor

ChrisBAshton commented Dec 19, 2024

See code:

# TODO: this message can happen when someone has two distinct back-to-back
# shifts, e.g. someone covering bank holiday may have inhours_primary 9:30-17:30
# followed by oncall_primary 17:30-9:30. PagerDuty API returns this as one
# 9:30-9:30 shift, which doesn't match our internal representation of two shifts,
# so we're getting this message. Would be great to fix this in future.

I think this happens when PagerDuty auto-assigns someone (say, "Jack") to an out-of-hours shift (17:30-09:30) but we then generate a rota which puts Jack on an in-hours shift in the same week. The PagerDuty sync script applies an override but it starts getting muddled up because Jack now has one large shift instead of the neatly chunked 09:30-17:30/17:30-09:30 pattern and it's therefore unable to override. It means at the beginning of a new quarter there's always a few manual overrides we have to apply to get the rota synchronisation over the line.

Example

See screenshot below, and cross-reference it against the build log:

Processing inhours_primary shifts...
Overriding 6 individual shifts in PagerDuty...
Warning: failed to assign Deborah Chua to the inhours_primary role from 2025-02-12T09:30:00+00:00 to 2025-02-12T17:30:00+00:00. You'll need to apply this manually in the PagerDuty UI.
Warning: failed to assign Deborah Chua to the inhours_primary role from [20](https://github.com/alphagov/govuk-rota-generator/actions/runs/12413332583/job/34655186035#step:4:21)25-02-13T09:30:00+00:00 to 2025-02-13T17:30:00+00:00. You'll need to apply this manually in the PagerDuty UI.
Warning: failed to assign Deborah Chua to the inhours_primary role from 2025-02-14T09:30:00+00:00 to 2025-02-
<...>
Processing oncall_primary shifts...
Overriding 6 individual shifts in PagerDuty...
Warning: failed to assign Richard Towers to the oncall_primary role from 20[25](https://github.com/alphagov/govuk-rota-generator/actions/runs/12413332583/job/34655186035#step:4:26)-02-12T17:30:00+00:00 to 2025-02-13T09:30:00+00:00. You'll need to apply this manually in the PagerDuty UI.
Warning: failed to assign Richard Towers to the oncall_primary role from 2025-02-13T17:30:00+00:00 to 2025-02-14T09:[30](https://github.com/alphagov/govuk-rota-generator/actions/runs/12413332583/job/34655186035#step:4:31):00+00:00. You'll need to apply this manually in the PagerDuty UI.
Warning: failed to assign Richard Towers to the oncall_primary role from 2025-02-14T17:30:00+00:00 to 2025-02-17T09:30:00+00:00. You'll need to apply this manually in the PagerDuty UI.
<...>
Screenshot 2024-12-19 at 13 58 06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant