Add Rippling OOO to project timeline - #410
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df8f2c57e8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| events: list[PTOEvent] = [] | ||
| current_event: dict[str, tuple[dict[str, str], str]] | None = None | ||
| invalid_event_count = 0 | ||
| captured_properties = {"UID", "SUMMARY", "DTSTART", "DTEND", "STATUS"} |
There was a problem hiding this comment.
Honor DURATION when deriving PTO end dates
When a Rippling VEVENT uses the valid iCalendar DURATION property instead of DTEND, this allowlist discards it and _event_from_properties falls back to end_datetime = start_datetime. Multi-day or overnight PTO encoded that way is therefore rendered as a single-day event; capture and apply DURATION as the alternate means of calculating the event end.
Useful? React with 👍 / 👎.
| if len(response.content) > MAX_RIPPLING_PTO_CALENDAR_BYTES: | ||
| raise ValueError("Rippling PTO calendar response is too large") |
There was a problem hiding this comment.
Enforce the response limit while streaming
When Rippling returns an unexpectedly large or highly compressed response, accessing response.content has already downloaded and decompressed the entire body before this size check runs. The advertised 1 MB cap therefore cannot protect the web worker from excessive memory use; request the response in streaming mode and stop reading once the limit is exceeded.
Useful? React with 👍 / 👎.
What changed
DTENDsemantics.Why
The project timeline needs OOO visibility, but Rippling developer API access is not available. The existing direct-reports calendar subscription provides the dates needed for this view without requiring API credentials.
Security and privacy
OOOlabel and dates.Deployment
Set
RIPPLING_PTO_CALENDAR_URLto the private Rippling calendar subscription URL. Optionally setRIPPLING_PTO_TIMEZONE(default:America/New_York) for timed entries.Validation
ruff check .ruff format --check .mypy .python -m unittest discover -s tests -p 'test_*.py'(121 tests)vulture . --config pyproject.toml