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

My experience on setting up self-host codecov #15

Open
LeoQuote opened this issue Aug 26, 2023 · 3 comments
Open

My experience on setting up self-host codecov #15

LeoQuote opened this issue Aug 26, 2023 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@LeoQuote
Copy link
Contributor

LeoQuote commented Aug 26, 2023

First thanks to you guys in codecov, providing such an amazing product.

There are a few tips I found may save your time

1. Get a let's encrypt certificate or commercial certificate

At first, I tried to set up an HTTP site for codecov, but what I experienced is login would fail.(maybe I'm wrong about that)

So an HTTPS site is a must, and codecov uploader does not support self-signed certificate, so a let's encrypt certificate would help you.

2. Make sure to add sslmode=require when using timescaledb or pg(if ssl is enabled)

Codecov require a timescaledb to have full feature, if your timescaledb instance is provided by SaaS or a helm chart, there's high probability that it provides service with SSL enabled, if sslmode=require is not added, you would not start codecov properly.

3. Inject RUN_ENV=ENTERPRISE in worker container

If not set, links in pr comment would use app.codecov.io instead of your instance.
See #14 for details

4. Override default comment layout

The default pr comment layout would be :

        "comment": {
            "layout": "reach,diff,flags,tree,reach",
            "behavior": "default",
            "show_carryforward_flags": False,
        },

https://github.com/codecov/shared/blob/5e3ba08c6e526846339d467dd8984c40281733c0/shared/config/__init__.py#L46C1-L50

Notice the duplicated reach, I personally advise you to use reach,diff,flags,tree, or there would be two coverage Grid pictures, which would take a lot of space in your pull request.

5. Build your own frontend/gazebo

There are plenty of configs that can only be configured during Build time, such as GHE_URL -> https://github.com/codecov/gazebo/blob/5e7147306dc0b297603fe97f2d9fece63d9dd8fa/src/shared/utils/provider.js#L85C1-L87

So if you want to have a normal frontend that can link you back to pull request, the only way to achieve that is build your own front-end.

you can refer to the official dockerfile when building your own image

# for GHE_URL, setting env would be sufficient
ENV REACT_APP_ENV=enterprise
ENV REACT_APP_GHE_URL ="https://your-ghe.example.com"

6. Try the cloud?

I tried to set up codecov instance and make it usable in a week, but I'm not confident to say that this is in perfect condition, maintaining a service could be tiring, codecov contains 4 components and 4 dependencies, they all require basic monitoring, or backup if they are database. And once it went wrong, all the thing you can do is to check the code, or preying that there's someone nice and know this well in the community.

I'm not an employee neither sentry nor codecov, but I do believe for some/most of the people, cloud service would be cheaper and easier.

@koltyakov
Copy link

Regarding the SSL part. When trying with SSL, I managed to get auth (GitHub) work but could not get it working without. While app settings are identical in both cases. So I'm also tending to believe that SSL is a must-have to make auth work.

@LeoQuote
Copy link
Contributor Author

LeoQuote commented Sep 3, 2023

https://github.com/douban/charts/tree/master/charts/codecov Just released the first version of helm chart for codecov, you should try it if you're using k8s. PRs are welcomed!

@LeoQuote LeoQuote changed the title my experience on setting up self-host codecov My experience on setting up self-host codecov Sep 5, 2023
@rohan-at-sentry
Copy link

@LeoQuote - this is great. thanks for taking the time to provide this feedback.

I'll review this and make changes to our docs to better call out some of the points you've raised.

@thomasrockhu-codecov thomasrockhu-codecov added the documentation Improvements or additions to documentation label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants