Repository navigation
Conversation
|
This pull request did not pass quality checks and AI use is suspected. Please review Contribute and make any necessary amendments. |
|
Profile summary: Full profile |
|
Can you please address the test failures? |
| # contain both. Prefer the explicit DURATION because it is the | ||
| # unambiguous duration representation and lets callers still read the | ||
| # component rather than failing the entire lookup. |
There was a problem hiding this comment.
This explanation is not more than an opinion. You can include the explanation given in #1796
|
Addressed the latest feedback. |
niccokunzmann
left a comment
There was a problem hiding this comment.
@aspire488 Thanks for the PR! This is indeed a contribution as it works around one special case. Although it does not address the issue, this is worth merging.
Could you reword "Closes" to "Contributes to".
I would say, we can merge this and open another PR that addresses the issue.
| # If DTEND and DURATION describe different end times, the | ||
| # calendar is ambiguous and validation must still fail. |
There was a problem hiding this comment.
| # If DTEND and DURATION describe different end times, the | |
| # calendar is ambiguous and validation must still fail. | |
| def test_duration_and_end_do_not_match(self): | |
| """If DTEND and DURATION describe different end times, the | |
| calendar is ambiguous and validation must still fail. | |
| See https://github.com/collective/icalendar/issues/1796 | |
| """ |
|
@aspire488 Is this ready for another review? There are merge conflicts, could you merge main? |
|
Thanks for the review! I'll merge the latest "main" into my branch, resolve the conflicts, and verify the tests before requesting another review. I'll also ensure the outstanding review feedback is addressed. |
2d85e6e to
fdc741d
Compare
AI: OpenAI GPT-6. Used to inspect the project guidance, refine the changelog wording, and prepare the single-line entry and regression-change summary.
niccokunzmann
left a comment
There was a problem hiding this comment.
Thank you! This is almost ready - I found a bug here that is hard to find. Please address this. It seems ready to merge
| f"may be in a {component_name}, not both." | ||
| ) | ||
| raise InvalidCalendar(msg) | ||
| if start is not None and end != start + duration: |
There was a problem hiding this comment.
| if start is not None and end != start + duration: | |
| if start is not None and end != normalize_pytz(start + duration): |
Hi, this is something hard to catch be we need to be consistent in style: Every operation requires this, so that pytz does work with icalendar.
@angatha have a look - this is something to keep in mind.
pytz was introduced before Python queried the timezone offset using the date-time. So, the timezones from pytz are static and need to be normalized after each calculation to ensure that a timezone transition takes place. This only affects dt that span across a timezone boundary.
|
I changed it to "contributes to" because it does not fully close the issue. |
Applies the reviewer's suggestion: mismatching end times are ambiguous, so validation must fail rather than prefer DURATION. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed the two open points:
The mismatched-end case still raises Verification:
Could this get another review? |
The comment asserted a resolution that neither the RFC nor the issue states. Word it from PyCalendar#1796 itself: both values are accepted when they describe the same end, and still rejected when they contradict, which is the case the review asked the tests to keep covering. Compare against normalize_pytz(start + duration) inline as suggested in review, so the pytz normalisation is visible at the point of comparison. Comment and control flow only; behaviour is unchanged. AI model and version: DeepSeek V4.1 Flash (as reported by the Freebuff agent runtime). How AI was used: the maintainer review on PyCalendar#1835 was summarised in the prompt "work on follow ups of my external existing PRs", asking for the rationale to come from issue PyCalendar#1796 rather than the author's opinion and for the normalize_pytz comparison suggested in review. The output is the comment and comparison change in src/icalendar/attr/__init__.py, written to this commit; it was reviewed and the test suite run against it.
f5f436f to
715bb3f
Compare
Linked issue
Description
When a VEVENT contains both
DTENDandDURATION, the current validation rejects the component before callers can resolve its effective end time.This change keeps the explicit
DURATIONas the effective duration when both properties are present. The existing end-property fallback then derives the effective end fromDTSTART + DURATION.Added regression coverage for a VEVENT containing both
DTENDandDURATION.Checklist
Additional information
Responsible AI disclosure: AI assistance was used to help inspect the existing code, draft the implementation, and draft the regression test. The resulting changes were reviewed against the reported issue and existing implementation before submission.
Closing Criteria