Contributing with GitHub Codespaces

How to contribute to the Dapr project with GitHub Codespaces

GitHub Codespaces is the easiest way to get up and running for contributing to a Dapr repo. In as little as a single click, you can have an environment with all of the prerequisites ready to go in your browser.

Features

  • Click and Run: Get a dedicated and sandboxed environment with all of the required frameworks and packages ready to go.
  • Usage-based Billing: Only pay for the time you spend developing in the Codespaces. Environments are spun down automatically when not in use.
  • Portable: Run in your browser or in Visual Studio Code, or connect to it using SSH.

Open a Dapr repo in a Codespace

To open a Dapr repository in a Codespace, select “Code” from the repo homepage and “Open with Codespaces”:

Screenshot of creating a Dapr Codespace

If you haven’t already forked the repo, creating the Codespace will also create a fork for you and use it inside the Codespace.

Supported repos

Developing Dapr Components in a Codespace

Developing a new Dapr component requires working with both the dapr/components-contrib and dapr/dapr repos. It is recommended to place both folders inside the /workspaces directory, side-by-side.

If you created a Codespace from dapr/dapr

If your Codespaces was started from the dapr/dapr repo or a fork of that, you will need to clone the dapr/components-contrib repository (or your fork of that) inside /workspaces/components-contrib.

First, make sure you’ve authenticated with the GitHub CLI:

  1. # Run this command and follow the prompts
  2. # Most users should accept the default choices
  3. gh auth login

Clone the repo:

  1. # If you want to use your fork of dapr/components-contrib, replace this with your fork (e.g. "yourusername/components-contrib")
  2. # Make sure you've forked the repo before doing this
  3. REPO=dapr/components-contrib
  4. cd /workspaces
  5. gh repo clone "$REPO" /workspaces/components-contrib

Then, add the folder to current workspace:

  1. code -a /workspaces/components-contrib

If you created a Codespace from dapr/components-contrib

If your Codespaces was started from the dapr/components-contrib repo or a fork of that, you will need to clone the dapr/dapr repository (or your fork of that) inside /workspaces/dapr.

First, make sure you’ve authenticated with the GitHub CLI:

  1. # Run this command and follow the prompts
  2. # Most users should accept the default choices
  3. gh auth login

Clone the repo:

  1. # If you want to use your fork of dapr/dapr, replace this with your fork (e.g. "yourusername/dapr")
  2. # Make sure you've forked the repo before doing this
  3. REPO=dapr/dapr
  4. cd /workspaces
  5. gh repo clone "$REPO" /workspaces/dapr

Then, add the folder to current workspace:

  1. code -a /workspaces/dapr

Last modified October 11, 2024: Fixed typo (#4389) (fe17926)