Add Gitea Notifications#2787
Conversation
|
@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 |
Same, I too have done a quick code review but haven't tested it. Took me a minute to work out what
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... |
Fair, but we are lacking the design skills to do something from scratch 😅 It should be fine
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.
Well then 👀 |
Made-with: Cursor
Made-with: Cursor
8834792 to
e9e478e
Compare
|
rebased onto main - idk how we want to proceed here |
|
@bircni let's just take a step back and evaluate multi-platform, maybe this can be architectured in a different way. |
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>
* 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>
Add the option to also add gitea notifications
