Introduction

You are somewhat familiar with Kubernetes and you came across Keptn. You want to contribute but you are someone who falls into one of the following categories:

  1. You haven’t contributed to an open source project before
  2. The idea of going from zero to contributing to a big project like Keptn sounds overwhelming to you
  3. You would like someone who has done it tell you what exactly you need to do to get your first PR in
  4. You are a fan of TODO guides and would like a reference for making your own TODO guide for contributing to Keptn

Or something else that I might have missed. This blogpost is an attempt at creating a TODO style guide for getting your first Keptn PR in.

I have drawn many of the TODOs from my own journey of contributing to Keptn (PRs to Keptn core, Datadog integration for Keptn). Many TODOs also come from community feedback on this guide (ref 1, 2).

There is an ongoing discussion for putting this blogpost under Keptn docs.

Problem

How do you start contributing Go code to Keptn?

Solution

You don’t have to do all of them. I have included everything I did.

A: Understand what Keptn is all about

  1. Go through the official website
  2. Join Keptn slack (<- to ask questions if you get stuck during Quickstart)
  3. Try out the Quickstart (if you are stuck ask for help in #help or #general)
  4. Go through the slide deck What is Keptn
  5. Go through Where does Keptn fit in the existing Cloud Native landscape
  6. Watch Overcoming (organizational) scalability issues in your Prometheus ecosystem - Jürgen Etzlstorfer
  7. Go through Keptn Full Tour on Prometheus or Keptn Full Tour on Dynatrace
  8. If you still don’t have a big-picture idea of what Keptn is, join Keptn slack. Ask your questions in #general
  9. Introduce yourself in one of the Keptn community/dev meetings. How?
    1. Add yourself to the list of attendees in the meeting notes Google doc
    2. Join a minute or two early, unmute yourself and introduce yourself. If you don’t have the permission to speak, introduce yourself in the chat. If you are not sure what to say, use this template:
    1
    
    Hi, I am <your-name>, this is my first Keptn community meeting. I recently started exploring Keptn. I look forward to learning more about Keptn and hopefully contributing to it.   
    

B: Build one of the Keptn core services and try running it locally

You might run into issues in this part. If you encounter any issues, ask for help in #help on Keptn slack.

  1. Install Keptn on your local k3d cluster. Check under k3d Keptn heading under the Keptn quickstart here for how. You should have the setup done until Try Multi-Stage Delivery.
  2. Build docker image for Shipyard Controller locally and use it in your cluster. Check the Shipyard Controller docs for how to do it.
  3. Change some code in the code. Something like fmt.Println("hello world" for example (something that shows your changes are being reflected in the cluster). Rebuild the image and re-deploy it in your cluster. Make sure you can see the change (if you just printed hello world, check the Shipyard Controller pod logs to see if hello world is printed in there)
  4. Use Get Started with Keptn Development using K3d locally - Part 1 and Get Started with Keptn Development using K3d locally - Part 2 as a reference

C: Find a #good-first-issue

  1. Go through Concepts
  2. Go through the architecture docs
  3. Go through the READMEs for the directories with suffix -service. Example
  4. Go through the Contributing Guide
  5. Check good first issues. Find something that looks easy to do. If you are still confused,
    a. pick something related to CLI
    b. pick something related to a part you have an idea about
    c. pick something related to an area you want to understand.
    First issue usually takes time to finish. If you don’t find anything interesting, reach out at #help-contributing for something that fits your criteria of a good first issue. Here’s an example:
1
2
3
4
5
6
Hi, I am looking for a good first issue. I see there are some good first issues listed here but I would like a second opinion. What I am looking for:
1. Something that is not high priority (I can take my time working through it)
2. Something that would allow me to get familiar with various parts of the codebase (to improve my understanding of Keptn)
3. I don't mind if it is an integration as long as it satisfies 2.
I have gone through the Quickstart, Architecture docs, Github README for contribution and I have skaffold setup locally.
Also, what would be the best place to ask questions related to codebase? #core-development?

E: Raise a PR

  1. Once you have found a good first issue you want to work on, go through the issue. Understand the problem. See if you have a fix in your mind. You might run into one of the following 3 scenarios
    a) Nothing makes sense
    b) You know what to do but you are not 100% sure
    c) You are sure about what to do

    The aim is to go to scenario c). When you start out you’d most probably in in a) or b). If it’s a) do
    i. Identify the parts you don’t understand. Gain that understanding by reading the documentation or asking questions in #help-contributing or #general if it’s related to Keptn.
    ii. Now that you have understanding of the problem, try to come up with a solution. You might find yourself researching about things and you might encounter things that you don’t understand. That’s alright. See if the documentation, a plain Google search or slack threads help you. If they don’t, just ask the question in #help-contributing if it’s related to Keptn but if it’s a concept say related to Golang that you don’t really understand, it’s better to Google that. If it’s a specific question related to Golang, ask it in #general or #newbies in Gopher’s slack. Sometimes it’s not easy to decide. If that’s the case, ask your question in #help-contributing.

    By this time, you will have an idea of what to do code/implementation wise. If you don’t, just do i and ii again.

  2. Just create a draft PR linking the issue. This indicates your interest in the issue. You can ask someone to assign the issue to you at this point. You might face multiple problems while working on PR, that’s alright. Check the first point. It’s okay to take time and it’s okay to get stuck.

F: Talk about your PR in the Keptn community meeting and ask for reviews

Note: Make sure the CI/CD tests pass before you ask someone for a review.

  1. Mark your PR as ready for review i.e., convert your draft PR in Github to a normal PR (creating a draft PR automatically assigns @keptn/maintainers as reviewers). Leave a comment saying @keptn/maintainers I would like this PR to be reviewed (example)
  2. If your PR is still not reviewed and you want it to get reviewed in a hurry, post a slack message asking for review in the relevant channel.
  3. If it’s related to an integration, ask for a review in the #keptn-integrations channel
  4. If it’s related to docs, ask for a review in the #keptn-docs channel
  5. If it’s related to Keptn core (i.e., any code related change in https://github.com/keptn/keptn) as for review in #core-development
  6. If you still don’t get reviews on your PR add it in the Keptn Developer Meeting notes like this:
1
2
3
<your-name>:
  - Feature/Bug/<something-else> (usually based on [commit type](https://github.com/keptn/keptn/blob/master/CONTRIBUTING.md#commit-types-and-scopes))
    - <PR-link>. Looking for reviews

e.g.,

1
2
3
4
5
Suraj:
  - Refactor
    - Manage Keptn Config with Viper 
      https://github.com/keptn/keptn/issues/5490

H: Address the review comments and fix the PR

  1. Getting a review might take time. You can start with your next PR if you don’t want to wait.

I: Merge the PR 🎉

FAQ

Nobody replied to me. What should I do?

Sometimes you might not get a reply to your question. In such cases,

  1. There’s a chance it might be a frequently asked question. Search for the question in slack and google. See if it has been asked already.
  2. If the above doesn’t work, try posting the question in channels with more visibility. e.g., if you posted your question in #keptn-integrations but did not receive a reply there, post it in the #help or #general channel because you get more visibility there.
  3. If you still don’t receive a reply and your problem isn’t solved yet, raise it in the developer meeting by adding it to the meeting notes like this:
1
2
3
<your-name>:
  - Need help with <slack-link-to-your-thread-here>

e.g.,

1
2
3
Suraj:
- Need help with https://keptn.slack.com/archives/CGS5TA283/p1649742261902179