Skip to content

Show Release Notification in the UI #27058

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JakobDev
Copy link
Contributor

If a repo that you are watching creates a new Release, you get a Mail but it is not shown in the UI. This PR changed this. Now the Release Notification is shown in the UI!

The Migration will be added after the Code is reviewed.

grafik

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 13, 2023
@github-actions github-actions bot added the modifies/api This PR adds API routes or modifies them label Sep 13, 2023
@silverwind
Copy link
Member

silverwind commented Sep 13, 2023

Hmm, this diverges from the GitHub UI that shows releases only on the frontpage feed (which we already do). I see notifications as "things to do", but a release does not seem to fit here thematically.

@JakobDev
Copy link
Contributor Author

Hmm, this diverges from the GitHub UI that shows releases only on the frontpage

It also sends you an notification

but a release does not seem to fit here thematically.

We already sent a Mail, so we could also show it in the UI

@techknowlogick
Copy link
Member

image showing releases in notifs
@silverwind they've since added it in

@silverwind
Copy link
Member

silverwind commented Sep 13, 2023

Interesting, I never received a release notification on GH so far. Maybe it's something in my notifications config. I guess once we have that PR landed that enables filtering notifications type per repo, this will be okay to have.

@lunny
Copy link
Member

lunny commented Sep 14, 2023

I have a PR to do similar work but not finished and closed. The notification should have more types and users could have filters in future.

@lunny lunny added the topic/ui Change the appearance of the Gitea UI label Sep 14, 2023
continue
}

release, err := repo_model.GetReleaseByID(ctx, notification.ReleaseID)
Copy link
Member

Choose a reason for hiding this comment

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

It's low efficiency. We need to id in () to fix the possible performance problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

GetReleaseByID does not more than doing a Database query with the ID. It does not load other things if it's that what you mean.

Copy link
Member

Choose a reason for hiding this comment

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

You can find many examples to a batch loading. Use a for loop to get all release id and then get all releases use id in () and then assign release to notification.

@JakobDev
Copy link
Contributor Author

users could have filters in future

I have already open #26865 do do exactly that. Backend and tests are ready, but I need some help on the Frontend.

@puni9869
Copy link
Member

users could have filters in future

I have already open #26865 do do exactly that. Backend and tests are ready, but I need some help on the Frontend.

I can help in UI. what we need to do.

@JakobDev
Copy link
Contributor Author

I can help in UI. what we need to do.

Thanks. The other PR has a proof of concept UI that already works, but it doesn't look good. Ideally it should look like GitHub.

@puni9869
Copy link
Member

I can help in UI. what we need to do.

Thanks. The other PR has a proof of concept UI that already works, but it doesn't look good. Ideally it should look like GitHub.

will open a pr for the ui.

@lunny lunny added this to the 1.22.0 milestone Oct 8, 2023
@@ -64,13 +66,15 @@ type Notification struct {
IssueID int64 `xorm:"INDEX NOT NULL"`
CommitID string `xorm:"INDEX"`
CommentID int64
ReleaseID int64 `xorm:"INDEX"`
Copy link
Member

Choose a reason for hiding this comment

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

Needs a migration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Migration will be added after the Code is reviewed.

Copy link
Member

@delvh delvh left a comment

Choose a reason for hiding this comment

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

Fine for me as it is.
While it probably makes sense to fix the performance bottleneck mentioned by @lunny, it's not a blocker for me.
The only blocker for me is the missing migration.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 17, 2024
@lunny lunny modified the milestones: 1.22.0, 1.23.0 Mar 29, 2024
@lunny lunny modified the milestones: 1.23.0, 1.24.0 Sep 7, 2024
@wxiaoguang wxiaoguang removed this from the 1.24.0 milestone Mar 8, 2025
@wxiaoguang wxiaoguang marked this pull request as draft March 8, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 1 This PR needs approval from one additional maintainer to be merged. modifies/api This PR adds API routes or modifies them modifies/migrations topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants