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 VTODO validation for PERCENT-COMPLETE #664

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

jarikmarwede
Copy link
Contributor

This PR should fix the linked issue I created about the PERCENT-COMPLETE property of the VTODO being misspelled as just PERCENT. I also added a test to verify that the validation of the property now works as expected. If you think the test is unnecessary, I can also just remove it again.

Fixes #663

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.78%. Comparing base (1d0d0bd) to head (4f21237).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #664   +/-   ##
=========================================
  Coverage     98.78%   98.78%           
  Complexity     1875     1875           
=========================================
  Files            71       71           
  Lines          5273     5273           
=========================================
  Hits           5209     5209           
  Misses           64       64           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@phil-davis phil-davis requested review from staabm and phil-davis August 1, 2024 14:28
@phil-davis
Copy link
Contributor

@staabm this PR changes "PERCENT" to "PERCENT-COMPLETE" (which is the correct name in the RFC spec)

If we merge this, then "PERCENT" will no longer be "officially" valid. But I suppose, if anybody has actually used it, "PERCENT" will just be an extra property that lives in some VTODO entries. It shouldn't break anything.

Do we want to also keep validating "PERCENT"?

@phil-davis
Copy link
Contributor

Also, maybe a separate issue to address, I don't see any code that checks that the value of PERCENT-COMPLETE is an integer from 1 to 100.

Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is fine, thanks. I would like to get the opinion of @staabm also about the old "PERCENT"

@staabm
Copy link
Member

staabm commented Aug 1, 2024

I can't say much about it. this PR seems to align our impl with the RFC which feels like a good thing.

I don't know whether the previous impl is wrong though (or intentionally made like that for some unknown reason).

@phil-davis
Copy link
Contributor

I don't know whether the previous impl is wrong though (or intentionally made like that for some unknown reason).

Actually, I don't think it really matters. For anyone currently using "PERCENT", it will still work. So they won't notice a difference.

For the clients that do the correct thing, and use "PERCENT-COMPLETE", they also will be fine, as long as they only specify it once, as per the spec.

@staabm
Copy link
Member

staabm commented Aug 1, 2024

Actually, I don't think it really matters. For anyone currently using "PERCENT", it will still work. So they won't notice a difference.

is this something we should test?

@phil-davis
Copy link
Contributor

is this something we should test?'

yes, I have a test case and it passes. The VTodo validation code does not complain about unrecognized properties.
It will be easiest for me to merge this PR (which is from the master branch of @jarikmarwede fork) and then add more tests, rather than try to manage it in that other master branch.

@phil-davis phil-davis merged commit 091a161 into sabre-io:master Aug 1, 2024
8 checks passed
@staabm
Copy link
Member

staabm commented Aug 1, 2024

thank you both!

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

Successfully merging this pull request may close these issues.

VTODO PERCENT-COMPLETE property is not validated correctly
3 participants