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

Add Organization Wide Labels #10814

Merged
merged 53 commits into from
Apr 1, 2020
Merged

Conversation

mrsdizzie
Copy link
Member

@mrsdizzie mrsdizzie commented Mar 24, 2020

Add organization wide labels

Implement organization wide labels similar to organization wide webhooks. This lets you create individual labels for organizations that can be used for all repos under that organization (so being able to reuse the same label across multiple repos).

This makes it possible for small organizations with many repos to use labels effectively.

Fixes #7406

  • Combine repo/organization templates to reduce code

  • Update label selection

  • Add API endpoints for organization labels that match repo labels

  • Integrate organization labels in relevant Issues and IssueLabel API calls

  • Unit Tests

  • Integration Tests

While I was here I updated the repo labels UI a bit as it had a few layout issues and the current dashed border version didn't look very nice in the organization settings.

Also found that https://try.gitea.io/api/swagger#/issue/issueSearchIssues with multiple labels was broken in dbd9d8d#diff-d5eea3b2c0d4c92d62e12b34eb8da2c0 and fixed that too (and added integration tests).

Screenshots:

Org Labels:
Screen Shot 2020-03-24 at 6 37 46 PM

Screen Shot 2020-03-24 at 6 08 48 PM

Label Selection:

Screen Shot 2020-03-24 at 10 45 03 PM

Repo Label List:
Screen Shot 2020-03-24 at 6 07 32 PM

Issue search/list with same label applied to multiple repo issues:
Screen Shot 2020-03-24 at 6 20 28 PM
(pagination bugs not mine 😬)

Implement organization wide labels similar to organization wide
webhooks. This lets you create individual labels for organizations that can be used
for all repos under that organization (so being able to reuse the same
label across multiple repos).

This makes it possible for small organizations with many repos to use
labels effectively.

Fixes go-gitea#7406
@lafriks lafriks added type/changelog Adds the changelog for a new Gitea version type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Mar 25, 2020
@lafriks lafriks added this to the 1.12.0 milestone Mar 25, 2020
@lafriks
Copy link
Member

lafriks commented Mar 25, 2020

Maybe add blue line not below label for organization labels but on left side?

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 25, 2020
@mrsdizzie
Copy link
Member Author

Maybe add blue line not below label for organization labels but on left side?

I'm not sure what line that is? If it is in the label selection screenshot that is just the label being highlighted when clicked (happens to any label that is the last clicked on)

@lafriks
Copy link
Member

lafriks commented Mar 25, 2020

Oh ok, I thought it was to distinguish repo vs org labels :D

@mrsdizzie
Copy link
Member Author

Oh ok, I thought it was to distinguish repo vs org labels :D

I put a new screenshot without that to avoid confusion : )

models/issue_label.go Show resolved Hide resolved
models/issue_label.go Show resolved Hide resolved
models/issue_label.go Show resolved Hide resolved
models/issue_label.go Outdated Show resolved Hide resolved
models/issue_label.go Outdated Show resolved Hide resolved
routers/api/v1/repo/issue_label.go Outdated Show resolved Hide resolved
routers/org/org_labels.go Outdated Show resolved Hide resolved
routers/org/org_labels.go Show resolved Hide resolved
routers/org/setting.go Show resolved Hide resolved
routers/repo/issue.go Outdated Show resolved Hide resolved
mrsdizzie and others added 4 commits March 27, 2020 15:17
@codecov-io
Copy link

codecov-io commented Mar 27, 2020

Codecov Report

Merging #10814 into master will increase coverage by 0.07%.
The diff coverage is 52.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10814      +/-   ##
==========================================
+ Coverage   43.40%   43.48%   +0.07%     
==========================================
  Files         593      596       +3     
  Lines       83276    83804     +528     
==========================================
+ Hits        36146    36440     +294     
- Misses      42636    42847     +211     
- Partials     4494     4517      +23     
Impacted Files Coverage Δ
models/migrations/migrations.go 4.16% <ø> (ø)
models/migrations/v134.go 0.00% <0.00%> (ø)
modules/repository/create.go 57.44% <0.00%> (ø)
routers/api/v1/repo/label.go 83.71% <0.00%> (ø)
routers/org/org_labels.go 0.00% <0.00%> (ø)
routers/org/setting.go 0.00% <0.00%> (ø)
routers/repo/compare.go 40.80% <ø> (-0.14%) ⬇️
services/issue/label.go 21.27% <0.00%> (-0.95%) ⬇️
routers/repo/issue_label.go 35.71% <6.66%> (-6.48%) ⬇️
routers/repo/issue.go 37.41% <21.21%> (-0.47%) ⬇️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 48890ce...e4714fe. Read the comment docs.

models/fixtures/label.yml Outdated Show resolved Hide resolved
templates/org/settings/labels.tmpl Outdated Show resolved Hide resolved
templates/repo/issue/labels/label_new.tmpl Outdated Show resolved Hide resolved
templates/repo/issue/labels/edit_delete_label.tmpl Outdated Show resolved Hide resolved
templates/repo/issue/labels/label_load_template.tmpl Outdated Show resolved Hide resolved
models/issue_label.go Outdated Show resolved Hide resolved
models/issue_label.go Outdated Show resolved Hide resolved
models/issue_label.go Outdated Show resolved Hide resolved
models/issue_label.go Show resolved Hide resolved
Co-Authored-By: 6543 <6543@obermui.de>
models/issue_label.go Outdated Show resolved Hide resolved
routers/org/setting.go Outdated Show resolved Hide resolved
routers/org/setting.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 31, 2020
@guillep2k
Copy link
Member

Ping LG-TM

@mooror
Copy link

mooror commented Aug 3, 2020

I was just reading through the 12.0.0 release notes and came across this feature. Just wanted to take a minute to thank @mrsdizzie and anyone else that contributed to this feature. This will save me (and I'm sure others) a bunch of time.

Blessings,
Benjamin

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
@delvh delvh removed the type/changelog Adds the changelog for a new Gitea version label Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Organization labels
10 participants