Refactor: move gitea api calls in own "client" package#78

Merged
6543 merged 27 commits from refactor-add-more-logging-and-tests into main 2022-06-11 23:02:06 +02:00
Contributor

continue #75
close #16

  • fix regression (from #34) thanks to @crystal
  • create own gitea client package
  • more logging
  • add mock impl of CertDB
continue #75 close #16 - fix regression (from #34) _thanks to @crystal_ - create own gitea client package - more logging - add mock impl of CertDB
add unittest for mockCert()
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
5ecb63426f
fix lint
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
1bb6e09e23
Merge branch 'main' into refactor-add-more-logging-and-tests
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
4b2df4aac2
6543 changed title from Add more logging and tests to WIP: Add more logging and tests 2022-05-15 22:09:35 +02:00
ci: add branches filter
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
0742782a0d
6543 changed title from WIP: Add more logging and tests to WIP: Add more logging and tests & refactor 2022-05-16 00:43:51 +02:00
modernize ForbiddenMimeTypes
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
d35e41fa9f
start using "errors"
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
d9127d1ed9
Merge remote-tracking branch 'main/main' into refactor-add-more-logging-and-tests
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
0f662157ff
6543 changed title from WIP: Add more logging and tests & refactor to Refactor: move gitea api calls in own "client" package 2022-06-02 15:44:00 +02:00
create giteaClient once
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
5c508c5d13
6543 requested review from momar 2022-06-02 15:58:39 +02:00
@ -101,3 +81,3 @@
// Handle errors
if (res == nil && !cachedResponse.exists) || (res != nil && res.StatusCode() == fasthttp.StatusNotFound) {
if (err != nil && errors.Is(err, gitea.ErrorNotFound)) || (res == nil && !cachedResponse.Exists) {
Author
Contributor

INFO: here we can also handle 404 page

INFO: here we can also handle 404 page
Author
Contributor

cristalls pull will already do so :)

cristalls pull will already do so :)
6543 marked this conversation as resolved
Author
Contributor

I'm going to merge if nobody have any objections ...

I'm going to merge if nobody have any objections ...
Merge branch 'main' into refactor-add-more-logging-and-tests
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
98f1880dea
AuthorizationHeaderToken requires API tokens to be prepended with "token "
fix gitea client
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
7be32d4de2
path.Join() mangles giteaRoot by changing https://codeberg.org to https:/codeberg.org This causes the upstream requests to fail every time, always resulting in 424 Failed Dependency
Merge branch 'main' into refactor-add-more-logging-and-tests
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
4d45be2d18
6543 added this to the v4.0 milestone 2022-06-11 15:00:48 +02:00
6543 modified the milestone from v4.0 to v3.0 2022-06-11 15:00:51 +02:00
6543 force-pushed refactor-add-more-logging-and-tests from f53bae252a
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
to 7eeafdbc5f
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
2022-06-11 22:24:16 +02:00
Compare
less aloc
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
8add62ee2f
@ -0,0 +40,4 @@
func (p tmpDB) Compact() (string, error) {
p.intern.Truncate()
return "Turncate done", nil
Owner

Truncate

Truncate
6543 marked this conversation as resolved
@ -0,0 +43,4 @@
}
// TODOs:
// * handle 404 -> page will show 500 atm
Owner

Is there an open issue for that?

Is there an open issue for that?
Author
Contributor

yes and a pull - I remove it here since it is tracked there

yes and a pull - I remove it here since it is tracked there
6543 marked this conversation as resolved
@ -32,3 +28,1 @@
domain = strings.TrimSpace(domain)
domain = strings.TrimPrefix(domain, "http://")
domain = strings.TrimPrefix(domain, "https://")
domain = strings.TrimPrefix(
Owner

they compile to the exact same assembly and imho the old version was much better readable

they compile to the exact same assembly and imho the old version was much better readable
6543 marked this conversation as resolved
create fastClient once
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
4e42bca189
address review
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
d86b25e7da
6543 removed review request for momar 2022-06-11 22:59:40 +02:00
crapStone approved these changes 2022-06-11 23:01:45 +02:00
6543 merged commit 02bd942b04 into main 2022-06-11 23:02:06 +02:00
6543 deleted branch refactor-add-more-logging-and-tests 2022-06-11 23:02:07 +02:00
Sign in to join this conversation.
No description provided.