* Add initial Gitea client structure
* Add various missing config flags
* initial gitea support added
* Fix some post-merge issues
* Replace HidePrevCommandComments by version from @florianbeisel
* Update mocks
* feat: add Webhook Signature Verification
This changes adds support for Gitea Webhook Signatures by wrapping the
function from the Gitea SDK and calling it from `handleGiteaPost()`.
* fix: use release version in go.mod
1.22 as in the previous go.mod is a development version. When referencing
a minimum release version the correct format is 1.22.0
* Set default Gitea url to cloud.gitea.com
* Fix and Add tests for Gitea
* Fix missing copyright header
* Changed comment to reflect no max comment length
Apparently there's no max comment length in Gitea at this point in time.
* Implement GetCloneURL()
* Decode Base64 before passing on downloaded file content
* Enable Gitea client as API Client
* Remove unneded comments
* Remove old redundant file
* fix: invalid version number in go.mod
* fix: remove unnecessary type conversions
* fix: removed unused function
* fix: remove unnecessary type conversion of decodedData
* fix: fixes some tests
* Correct gitea.com URL
* Add Gitea to website docs
* fix: TestPost_UnsupportedGiteaEvent
* revert version downgrades
* docs: add Gitea documentation to Guide section
* docs: fix copy paste mistake
* Update cmd/server_test.go
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
* Clarify usage msg for --gitea-base-url
* Apply suggestions from code review
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
* Turn ebreak number into const with comments
* Add --gitea-page-size server argument
Defaults to 30 based on https://docs.gitea.com/1.18/advanced/config-cheat-sheet#api-api
* Fix broken test
* Fix event parser and comment parser
* Add missing app permission to docs
* Make Gitea client conform to updated interface
* Update server/events/vcs/gitea/client.go
Co-authored-by: Simon Heather <32168619+X-Guardian@users.noreply.github.com>
* Remove no longer needed logger
* Add extra logging statements for Gitea client
* Add debug statements
---------
Co-authored-by: Florian Beisel <florian@pacey.me>
Co-authored-by: Florian Beisel <florian@beisel.it>
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Co-authored-by: Rui Chen <rui@chenrui.dev>
Co-authored-by: Simon Heather <32168619+X-Guardian@users.noreply.github.com>
* fix(deps): update module github.com/google/go-github/v57 to v58 in go.mod
* Update remaining go-github to v58
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Luke Massa <lmassa@tripadvisor.com>
* Fix Hide Previous Plan Comments
* Update GitLab client tests
* Update GitLab client test
* Update github client test
* Add nolint: errcheck to test
* format github_client.go
It seems that GitHub has changed its Markdown renderer such that an
emoji followed by a string of plain text (with no other formatting)
followed by a colon at the end of the line renders as plain text instead
of as the emoji. Compare the following two lines:
* 🚮 To delete all plans and locks for the PR, comment:
* 🚮 To **delete** all plans and locks for the PR, comment:
While this seems like it is probably a GitHub bug, we can work around it
by adding some formatting between the emoji and the end of the line,
which matches the bullet point above it anyway.
* Enforce policy checks for overriden apply reqs
* Another take on the fix
This new version only includes the 'policies_passed' req back if
policy checks are enabled for the project.
* Fix test
* Fix comment
* Fix spelling
---------
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
* feat: better logging for UpdateStatus
* feat: jobs now shown in a table in the main page
---------
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
Autoplan would set the "policy_check" status to successful if
there were no modified projects in a PR, but "atlantis plan"
would not. Changed "atlantis plan" to behave like autoplan
in this regard.
* add flag to allow the user disable the autodiscover
* add global config and doc
* feat: Implement autodiscover.mode
* fix: Minor doc fixes
* fix: Small fixes to docs/indent/tests
* fix: Line length, quoting, function comments
* fix: Add a few more tests and remove newlines
* fix: Always camel case never snake
---------
Co-authored-by: Marcelo Medeiros <m.medeiros@carepay.com>
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
We should use `(*regexp.Regexp).MatchString` instead of
`(*regexp.Regexp).Match([]byte(...))` when matching string to avoid
unnecessary `[]byte` conversions and reduce allocations.
Example benchmark:
func BenchmarkMatch(b *testing.B) {
for i := 0; i < b.N; i++ {
if match := branchRegex.Match([]byte("main")); !match {
b.Fail()
}
}
}
func BenchmarkMatchString(b *testing.B) {
for i := 0; i < b.N; i++ {
if match := branchRegex.MatchString("main"); !match {
b.Fail()
}
}
}
goos: linux
goarch: amd64
pkg: github.com/runatlantis/atlantis/server/core/config
cpu: AMD Ryzen 7 PRO 4750U with Radeon Graphics
BenchmarkMatch-16 8269699 141.4 ns/op 4 B/op 1 allocs/op
BenchmarkMatchString-16 14298446 95.81 ns/op 0 B/op 0 allocs/op
PASS
ok github.com/runatlantis/atlantis/server/core/config 2.784s
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>