Add Trigger RELATED parameter support - #40
Merged
Merged
Conversation
Expose TRIGGER RELATED metadata on Trigger, parse and validate RELATED values, and add regression coverage for parser and VALARM integration. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds first-class support for RFC 5545 TRIGGER’s RELATED parameter in the semantic layer, so consumers can access whether a duration trigger is relative to an alarm component’s start or end without inspecting raw property parameters (Issue #39).
Changes:
- Introduces
TriggerRelated(start/end) plus name conversion helpers. - Extends
Triggerto exposerelatedandrelatedName, and updates equality/hash. - Updates
parseTriggerto parse/validateRELATEDand adds semantic + end-to-end tests coveringVALARMparsing.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/semantic/property_parser_test.dart | Adds unit tests for parsing/validation of TRIGGER;RELATED=.... |
| test/semantic/end_to_end_test.dart | Verifies VALARM example parses TRIGGER;RELATED=END into semantic Trigger metadata. |
| test/semantic/calendar_types_test.dart | Asserts Trigger stores the RELATED metadata on construction. |
| lib/src/semantic/property_parsers.dart | Parses RELATED in parseTrigger and adds shared single-parameter validation helper. |
| lib/src/semantic/calendar_types.dart | Extends Trigger model to carry RELATED metadata and include it in equality/hash. |
| lib/src/semantic/calendar_enums.dart | Adds TriggerRelated enum + name parsing/toName utilities. |
Comment on lines
354
to
356
| final valueType = | ||
| property.parameters['VALUE']?.first ?? ValueTypeNames.duration; | ||
| if (valueType == ValueTypeNames.duration) { |
Comment on lines
363
to
+367
| } else if (valueType == ValueTypeNames.dateTime) { | ||
| final dateTime = parseCalDateTimeUtc(property); | ||
| return Trigger.dateTime(dateTime); | ||
| return Trigger.dateTime( | ||
| dateTime, | ||
| related: related, |
Reject duplicate VALUE parameters and disallow RELATED for DATE-TIME triggers in parseTrigger, with regression tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Owner
Author
|
@copilot review |
Contributor
Addressed in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TriggerRelatedenum (START/END) supportrelatedandrelatedNameonTriggerTRIGGER;RELATED=...inparseTriggerWhy
Issue #39 requested first-class access to TRIGGER RELATED metadata instead of requiring manual property inspection.
Validation
dart analyze --fatal-infosdart testCloses #39