Skip to content

Latest commit

 

History

History
129 lines (83 loc) · 5.14 KB

CONTRIBUTION.md

File metadata and controls

129 lines (83 loc) · 5.14 KB

PRs Welcome Open Source Love

At Intelops, we warmly welcome contributions through collaboration. We are excited to see that you want to contribute!. There are many ways in which one could contribute to GenVal and every contribution is equally appreciated here. Navigate through the following to understand more about contributing here.

New to Git

Follow these resources: https://lab.github.com and https://try.github.com/

Contributing to GenVal

Please follow these steps and note these guidelines to begin contributing:

  1. The first step is to set up the local development environment. See this on how to do the same.

  2. Take a look at the existing Issues or create a new issue!

  3. A good way to easily start contributing is to pick and work on a good first issue or help wanted. We try to make these issues as clear as possible and provide basic info on how the code should be changed, and if something is unclear feel free to ask for more information on the issue.

  4. Add screenshots or screen captures to your Pull Request to help us understand the effects of the changes proposed in your PR.

Set up your Local Development Environment

Make sure you have built the application from source on your operating system before you start contributing:

Clone the Genval repository:

git clone https://github.com/intelops/genval.git

# Navigate to the project directiry
cd genval

# Add a reference (remote) to the original repository
git remote add upstream https://github.com/intelops/genval.git

While contributing to genval, we would appreciate, if you work in your separate branch and push the changes to the branch. checkout to new branch:

git checkout -b <new branch>

genval is written in Golang, you can pull and resolve dependencies by running:

go mod tidy

And you are ready to roll...

You can track your changes.

git add  <file_name>

Commit your changes. To contribute to this project, you must agree to the Developer Certificate of Origin (DCO) for each commit you make.

git commit --signoff -m "<your commit message>"

or

git commit -s -m "<your commit message>"

Push the committed changes in your local branch to your remote repo.

git push -u origin <your_branch_name>

Once you’ve committed and pushed all of your changes to GitHub, go to the page for your fork on GitHub, select your development branch, and click the pull request button. Please ensure that you compare your feature branch to the desired branch of the repo you are supposed to make a PR to.

🏆 After this, the maintainers will review the PR and will merge it if it helps move the genval project forward. Otherwise, it will be given constructive feedback and suggestions for the changes needed to add the PR to the codebase.

14. While you are working on your branch, other developers may update the main branch with their branch. Such scenarios make your branch out of date with the main branch with missing content. So to fetch the new changes, follow along:

git checkout main
git fetch origin main
git merge upstream/main
git push origin

Now you need to merge the main branch into your branch. This can be done in the following way:

git checkout <your_branch_name>
git merge main

Contributing by adding a Cue schema to the project

Genval leverages upstream Kubernetes and CRD APIs for validation and configuration generation. For technologies not currently supported, users can extend Genval's capabilities by adding Cue schemas.

The workflow for adding a Cue schema is as follows:

  • Clone the repository by following the steps outlined above and navigate to the genval directory.
  • Identify the technology and the package URL that exposes the APIs you want to add schemas for. In the following example, we'll import schemas for TektonCD:
$ go get github.com/tektoncd/pipeline/pkg/apis/...
# This downloads the Go types for the API.
$ cue get go github.com/tektoncd/pipeline/pkg/apis/...
# This imports the Go types into Cue schemas for TektonCD within the 'cue.mod' directory.

Once the APIs are imported into Cue, you can reference them in your definitions for TektonCD, similar to import statements in Golang:

package tekton

import "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"

#Pipeline: v1beta1.#Pipeline & {
	apiVersion: string | *"tekton.dev/v1beta1"
	kind:       string | *"Pipeline"
    ...
}

Now, you can easily reference the Cue schemas for #Pipeline by utilizing the imported schemas as v1beta1.#Pipeline.

All the best! 🥇