Skip to content

Make TODO API tests pass#347

Merged
bfabio merged 7 commits into
italia:mainfrom
Trihedron1240:trihedron1240/issue-111-pagination-and-delete-fix
May 10, 2026
Merged

Make TODO API tests pass#347
bfabio merged 7 commits into
italia:mainfrom
Trihedron1240:trihedron1240/issue-111-pagination-and-delete-fix

Conversation

@Trihedron1240
Copy link
Copy Markdown
Contributor

@Trihedron1240 Trihedron1240 commented Apr 24, 2026

Summary

  • validate page[size] across catalog, log, publisher, software, and webhook listing endpoints and return 422 for invalid values
  • add coverage for the TODO pagination cases and database persistence checks for POST/PATCH flows
  • delete publisher code-hosting rows when deleting a publisher so the associated delete check passes

Testing

  • go test -race ./...

Closes #111

@bfabio bfabio self-requested a review April 24, 2026 10:07
Comment thread internal/handlers/logs.go Outdated
Comment thread internal/handlers/general/pagination.go Outdated
@bfabio
Copy link
Copy Markdown
Member

bfabio commented Apr 26, 2026

Looks very good overall @Trihedron1240, thanks!

@Trihedron1240 Trihedron1240 force-pushed the trihedron1240/issue-111-pagination-and-delete-fix branch from 6353cee to 319646f Compare April 26, 2026 08:51
Comment thread logs_test.go Outdated
@Trihedron1240 Trihedron1240 force-pushed the trihedron1240/issue-111-pagination-and-delete-fix branch from 01ae38b to 4d42747 Compare April 26, 2026 12:03
Comment thread publishers_test.go Outdated
expectedContentType: "application/json",
validateFunc: func(t *testing.T, response map[string]interface{}) {
items := assertListResponse(t, response)
assert.LessOrEqual(t, len(items), 100)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here as well.

Comment thread software_test.go Outdated
expectedContentType: "application/json",
validateFunc: func(t *testing.T, response map[string]interface{}) {
items := assertListResponse(t, response)
assert.LessOrEqual(t, len(items), 100)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here as well.

Comment thread logs_test.go Outdated
placeholder(4),
)

for i := range 100 {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should add more than 100, so to make sure the cap works at 100 and it's not just returning all of them.

This does not clear the logs after the test is done right? If so, it should clean it after each test.

@bfabio bfabio force-pushed the trihedron1240/issue-111-pagination-and-delete-fix branch from 4d42747 to bc99838 Compare May 10, 2026 06:45
@bfabio
Copy link
Copy Markdown
Member

bfabio commented May 10, 2026

Since this also fixes a bug I took the liberty of fixing the small pending improvements.

Thanks for your work @Trihedron1240!

@bfabio bfabio force-pushed the trihedron1240/issue-111-pagination-and-delete-fix branch from bc99838 to 8ea504e Compare May 10, 2026 06:56
@bfabio bfabio merged commit 1b6d8f4 into italia:main May 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the tests marked as TODO pass

2 participants