Commit graph

11 commits

Author SHA1 Message Date
justusbunsi 685c834b61
Allow pull request naming pattern customization (#28)
Fixes: #3

Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
2022-06-18 14:03:56 +02:00
justusbunsi 5cb3daab60
Add webhook secret validation
Resolves: #4

Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
2022-05-21 19:05:09 +02:00
justusbunsi e203034228 Rewrite API entrypoint to be testable (#22)
The current code base regarding API entrypoint is not testable as it
directly connects to Gitea when creating the API endpoints. This
prevented my from writing tests in the past for that part.

As the SonarQube quality gate broke due to changes in the API entrypoint
logic, tests are now required to satisfy the quality gate.

Therefore, the instantiation of the API handlers is now decoupled from
building the bot API endpoints and follows the same interface wrapper
strategy as used for the Gitea API client. This makes it testable.

Now, tests are written for the most parts of the API entrypoint. I've
also noticed that there was much overhead within the tests for a
non-implemented function `fetchDetails`. So I dropped that function for
now.

Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>

Co-authored-by: justusbunsi <sk.bunsenbrenner@gmail.com>
Reviewed-on: https://codeberg.org/justusbunsi/gitea-sonarqube-bot/pulls/22
2022-05-21 18:21:05 +02:00
justusbunsi 7f5c3390c4
Add tests for Gitea API
Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
2022-05-21 13:50:58 +02:00
justusbunsi 4d28133b12
Extract test api test helpers
Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
2022-05-21 12:23:57 +02:00
justusbunsi 021d01b5fb
Remove useless types
Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
2021-10-17 15:43:25 +02:00
justusbunsi e28e524456
Post analysis details on bot action comment
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-10-10 19:39:33 +02:00
justusbunsi 369edfcfae
Fetch actual quality gate status on bot comment
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-10-10 19:01:48 +02:00
justusbunsi de575605f9
Move sonarqube sdk files
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-10-10 16:43:37 +02:00
justusbunsi c6bc0d71ff
Move gitea sdk files
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-10-10 16:28:59 +02:00
justusbunsi 46c5ab2aec
Rename webhook_handler to api
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-10-10 16:18:14 +02:00
Renamed from internal/webhook_handler/sonarqube_test.go (Browse further)