-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Worktime tracking for the organization level #19808
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for PR! Looks beautiful :)
All queries must be rewritten using xorm query builder and need to add filter to calculate and show only data from repositories user has access to (with issue/pr rights?). We should have function that return such conditions imho
Thank you, lafriks :) 😊
OK, if I must :) I'll do it when I'll have some time. Hopefully within a week.
Hmm, currently the whole functionality is restricted to organization "owners" (by checking My thinking was that I would rather NOT let people see partial (invalid) data, since the risk that such invalid data gets sent out in an invoice etc by somebody who don't have full rights to see everything within an organization is too high. So I'm double-checking with you: would you consider the current "limited to owners" restriction enough, or still want additional permission check in the query? |
The permission checking shouldn't be done by a helper helper, this should rather be done at router-level. So in this case you want to move the three lines in web.go to the group that starts from line 640, which already includes the owner checking. |
As @Gusted said it's in the wrong place and that's why I did not notice that it's only for owner team members. Yes you understand correctly owner users will have full access to all org repositories. If we leave it that only owners have access to this than it does not need that check in queries. My use case would be that owner would be either lead developer of the team or devops team. Project manager who would be interested in this tab usually have read rights to all repos (and write rights to issues) thus he would not see this. But that's totally I don't mind seeing done in the future as other PR to improve this feature. |
Thanks for the laser-precise advice, @Gusted, will do! I totally see your point @lafriks. If (as you say) it's OK to deal with the more precise permissions in a future PR, then for simplicity's sake I'd rather leave this particular PR as "owner-only" (but change it of course as per Gusted's recommendation). I will |
28cde92
to
44669f4
Compare
Just two small questions:
Thanks in advance! |
Since this PR sent after v1.17 feature freezed, let's wait to merge after v1.17 release. Of course, I think we can re-review it at any time when maintainers have free time. |
Thanks, I'll be requesting re-review then. (Github is a bit confusing for me regarding the right etiquette and the request UI) |
Dear @lafriks and @Gusted, I just couldn't bear not having tests on the correctness of the queries, so I refactored a bit and added tests. Hope you don't mind. P.s.: The build failed with P.s.2: I think Github erroneously keeps "1 change requested" on this ticket, because the change was done – maybe it was confused by the rebase at the same time? Anyway, I will leave this PR alone for now -- feel free to review (all change requests were completed) and to merge at the right time! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure you have translated words and use the correct keys for those. The HTML part of this PR really need some tidying up to do.
Thanks for the detailed review - I haven't disappeared, I'll do the requested changes when I have some time! |
Dear @Gusted, I've finally got around to make the changes you requested. It's not completely clear to me whether it should be me or you who "resolve" the conversations, so I erred on the side of "resolving" the trivial ones, and leaving open the ones where you might want to see the responses. One particular thing: please review my use of |
Codecov Report
@@ Coverage Diff @@
## main #19808 +/- ##
=======================================
Coverage ? 46.91%
=======================================
Files ? 975
Lines ? 135113
Branches ? 0
=======================================
Hits ? 63394
Misses ? 63960
Partials ? 7759
Continue to review full report at Codecov.
|
9f70fae
to
eef5842
Compare
# Conflicts: # modules/templates/helper.go # options/locale/locale_en-US.ini # templates/org/menu.tmpl # web_src/js/index.js
3f70d1c
to
855f45d
Compare
42af2dd
to
01e0c94
Compare
01e0c94
to
45a1e64
Compare
45a1e64
to
7843cbb
Compare
After fixing some problems (mismatched HTML tags, different SQL syntaxes), I think it is good enough now. CI passes. |
* giteaofficial/main: (53 commits) [skip ci] Updated licenses and gitignores Correct bot label `vertical-align` (go-gitea#33477) chore: fix some trivial problems and TODOs (go-gitea#33473) Worktime tracking for the organization level (go-gitea#19808) Skip deletion error for action artifacts (go-gitea#33476) Update .changelog file to add performance label group (go-gitea#33472) actions view: move loading of task attributes etc... into own func (go-gitea#31494) [skip ci] Updated translations via Crowdin Update feishu icon (go-gitea#33470) Inclusion of rename organization api (go-gitea#33303) [skip ci] Updated translations via Crowdin Hide/disable unusable UI elements when a repository is archived (go-gitea#33459) Fix SSH LFS memory usage (go-gitea#33455) Revert empty lfs ref name (go-gitea#33454) Update `@github/text-expander-element`, adapt type imports (go-gitea#33449) Support choose email when creating a commit via web UI (more) (go-gitea#33445) Fix issue sidebar dropdown keyboard support (go-gitea#33447) Fix "redirect link" handling (go-gitea#33440) Refactor repository transfer (go-gitea#33211) Enable two more strict options in tsconfig (go-gitea#33438) ...
Dear Gitea team,
first of all, thanks for the great work you're doing with this project.
I'm planning to introduce Gitea at a client site, and noticed that while there is time recording, there are no project-manager-friendly reports to actually make use of that data, as were also mentioned by others in #4870 #8684 and #13531.
Since I had a little time last weekend, I had put together something that I hope to be a useful contribution to this great project (while of course useful for me too).
This PR adds a new "Worktime" tab to the Organisation level. There is a date range selector (by default set to the current month), and there are three possible views:
Happy to receive any feedback!
There are several possible future improvements of course (predefined date ranges, charts, a member time sheet, matrix of repos/members, etc) but I hope that even in this relatively simple state this would be useful to lots of people.
Keep up the good work!
Kristof