Skip to content

Add Gitea Notifications#2787

Closed
bircni wants to merge 2 commits intogitify-app:mainfrom
bircni:cursor/gitea-forge-support
Closed

Add Gitea Notifications#2787
bircni wants to merge 2 commits intogitify-app:mainfrom
bircni:cursor/gitea-forge-support

Conversation

@bircni
Copy link
Copy Markdown

@bircni bircni commented Apr 18, 2026

Add the option to also add gitea notifications
grafik

@bircni bircni changed the title Fix Gitea mark-as-done and unsubscribe behavior Add Gitea Notifications Apr 18, 2026
Copy link
Copy Markdown
Member

@setchy setchy left a comment

Choose a reason for hiding this comment

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

At this time, supporting other git platforms is not on our roadmap (see CONTRIBUTING.md)

@afonsojramos
Copy link
Copy Markdown
Member

@setchy to be honest, looking at the implementation (just reviewing the code, haven't really test) it doesn't really seem to create any Gitea-specific concepts. In the past, bitbucket has definitely steered far from what we had for GH, but gitea doesn't seem to differ as much

@setchy
Copy link
Copy Markdown
Member

setchy commented Apr 24, 2026

@setchy to be honest, looking at the implementation (just reviewing the code, haven't really test) it doesn't really seem to create any Gitea-specific concepts.

Same, I too have done a quick code review but haven't tested it. Took me a minute to work out what forge was being used for 😄

In the past, bitbucket has definitely steered far from what we had for GH, but gitea doesn't seem to differ as much

Actually, Bitbucket-only notifications could be a clean fit too... it was just that there are also many other Atlassian products [non-git] which had valuable notifications.


I think my primary hesitation is the overhead on the maintainers to support more git platforms.

In concept, I like it. In practice, there will be a "cost"...

It would also make us question whether the use of things like Octicons, Octokit, Primer Design System still makes sense...

@afonsojramos
Copy link
Copy Markdown
Member

It would also make us question whether the use of things like Octicons, Octokit, Primer Design System still makes sense...

Fair, but we are lacking the design skills to do something from scratch 😅 It should be fine

I think my primary hesitation is the overhead on the maintainers to support more git platforms.

It should be fine if we have someone responsible for that section. In this case, @bircni 👀 Other apps that consider themselves as mutli-platform also have dedicated maintainers for each OS, to validate that everything is working.

Actually, Bitbucket-only notifications could be a clean fit too... it was just that there are also many other Atlassian products [non-git] which had valuable notifications.

Well then 👀

@bircni bircni force-pushed the cursor/gitea-forge-support branch from 8834792 to e9e478e Compare May 1, 2026 20:29
@bircni
Copy link
Copy Markdown
Author

bircni commented May 1, 2026

rebased onto main - idk how we want to proceed here
I really like the app and gitea notifications are a gamechanger for me here

@afonsojramos
Copy link
Copy Markdown
Member

@bircni let's just take a step back and evaluate multi-platform, maybe this can be architectured in a different way.

@setchy
Copy link
Copy Markdown
Member

setchy commented May 6, 2026

#2841

afonsojramos added a commit that referenced this pull request May 6, 2026
Adds the first non-GitHub forge adapter under the new ForgeAdapter
contract: client (fetch-based, no Octokit), types, transform, and
adapter registration. Wires Gitea PAT login into the Login and Accounts
routes, exposes the Gitea platform icon, and gates unsupported actions
(mark-as-done, unsubscribe, GraphQL enrichment) via capability flags.

Adapted from work originally proposed in #2787.

Co-authored-by: bircni <75789103+bircni@users.noreply.github.com>
@setchy
Copy link
Copy Markdown
Member

setchy commented May 6, 2026

thanks @bircni

now superseded by forge adapters in #2842

@setchy setchy closed this May 6, 2026
@bircni bircni deleted the cursor/gitea-forge-support branch May 6, 2026 19:54
setchy pushed a commit that referenced this pull request May 7, 2026
* docs(contributing): replace github-only stance with multi-forge policy

* feat(types): add Forge type and required Account.forge field with migration

* feat(forges): add ForgeAdapter interface, registry, and GitHub adapter

* refactor(forges): route notifications, features, and auth through adapter

* test(notifications): expect mark-as-done to fall back to mark-as-read when unsupported

* refactor(login): route PAT login through forge adapter

* refactor(login): render login methods from forge adapter registry

* feat(forges/gitea): add Gitea adapter and login flow

Adds the first non-GitHub forge adapter under the new ForgeAdapter
contract: client (fetch-based, no Octokit), types, transform, and
adapter registration. Wires Gitea PAT login into the Login and Accounts
routes, exposes the Gitea platform icon, and gates unsupported actions
(mark-as-done, unsubscribe, GraphQL enrichment) via capability flags.

Adapted from work originally proposed in #2787.

Co-authored-by: bircni <75789103+bircni@users.noreply.github.com>

* refactor(links): route developer settings URL through forge adapter

* fix(forges): preserve refresh response shape and limit gitea scope short-circuit

* refactor(forges/github): relocate GitHub modules into forges/github

* fix(forges/github): point graphql codegen output and import paths at new location

* fix(auth): coerce missing enterprise version header to null

* test(settings): drop obsolete snapshot for go-back test

* test(forges): cover registry dispatch and unknown-forge errors

* test(forges/gitea): cover client request paths and pagination

* test(forges/gitea): cover adapter dispatch and capabilities

* test(forges/github): cover adapter dispatch and login fields

* test(forges/github): cover raw notification transform

* style(forges): apply biome formatter to new test files

* fix(test): widen latest_comment_url cast to allow null in transform test

* chore(codeowners): route forge adapters to their maintainers

* docs(readme): add forge adapter support matrix

* docs(readme): document forge status symbols (experimental, in progress)

* docs(readme): drop Bitbucket Data Center from forge matrix (EOL)

* refactor(forges): move OAuth scope checks onto the adapter

* refactor(forges): address review comments

- docs(contributing): list Gitea among currently supported forges
- fix(forges): reject unknown forge IDs during legacy account migration
  rather than passing through any persisted value
- fix(forges/gitea): tighten PAT validator to /^[a-f0-9]{40}$/ to match
  what gitea.com actually issues
- refactor(auth): coerce missing user.name to null instead of casting
  the field to a wider type
- refactor(types): make GitifyNotification.display optional and drop
  the `undefined as unknown as ...` cast in both forge transforms;
  UI components guard or use optional chaining
- refactor(forges): relocate notification handlers under
  forges/github/handlers since they are GitHub-shaped (Octokit GraphQL
  fragment types). Detail enrichment becomes an optional adapter
  method (`enrichNotifications?`) so the shared notification
  orchestrator stays adapter-agnostic, and the redundant
  `capabilities.enrichment` flag is removed.

* fix(forges/gitea): adopt new ISafeStorageDecryptResult shape from main

* fix(forges/gitea): pin requests to account hostname and redact error bodies

* fix(forges): merge getAdapter, derive KNOWN_FORGES from registry, sanitise persisted accounts

* refactor(forges): normalise RefreshAccountData and route token-cache invalidation through adapter

* refactor(forges): inline single-use wrappers, type LoginRouteState, add toLink helper, cross-link adapters

* fix(forges/gitea): throw on unsupported markAsDone instead of silently aliasing read

* refactor(types): split RawGitifyNotification from GitifyNotification at format boundary

* refactor(forges): expose getDisplayHelpers on adapter so shared code stays forge-agnostic

---------

Co-authored-by: bircni <75789103+bircni@users.noreply.github.com>
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.

3 participants