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

[#61511] Implement initial list timeentries command #7

Merged
merged 4 commits into from
Feb 18, 2025

Conversation

myabc
Copy link
Contributor

@myabc myabc commented Feb 6, 2025

https://community.openproject.org/wp/61511

An initial patch to support listing (personal) time entries. I wrote this to "scratch an itch" - and make my own time tracking easier.

image

Obviously full CRUD would be nice, but this is just a start.

Also, since this is the first go code I've written, please forgive if it not idiomatic!

@myabc myabc requested a review from Kharonus February 6, 2025 18:48
@Kharonus Kharonus self-assigned this Feb 11, 2025
Copy link
Member

@Kharonus Kharonus left a comment

Choose a reason for hiding this comment

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

Nice ❤️ thanks for your idea and effort. I'd love to put this into code after shaping it up a little bit

@myabc myabc force-pushed the feature/time-entries branch from 1cd9a3e to b5ab3d9 Compare February 11, 2025 16:50
@myabc myabc requested a review from Kharonus February 14, 2025 15:48
@myabc
Copy link
Contributor Author

myabc commented Feb 14, 2025

@Kharonus I spent a few minutes switching to the new filter implementation. Ideally, we'd also add some tests for the filters but I'm going to park this for now and let you review.

Also, lists of users should work, e.g.:

/openproject-cli list timeentries -u 39999,me
/openproject-cli list timeentries -u 39812,39999

Although the validation regexp (copied from core) allows login names, I can't actually get this to work - neither for time entries nor work packages.:

/openproject-cli list timeentries -u [email protected]
/openproject-cli list workpackages -a [email protected]

I double-checked the URL escaping and that appears to be correct, so I am guessing we're using the API in an unsupported way?

@myabc myabc changed the title Implement initial list timeentries command [#61511] Implement initial list timeentries command Feb 14, 2025
Copy link
Member

@Kharonus Kharonus left a comment

Choose a reason for hiding this comment

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

Nice work

looks fine for me to get this merged. We might polish it a bit, once we add more filters or the other CRUD methods, but overall, job well done.

the one minor thing remains, except that :shipit:

Also
- validates user input (according to core app `User#login` Regexp).
- supports lists of users (separated by a comma).
@myabc myabc force-pushed the feature/time-entries branch from 8423346 to 7c4725a Compare February 18, 2025 13:52
@myabc myabc merged commit aa78429 into main Feb 18, 2025
3 checks passed
@myabc myabc deleted the feature/time-entries branch February 18, 2025 14:06
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.

2 participants