atlantis
atlantis copied to clipboard
feat: Add Gitea support
what
Addition of Gitea client in order to close #3538
A functionally complete implementation of a client for Gitea, with the sole exception being the listing of teams that a user is a member of. However, that's not uncommon for other clients.
It was tested manually against both a Gitea and a Forgejo install. Automated tests were limited to the basics. A large part of the implementation uses the Gitea SDK.
why
See #3538
references
- Closes #3538
- Please test
ghcr.io/mvdkleijn/atlantis:dev
testing
- TestExecute_ValidateVCSConfig
- TestExecute_GiteaUser
- TestExecute_GiteaBaseURLScheme
- TestExecute_GiteaWithWebhookSecret
- TestExecute_GiteaBaseURLPort
Also: manual testing by @florianbeisel and @mvdkleijn against Gitea and Forgejo
Small update for those keeping track: @florianbeisel found my PR and had also started work on his own version for this issue. After contacting me, we decided to work together on this PR.
@GenPage @nitrocode @X-Guardian
This PR has been updated with the combined efforts of myself as well as @florianbeisel and we feel it has reached a point where we feel happy it works and is ready to receive feedback or approvals from maintainers and/or users.
Once approved, this will close #3538 by adding nearly full support for Gitea / Forgejo.
Additional Notes: Not implemented: GetTeamNamesForUser()
I want to extend a huge thank you to @mvdkleijn who I had the pleasure working alongside on this PR. Martijn, It's collaborations like these that make our work not just successful, but also enjoyable.
Looking forward to more great teamwork in the future! Thank you for getting this of the ground!
I love the collaboration; thanks, @florianbeisel and @mvdkleijn, for the work. Please be patient on the review, this is going to take a while.
@mvdkleijn we are going to need docs/setup guide for gitea, same as we have for the other VCS and include whatever gitea specifics are in it.
@mvdkleijn we are going to need docs/setup guide for gitea, same as we have for the other VCS and include whatever gitea specifics are in it.
On it. Will commit those sometime this weekend.
Website docs added to PR
Hi all. The pr says this is a draft and no tests. Is that accurate? If not, could you update this? Tests are always nice when adding a new feature as the feature could break in the future and tests would prevent merging a follow up breaking PR.
Hi @nitrocode, the description needs to be updated - I think @mvdkleijn will be on this already. From our perspective this has now come out of a pure draft state. The implementation is functional complete and has been tested against a current self hosted Gitea instance and a Forgejo instance.
While you are right that more tests, more better we opted to concentrate on the tests that are testing the interfaces (TestPost_UnsupportedGiteaEvent etc,) first. From our point of view, writing a comprehensive test suite for the client itself would mostly be testing the gitea SDK which we weren't certain would be a real benefit.
P,S; yes one of those tests we have implemented is still failing :D
@nitrocode Sorry, I forgot to update the description. Updated it.
Like @florianbeisel said, I'm looking atthe failed test. I was working on it last night but it was not co-operating. It is clear to me however that it is not a functional issue with our implementation.
I should have some time to work on that today.
Having said all that, the implementation is functionally done and documentation was added / updated as well.
Thanks @florianbeisel I think I was over-complicating things for myself causing some code blindness in between bouts of my kid not feeling well. :)
@nitrocode All tests working. All docs present. Dependencies back to what they should be.
Just an additional note, the CodeQL check that's failing is doing so based on code we did not touch. It falls under the header "Unchanged files with check annotations (Beta)". So not relevant to this PR in my opinion.
How long have you been running atlantis with gitea support in your production instance?
Can you include any screenshots in your PR to ensure this is working as expected?
cc: @runatlantis/core-contributors @runatlantis/maintainers please help review
How long have you been running atlantis with gitea support in your production instance?
Can you include any screenshots in your PR to ensure this is working as expected?
cc: @runatlantis/core-contributors @runatlantis/maintainers please help review
How long? Since I started developing the client? A little bit of a strange question for me... :smile:
I don't feel comfortable doing that with my prod stuff, but I could run through some steps with a null resource in a test repo if that's ok?
Myself as well as @florianbeisel have done manual testing against Forgejo and Gitea respectively.
Of course I'd welcome it if someone besides myself and Florian could do a manual test run.
How long have you been running atlantis with gitea support in your production instance? Can you include any screenshots in your PR to ensure this is working as expected? cc: @runatlantis/core-contributors @runatlantis/maintainers please help review
How long? Since I started developing the client? A little bit of a strange question for me... 😄
I don't feel comfortable doing that with my prod stuff, but I could run through some steps with a null resource in a test repo if that's ok?
Myself as well as @florianbeisel have done manual testing against Forgejo and Gitea respectively.
Of course I'd welcome it if someone besides myself and Florian could do a manual test run.
Since this is a new VCS, the more tests, the better; an Atlantis image can be generated for people to test.
@mvdkleijn you can create an image in your fork https://github.com/mvdkleijn/atlantis by merging your branch feat-gitea-support into your fork's head branch main which will kick off a github action to build the container and upload it to your fork's github container registry (ghcr). This image can then be used in your environment to beta test your changes.
As per @nitrocode suggestion, dev images including Gitea support are now available to test with at https://github.com/mvdkleijn/atlantis/pkgs/container/atlantis
If someone uses it to test please give us your feedback here.
@mvdkleijn is it possible to use this new image in your setup to ensure it works as expected? This may catch some edge cases prior to merge
@jamengual @GenPage @lukemassa do we want to require (unsure if there is a formal document) a new vcs to be deployed in an existing environment for some time, or is there anything else to be addressed, or is this good to merge?
@mvdkleijn is it possible to use this new image in your setup to ensure it works as expected? This may catch some edge cases prior to merge
I'll see if I can use the image locally and possibly provide a screenshot of some basic scenarios with a simple test repo.
I'll have no way of running any kind of production stuff through it currently but I can set some things up in my homelab I guess.
The tests still shows "none yet" in the description.
It would be good to describe what testing has been done for this PR in the PR description.
@florianbeisel in your screenshot, is the above test against gitea?
The tests still shows "none yet" in the description.
It would be good to describe what testing has been done for this PR in the PR description.
Added test description to PR description
@ @
@nitrocode Added some screenshots (using Forgejo) of Atlantis running on my (remote) Forgejo instance
We need to hold on this until we merge #4285 from @X-Guardian and then rebase this PR on it before the 0.28 release cycle
@mvdkleijn Thanks for testing and adding that screenshot.
Is that of a private repo? or a public repo? Ideally both types (or if there are additional types in gitea/forejo) are tested.
@mvdkleijn Thanks for testing and adding that screenshot.
Is that of a private repo? or a public repo? Ideally both types (or if there are additional types in gitea/forejo) are tested.
That's for a public repo, I didn't have time yet to add them for a private one. I can possibly do that later this evening. (depends on the kid 😋)
@florianbeisel in your screenshot, is the above test against gitea?
yes this is against a current Gitea installation, also against a public repository. But shouldn't be easy to move around.