Commit graph

26 commits

Author SHA1 Message Date
justusbunsi 54beca9c25
Introduce better test case structure
Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
2022-07-12 11:20:08 +02:00
justusbunsi 51211d77cd
Change internal name
Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
2022-07-11 17:39:22 +02:00
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 dc3969cd05
Improve configuration file flexibility
Instead of re-inventing the wheel regarding configuration location
handling and validation, this introduces a new command flag `--config`
allowing for full flexibility of configuration filename and location.
This flag can also be defined via environment variable which allows
an easy way of starting the bot from command line, inside a Docker
container or using the Helm Chart.

It makes the custom environment lookup unnecessary and reduces some
complexity during startup and for writing tests.

Resolves: #10

Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
2022-05-22 14:03:23 +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 21837f9b25
Export webhook and token struct
Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
2021-10-17 16:01:15 +02:00
justusbunsi e01096a7fe
Eliminate viper references from token and webhook
Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
2021-10-17 15:57:45 +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 f187d4f8c6
Allow customizing metrics fetch from SonarQube
Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
2021-10-12 13:14:17 +02:00
justusbunsi 45fbfed51b
Split settings structs into separate files
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-10-09 21:10:30 +02:00
justusbunsi a1990a60f4
Format code
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-10-03 17:57:22 +02:00
justusbunsi a0f2684029
Add Gitea SDK to actually post a comment
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-07-12 12:58:06 +02:00
justusbunsi 86a644f31f
Use OOP-ish style for configuration loading
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-06-29 10:29:20 +02:00
justusbunsi 4ba781d74f
Respect go package concepts
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-06-29 08:09:21 +02:00
justusbunsi c575542118
Add SonarQube endpoint
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-06-24 15:09:05 +02:00
justusbunsi 08eab186db
Let the bot panic if no project mapping provided
The bot cannot properly handle webhooks when no projects are configured.
So it is good to not let the bot run with such an invalid configuration.

Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-06-24 10:36:52 +02:00
justusbunsi 6dfb2dd846
Properly map projects from SQ and Gitea in config
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-06-22 11:27:53 +02:00
justusbunsi f84442009c
Allow loading token value from file reference
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-06-21 11:31:52 +02:00
justusbunsi 4797d38c70
Switch token configuration to object
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-06-21 11:08:56 +02:00
justusbunsi 9fc9323f23
Rewrite webhook config structure
It now allows more than just secret/secretFile.

Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-06-21 11:02:16 +02:00
justusbunsi 71b19c35b8
Fix repository/project type from config
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-06-21 10:31:11 +02:00
justusbunsi 9c9b7588ab
Read webhook secret from file into configuration
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-06-20 19:47:55 +02:00
justusbunsi 6c2bb413cd
Allow passing environment variables into config
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-06-20 18:24:12 +02:00
justusbunsi 86ea377d64
Load gitea configuration from file
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-06-20 16:49:12 +02:00
justusbunsi 5c6229be8f
Allow custom config path via environment variable
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-06-20 15:39:54 +02:00
justusbunsi 706aeb0d0f
Load config.yaml from config directory
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-06-20 15:16:06 +02:00