Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Worktime tracking for the organization level#19808

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
lunny merged 11 commits intogo-gitea:mainfromkkovacs:feature/worktime-for-org
Feb 2, 2025

Conversation

@kkovacs
Copy link
Contributor

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:

  • by repository,
  • by milestone, and
  • by team member.

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.

Screen Shot 2022-05-25 at 22 12 58

Keep up the good work!

Kristof

lafriks, fairking, lunny, bard, watsom27, John-Appleseed, juli0604, and morki reacted with thumbs up emojilunny, bard, arkamar, onlurking, stuzer05, and John-Appleseed reacted with hooray emojilunny, molaie, 6543, bard, arkamar, addow, onlurking, and Francewhoa reacted with heart emoji
@kkovacskkovacs marked this pull request as draftMay 25, 2022 21:19
@kkovacskkovacs marked this pull request as ready for reviewMay 25, 2022 21:38
@lunnylunny added this to the1.18.0 milestoneMay 26, 2022
@lunnylunny added the type/featureCompletely new functionality. Can only be merged if feature freeze is not active. labelMay 26, 2022
Copy link
Member

@lafrikslafriks left a comment
edited
Loading

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

@GiteaBotGiteaBot added the lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelMay 26, 2022
@kkovacs
Copy link
ContributorAuthor

Thanks for PR! Looks beautiful :)

Thank you, lafriks :) 😊

All queries must be rewritten using xorm query builder

OK, if I must :) I'll do it when I'll have some time. Hopefully within a week.

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

Hmm, currently the whole functionality is restricted to organization"owners" (by checkingctx.Org.IsOwner inparseTimes), and (according to the help text)"Owners have full access to all repositories and have administrator access to the organization." This is why there is no separate rights checking in the query.

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?

@Gusted
Copy link
Contributor

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.

@lafriks
Copy link
Member

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.

@kkovacs
Copy link
ContributorAuthor

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 willpush later!

@kkovacskkovacs marked this pull request as draftMay 26, 2022 21:22
@kkovacskkovacsforce-pushed thefeature/worktime-for-org branch from28cde92 to44669f4CompareMay 26, 2022 21:44
@kkovacskkovacs marked this pull request as ready for reviewMay 26, 2022 22:05
@kkovacs
Copy link
ContributorAuthor

Just two small questions:

  1. I'd made the requested changes. Should I request a re-review, or is it enough that they are in the "resolved" state?
  2. I've been looking at how you guys implement tests, and I think I could add tests to this functionality if I do some related refactoring for testability. Should I just add the new commits to this PR, or should this be a separate PR later?

Thanks in advance!

@lunny
Copy link
Member

Just two small questions:

  1. I'd made the requested changes. Should I request a re-review, or is it enough that they are in the "resolved" state?
  2. I've been looking at how you guys implement tests, and I think I could add tests to this functionality if I do some related refactoring for testability. Should I just add the new commits to this PR, or should this be a separate PR later?

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.

@kkovacskkovacs requested a review fromlafriksJune 6, 2022 10:16
@kkovacs
Copy link
ContributorAuthor

Thanks, I'll be requesting re-review then. (Github is a bit confusing for me regarding the right etiquette and the request UI)

@kkovacskkovacs requested a review fromGustedJune 6, 2022 10:19
@kkovacs
Copy link
ContributorAuthor

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"https://registry-1.docker.io/v2/woodpeckerci/plugin-codecov/manifests/next-alpine": received unexpected HTTP status: 500 Internal Server Error, which sounds like a docker registry issue? Can the build be restarted?

P.s.2: I think Github erroneously keeps "1 change requested" on this ticket, because the changewas done – maybe it was confused by therebase 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!

lafriks reacted with thumbs up emoji

Copy link
Contributor

@GustedGusted left a 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.

@kkovacs
Copy link
ContributorAuthor

Thanks for the detailed review - I haven't disappeared, I'll do the requested changes when I have some time!

@kkovacs
Copy link
ContributorAuthor

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 ofcontext.OrgAssignment for them.Group in routers.

@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (main@3c6c150).Click here to learn what that means.
The diff coverage is46.20%.

@@           Coverage Diff           @@##             main   #19808   +/-   ##=======================================  Coverage        ?   46.91%           =======================================  Files           ?      975             Lines           ?   135113             Branches        ?        0           =======================================  Hits            ?    63394             Misses          ?    63960             Partials        ?     7759
Impacted FilesCoverage Δ
modules/templates/helper.go45.86% <0.00%> (ø)
routers/web/org/times.go39.13% <39.13%> (ø)
modules/util/sec_to_hour.go100.00% <100.00%> (ø)
routers/web/web.go86.61% <100.00%> (ø)

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update3c6c150...3805fba. Read thecomment docs.

@kkovacskkovacs requested a review fromGustedJuly 7, 2022 14:51
@kkovacskkovacs marked this pull request as draftAugust 10, 2022 18:28
@kkovacskkovacsforce-pushed thefeature/worktime-for-org branch 2 times, most recently from9f70fae toeef5842CompareAugust 11, 2022 14:25
@wxiaoguangwxiaoguang self-assigned thisJan 4, 2025
# Conflicts:#modules/templates/helper.go#options/locale/locale_en-US.ini#templates/org/menu.tmpl#web_src/js/index.js
@github-actionsgithub-actionsbot added modifies/translation modifies/goPull requests that update Go code modifies/templatesThis PR modifies the template files labelsFeb 2, 2025
@wxiaoguang
Copy link
Contributor

Made some changes, and the UI is kept as before

Details

image


image


image

@GiteaBotGiteaBot added lgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1This PR needs approval from one additional maintainer to be merged. labelsFeb 2, 2025
@wxiaoguangwxiaoguangforce-pushed thefeature/worktime-for-org branch 2 times, most recently from42af2dd to01e0c94CompareFebruary 2, 2025 13:47
@wxiaoguangwxiaoguang changed the titleWorktime tracking for the organization level.Worktime tracking for the organization levelFeb 2, 2025
@wxiaoguang
Copy link
Contributor

After fixing some problems (mismatched HTML tags, different SQL syntaxes), I think it is good enough now.

CI passes.

@lunnylunny added the reviewed/wait-mergeThis pull request is part of the merge queue. It will be merged soon. labelFeb 2, 2025
@lunnylunny merged commit34692a2 intogo-gitea:mainFeb 2, 2025
26 checks passed
@GiteaBotGiteaBot removed the reviewed/wait-mergeThis pull request is part of the merge queue. It will be merged soon. labelFeb 2, 2025
zjjhot added a commit to zjjhot/gitea that referenced this pull requestFeb 3, 2025
* 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)  ...
@go-giteago-gitea locked asresolvedand limited conversation to collaboratorsMay 4, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@jolheiserjolheiserjolheiser left review comments

@lunnylunnylunny approved these changes

@lafrikslafrikslafriks approved these changes

@wxiaoguangwxiaoguangwxiaoguang approved these changes

+1 more reviewer

@GustedGustedGusted left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

@wxiaoguangwxiaoguang

Labels

lgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore.modifies/goPull requests that update Go codemodifies/templatesThis PR modifies the template filesmodifies/translationtype/featureCompletely new functionality. Can only be merged if feature freeze is not active.

Projects

None yet

Milestone

1.24.0

Development

Successfully merging this pull request may close these issues.

12 participants

@kkovacs@Gusted@lafriks@lunny@codecov-commenter@molaie@bard@bauermarkus@delvh@wxiaoguang@jolheiser@GiteaBot

[8]ページ先頭

©2009-2025 Movatter.jp