Skip to content

Adding Reminder time #133

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

Merged
merged 12 commits into from
Apr 1, 2025
Merged

Adding Reminder time #133

merged 12 commits into from
Apr 1, 2025

Conversation

HiJohnElliott
Copy link
Contributor

Greetings!

This PR adds the reminder time value to any tasks in the app that have one. The reminder time value is returned as an ISO 8601 formatted time string in the hh:mm:ss style and is in 24-hour time.

This PR includes a function called convert_thingstime_sql_expression_to_isotime() that returns a sql expression that decodes the reminderTime integer value in the database in the reminderTime column. It is written to match convert_thingsdate_sql_expression_to_isotime() in function and style as closely as possible.

Just like other values such as "trashed', 'deadline", and "tags", reminder_time is ignored and not returned if the task has no reminderTime value.

This PR also includes a test added to test_things.py that verifies the sql expression being returned by the new function. The new functionality and test appear to be passing.

This is also my first PR so if there is more that I can do to help please let me know as I am sure that I missed something.

j Ξ

Copy link
Contributor

@mikez mikez left a comment

Choose a reason for hiding this comment

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

@HiJohnElliott This looks great to me in terms of functionality! 🎉🎉🎉

All outstanding remarks relate to documentation and tinsy things to make the life of those easier who view the code in the future. Let me know if what I wrote made sense.

@mikez
Copy link
Contributor

mikez commented Mar 26, 2025

@AlexanderWillner Heads-up: as soon as this review is done, we might want to push a new release (also considering the other recent update); would this be something you'd enjoy to do?

@HiJohnElliott
Copy link
Contributor Author

Hey @mikez! I would LOVE to be a part of pushing the new release once we have merged the changes. Sounds fun!

@AlexanderWillner
Copy link
Contributor

@AlexanderWillner Heads-up: as soon as this review is done, we might want to push a new release (also considering the other recent update); would this be something you'd enjoy to do?

Has been a while we pushed a release ;)

Given that there was no major (negative) feedback, I'd like to suggest following Semantic Versioning and call the next release 1.0.0. Depending on the next changes we would push 1.0.1 or 1.1.0.

@mikez
Copy link
Contributor

mikez commented Mar 27, 2025

@AlexanderWillner Haha, yes what the heck, let's do a 1.0.0! Maybe we could have a celebration. 😊🎉
But there'd be some expectation on maintenance on our end then; do you have capacity to check in here every now and then? (I sometimes go for months without checking.)

@mikez
Copy link
Contributor

mikez commented Mar 27, 2025

I would LOVE to be a part of pushing the new release once we have merged the changes. Sounds fun!

@HiJohnElliott Pushing a release is something only we admins can do at this point; however, if you'd enjoy contributing more once this is done, you could check out this open release.

… the previous pull request as well as an updated version of the test_thingstime() function that only checks a single task in the test DB. The task with uuid 7F4vqUNiTvGKaCUfv5pqYG has been updated in the test .thingsdatabase files to include a reminder_time value that decodes as 12:34:00. The updated databse files are included in this commit as wel.
@HiJohnElliott HiJohnElliott requested a review from mikez March 28, 2025 04:11
@HiJohnElliott
Copy link
Contributor Author

Hey @mikez! I just pushed a new commit that includes changes to the items we have discussed here. Tests are still passing and if anything else needs tidying up just let me know and I'll be happy to tend to it.

I'd also be more than happy to take a look at that issue you linked to relating to repeatable to-dos showing up in upcoming() once we are on the other side of this PR and release.

Thanks!

Copy link
Contributor

@mikez mikez left a comment

Choose a reason for hiding this comment

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

Some minor comments, otherwise looks good.

@AlexanderWillner
Copy link
Contributor

@AlexanderWillner Haha, yes what the heck, let's do a 1.0.0! Maybe we could have a celebration. 😊🎉 But there'd be some expectation on maintenance on our end then; do you have capacity to check in here every now and then? (I sometimes go for months without checking.)

Although I notice issues and comments in my Things inbox, I choose not to act on them immediately, especially since I don’t anticipate much activity in this repository.

…tasks_sql_query() where they were wrapping the deadline, start_date, and reminder_time expressions. FIX: This commit also fixes the missing prefixed zero in the description of the reminderTime and the incorrect function name in the comment on line 111.
@HiJohnElliott
Copy link
Contributor Author

Fixes pushed @mikez!

…ixes the input and output in the same description. It is also includes a change in test_things.py to the function such that things.get function is called and the 'reminder_time' on the next line instead of at the moment the function is called.
@mikez
Copy link
Contributor

mikez commented Mar 31, 2025

@HiJohnElliott Thank you for your patience and endurance here! I hope this code review didn't take away too much of the fun of coding.

@HiJohnElliott
Copy link
Contributor Author

I can't thank you enough for working with me on this PR @mikez and apologies that it has taken up so much of your attention. This next push should contain the fixes you asked for.

HiJohnElliott and others added 3 commits April 1, 2025 01:06
… the correct inputs and outputs in the examples and also fits better stylistically. It also includes a change to to ensure that key values are handled correctly in instances where the task has no reminder_time key.
- use `.tasks` instead of `.get`
- missing newline
- use "black"-style `make auto-style` double-quotes instead of single-quotes
Copy link

sonarqubecloud bot commented Apr 1, 2025

@mikez
Copy link
Contributor

mikez commented Apr 1, 2025

@HiJohnElliott I made some minor tweaks to the code. In essence it boils down to running these commands:

make auto-style

to ensure consistent style according to black;

and

make lint

which checks for trailing whitespace and the like.

The final thing I'd like you to do is to squash all your commits (including my last two ones) into one commit which contains all the changes. That way, the version history stays clean for the main repo.

@mikez mikez merged commit debaf79 into thingsapi:main Apr 1, 2025
7 checks passed
@mikez
Copy link
Contributor

mikez commented Apr 1, 2025

@HiJohnElliott It seems GitHub now has functionality to do the squash automatically, so I used it. :)
Congrats on your first successful PR! 🎉🎉🎉

@mikez
Copy link
Contributor

mikez commented Apr 1, 2025

@AlexanderWillner Feel free to push a new release as discussed. Also, take a look at the tracemalloc comment, in case that needs to be removed.

@HiJohnElliott
Copy link
Contributor Author

@mikez I truly can't thank you enough for being so generous with your time and working with me to get this PR through. I do Tier 2 technical support at a software company here in the US so while I frequently write a lot of SQL and little Python tools here and there, this was the first time I actually had to work with an awesome testing library, with pull requests, with a handful of other topics that were new to me. I know this took a lot of your time but I learned a ton and I couldn't be more excited to have this new reminder_time functionality out in the open for folks to use.

One last thing to confirm: now that this branch has been pulled in, am I safe to delete it? I want to make sure that nothing important is lost.

@mikez
Copy link
Contributor

mikez commented Apr 1, 2025

@HiJohnElliott Yep, you're fine to delete it. It was a pleasure guiding you. First PRs, from experience, are always a bit more involved. :)

@HiJohnElliott HiJohnElliott deleted the reminder_time branch April 1, 2025 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants