Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gitprovider): setup gitea provider #3320

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Tchoupinax
Copy link
Contributor

@Tchoupinax Tchoupinax commented Jan 19, 2025

Hello,

As a big user of Gitea, I would love to have this provider included in Kargo!

Inspiration:

Closes #3321

Copy link

netlify bot commented Jan 19, 2025

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit 79de581
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-io/deploys/679d4e91ef43a000084dee8a
😎 Deploy Preview https://deploy-preview-3320.docs.kargo.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Tchoupinax Tchoupinax force-pushed the feature/gitea-provider branch 3 times, most recently from 0ebb02c to 6baedc3 Compare January 19, 2025 20:36
@Tchoupinax Tchoupinax changed the title feat: setup gitea provider feat(gitprovider): setup gitea provider Jan 19, 2025
Copy link

codecov bot commented Jan 19, 2025

Codecov Report

Attention: Patch coverage is 48.12030% with 69 lines in your changes missing coverage. Please review.

Project coverage is 52.48%. Comparing base (24f71a5) to head (1e4fd08).
Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
internal/gitprovider/gitea/gitea.go 48.12% 59 Missing and 10 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3320      +/-   ##
==========================================
+ Coverage   52.05%   52.48%   +0.43%     
==========================================
  Files         295      292       -3     
  Lines       26695    26758      +63     
==========================================
+ Hits        13895    14043     +148     
+ Misses      12041    11941     -100     
- Partials      759      774      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Tchoupinax Tchoupinax force-pushed the feature/gitea-provider branch from 6cafe76 to b475805 Compare January 21, 2025 08:42
@hiddeco hiddeco self-requested a review January 27, 2025 21:16
Copy link
Contributor

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this 🙇

Please refer to my comments for a couple of suggestions. In addition, you need to run make hack-codegen (and commit) to ensure the generated files are properly formatted, as this in something CI complains about at the moment.

internal/gitprovider/gitea/gitea.go Outdated Show resolved Hide resolved
internal/gitprovider/gitea/gitea.go Outdated Show resolved Hide resolved
internal/gitprovider/gitea/gitea.go Outdated Show resolved Hide resolved
internal/gitprovider/gitea/gitea.go Outdated Show resolved Hide resolved
internal/gitprovider/gitea/gitea.go Outdated Show resolved Hide resolved
internal/gitprovider/gitea/gitea.go Outdated Show resolved Hide resolved
@hiddeco
Copy link
Contributor

hiddeco commented Jan 28, 2025

In addition to my above comments, can you please update the documentation (nested in docs/) to include the new gitea option for both steps?

Tchoupinax and others added 5 commits January 28, 2025 17:59
Co-authored-by: Hidde Beydals <[email protected]>
Co-authored-by: Hidde Beydals <[email protected]>
Co-authored-by: Hidde Beydals <[email protected]>
Co-authored-by: Hidde Beydals <[email protected]>
Co-authored-by: Hidde Beydals <[email protected]>
Co-authored-by: Hidde Beydals <[email protected]>
@krancour krancour assigned hiddeco and unassigned Tchoupinax Jan 28, 2025
Signed-off-by: Hidde Beydals <[email protected]>
@hiddeco
Copy link
Contributor

hiddeco commented Jan 31, 2025

Tested this end-to-end, and caught and fixed a couple of bugs along the way. It works as expected now.

@hiddeco hiddeco requested a review from krancour January 31, 2025 21:38
}))
}

baseURL := "https://" + host
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a double check @krancour. I "enforced" HTTPS here based on what we do for GitHub, but I am not sure that's what we want to do.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started to look at that a few days ago and got sidetracked. I'll assign myself to this so that I hopefully don't lose track.

Sorry for the delay.

- Prevent panic due to merge commit not existing at time of PR
  creation.
- Use URL _including_ scheme to setup API client.
- Make authentication actually work.
- Use correct field for PR "number" (i.e. index).

Signed-off-by: Hidde Beydals <[email protected]>
@hiddeco hiddeco force-pushed the feature/gitea-provider branch from f718fb8 to 79de581 Compare January 31, 2025 22:28
@Tchoupinax
Copy link
Contributor Author

Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gitea integration for git related promotion steps
3 participants