[PR #1075] [MERGED] feat(apiv1): refactor tags api #972

Closed
opened 2026-02-25 23:36:04 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-shiori/shiori/pull/1075
Author: @fmartingr
Created: 3/8/2025
Status: Merged
Merged: 3/11/2025
Merged by: @fmartingr

Base: masterHead: feat/api-v1-tags-refactr


📝 Commits (10+)

  • 7b49f82 refactor: tags api into v1 api
  • 905a112 feat: tags api huge refactor
  • 1ce90fe fix: pg & sqlite tests
  • 8900106 Merge branch 'master' into feat/api-v1-tags-refactr
  • e26228c tests: added more tests
  • 64f2f1a fix: bug on mysql bookmark and tag creation
  • 2144ae5 test: re-enabled test
  • c5d052a tests: slices test
  • ba2bfd1 tests: model bookmarks
  • 5af513c test: use filepath.Join for path construction in bookmark tests

📊 Changes

29 files changed (+3987 additions, -437 deletions)

View changed files

📝 Makefile (+7 -0)
📝 docs/swagger/docs.go (+224 -12)
📝 docs/swagger/swagger.json (+224 -12)
📝 docs/swagger/swagger.yaml (+148 -8)
📝 go.mod (+2 -5)
📝 go.sum (+26 -94)
📝 internal/database/database_test.go (+702 -6)
📝 internal/database/mysql.go (+461 -101)
📝 internal/database/mysql_test.go (+5 -0)
📝 internal/database/pg.go (+402 -58)
📝 internal/database/sqlite.go (+420 -115)
📝 internal/domains/bookmarks.go (+15 -0)
📝 internal/domains/bookmarks_test.go (+67 -0)
📝 internal/domains/tags.go (+46 -2)
internal/domains/tags_test.go (+159 -0)
📝 internal/http/handlers/api/v1/bookmarks.go (+59 -0)
📝 internal/http/handlers/api/v1/bookmarks_test.go (+124 -0)
📝 internal/http/handlers/api/v1/tags.go (+170 -1)
📝 internal/http/handlers/api/v1/tags_test.go (+338 -9)
📝 internal/http/server.go (+20 -0)

...and 9 more files

📄 Description

  • Refactors the tags api to the new API v1
  • Since tags interact with bookmarks an internal refactor was needed, some queries were migrated to go-sqlbuilder but I left as much of the bookmarks logic as I could intact, since that will be dealt with in a separate PR.
  • Now that we use a query builder, one of the next steps is to use a base database implementation in all engines that will have the queries common to all engines, to prevent code duplication.
    -Added a bunch of test cases to ensure that both the new and old logic works as expected

Closes #921 #658


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-shiori/shiori/pull/1075 **Author:** [@fmartingr](https://github.com/fmartingr) **Created:** 3/8/2025 **Status:** ✅ Merged **Merged:** 3/11/2025 **Merged by:** [@fmartingr](https://github.com/fmartingr) **Base:** `master` ← **Head:** `feat/api-v1-tags-refactr` --- ### 📝 Commits (10+) - [`7b49f82`](https://github.com/go-shiori/shiori/commit/7b49f8227bef008fee2348224cc16cafd2610793) refactor: tags api into v1 api - [`905a112`](https://github.com/go-shiori/shiori/commit/905a1128616468eeb5b3886d525551f0a5e36501) feat: tags api huge refactor - [`1ce90fe`](https://github.com/go-shiori/shiori/commit/1ce90fe03561130ebb49e9e00fd6e04983859e81) fix: pg & sqlite tests - [`8900106`](https://github.com/go-shiori/shiori/commit/8900106bd17196e69e2389a9f9ec133c48ad72c8) Merge branch 'master' into feat/api-v1-tags-refactr - [`e26228c`](https://github.com/go-shiori/shiori/commit/e26228c77b59aeb294852cfd7fdd680cf17a7764) tests: added more tests - [`64f2f1a`](https://github.com/go-shiori/shiori/commit/64f2f1a341cd36f5b0da38520466ec4cb1ce2150) fix: bug on mysql bookmark and tag creation - [`2144ae5`](https://github.com/go-shiori/shiori/commit/2144ae514533fa00c3cb513b96ea626fd8932050) test: re-enabled test - [`c5d052a`](https://github.com/go-shiori/shiori/commit/c5d052a2c28b56181ba9d80048bd6ea85223d5e5) tests: slices test - [`ba2bfd1`](https://github.com/go-shiori/shiori/commit/ba2bfd1b15c680e7a8f4a48b70e88fe50c308bab) tests: model bookmarks - [`5af513c`](https://github.com/go-shiori/shiori/commit/5af513c8cdf6b68405fd8462b37a218a9d0dcab3) test: use filepath.Join for path construction in bookmark tests ### 📊 Changes **29 files changed** (+3987 additions, -437 deletions) <details> <summary>View changed files</summary> 📝 `Makefile` (+7 -0) 📝 `docs/swagger/docs.go` (+224 -12) 📝 `docs/swagger/swagger.json` (+224 -12) 📝 `docs/swagger/swagger.yaml` (+148 -8) 📝 `go.mod` (+2 -5) 📝 `go.sum` (+26 -94) 📝 `internal/database/database_test.go` (+702 -6) 📝 `internal/database/mysql.go` (+461 -101) 📝 `internal/database/mysql_test.go` (+5 -0) 📝 `internal/database/pg.go` (+402 -58) 📝 `internal/database/sqlite.go` (+420 -115) 📝 `internal/domains/bookmarks.go` (+15 -0) 📝 `internal/domains/bookmarks_test.go` (+67 -0) 📝 `internal/domains/tags.go` (+46 -2) ➕ `internal/domains/tags_test.go` (+159 -0) 📝 `internal/http/handlers/api/v1/bookmarks.go` (+59 -0) 📝 `internal/http/handlers/api/v1/bookmarks_test.go` (+124 -0) 📝 `internal/http/handlers/api/v1/tags.go` (+170 -1) 📝 `internal/http/handlers/api/v1/tags_test.go` (+338 -9) 📝 `internal/http/server.go` (+20 -0) _...and 9 more files_ </details> ### 📄 Description - Refactors the tags api to the new API v1 - Since tags interact with bookmarks an internal refactor was needed, some queries were migrated to go-sqlbuilder but I left as much of the bookmarks logic as I could intact, since that will be dealt with in a separate PR. - Now that we use a query builder, one of the next steps is to use a base database implementation in all engines that will have the queries common to all engines, to prevent code duplication. -Added a bunch of test cases to ensure that both the new and old logic works as expected Closes #921 #658 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 23:36:04 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#972
No description provided.