Skip to content

Latest commit

 

History

History
239 lines (161 loc) · 6.79 KB

File metadata and controls

239 lines (161 loc) · 6.79 KB

Contributing Guidelines

Thank you for your interest in contributing to the DataRobot CLI! This document provides guidelines for contributing to this project.

Table of Contents

Code of Conduct

This project follows the DataRobot Code of Conduct. Please be respectful and constructive in all interactions.

GitHub CLI Recommendation

DataRobot recommends using the GitHub CLI (gh) for fork management. All examples in this guide use gh commands, which streamline the fork, clone, and pull request workflow.

Install GitHub CLI:

  • macOS: brew install gh
  • Linux: See installation guide
  • Windows: winget install --id GitHub.cli or choco install gh

After installation, authenticate with: gh auth login

Manual Git workflow: If you prefer not to use gh, you can manually fork on GitHub, clone your fork, and configure remotes. The gh commands shown can be replaced with equivalent git commands.

Getting Started

Development Setup

To start contributing, you'll need to set up your development environment:

  1. Read the Development Setup Guide for detailed instructions on:

    • Installing prerequisites (Go, Task, etc.)
    • Building the CLI from source
    • Running tests and linters
  2. Understand the Project Structure to familiarize yourself with:

    • Code organization
    • Key directories and their purposes
    • Coding patterns used in the project
  3. Review the Building Guide for:

    • Detailed build information
    • Architecture overview
    • Coding standards and quality tools

Documentation Preview

To preview the documentation site locally:

cd docs
uv sync
uv run mkdocs serve

Then open http://localhost:8000 in your browser. The preview will auto-reload when you edit markdown files.

Development Workflow

Fork the Repository

External contributors should work from a fork of the repository:

# Fork and clone in one command (sets up origin → your fork, upstream → main repo)
gh repo fork datarobot-oss/cli --clone --default-branch-only
# --fork-name <your-fork-name> can be used to specify a custom fork name, i.e. --fork-name drcli

Note: If you prefer manual fork management, fork the repository on GitHub, then clone your fork and add the upstream remote manually.

Quick Start

# Fork and clone the repository
gh repo fork datarobot-oss/cli --clone --default-branch-only
cd cli

# Setup development environment
task dev-init

# Build the CLI
task build

# Run tests
task test

# Run linters
task lint

Making Changes

  1. Sync with upstream before starting work

    # Sync your fork with upstream
    gh repo sync
  2. Create a feature branch

    git checkout -b feature/your-feature-name
  3. Make your changes

    • Follow the coding standards in building.md
    • Write tests for new functionality
    • Update documentation as needed
  4. Test your changes

    # Run unit tests
    task test
    
    # Run linters
    task lint
    
    # Run smoke tests (optional, requires DR_API_TOKEN)
    export DR_API_TOKEN=your-token
    task smoke-test
  5. Commit your changes

    git commit -m "Brief description of your changes"

    Use clear, descriptive commit messages. Consider using Conventional Commits format.

  6. Push to your fork

    git push origin feature/your-feature-name

Opening Issues

Before Opening an Issue

  • Check if there are any existing issues or pull requests that match your case
  • Review any FAQ documentation if available
  • Search closed issues as your question may have been answered before

Creating an Issue

When opening an issue:

  1. Use the appropriate label: bug, enhancement, feature request, documentation, etc.
  2. Be specific and detailed:
    • For bugs: include steps to reproduce, expected behavior, and actual behavior
    • For features: describe the use case and proposed solution
    • Include relevant code snippets, error messages, or screenshots

Security Vulnerabilities

Do not open a GitHub issue for security vulnerabilities. Instead:

  1. Email the maintainers directly (see Project Maintainers)
  2. If maintainers don't respond within seven days, email oss-community-management@datarobot.com

Submitting Pull Requests

Pull Request Process

After pushing your changes to your fork, create a pull request from your fork to the upstream repository:

  1. Create the pull request:

    # Create PR from your current branch
    gh pr create

    This opens an interactive prompt to set the title, description, and target branch. Pass -w to open the PR in your web browser.

  2. Ensure your PR:

    • Has a clear title and description
    • References any related issues (e.g., "Fixes #123")
    • Passes all tests (task test)
    • Passes all linters (task lint)
    • Includes documentation updates if needed
  3. PR Description should include:

    • What changes were made and why
    • How to test the changes
    • Any breaking changes or migration notes
    • Screenshots for UI changes (if applicable)
  4. Review Process:

    • Maintainers will review your PR
    • Address any feedback or requested changes
    • Once approved, a maintainer will merge your PR

Quality Standards

All code must:

  • Pass golangci-lint with zero errors
  • Follow Go formatting standards (go fmt, go vet)
  • Include appropriate tests
  • Maintain or improve code coverage
  • Follow the whitespace rules (wsl) defined in the project

See building.md for detailed coding standards.

Release Process

For information on creating releases, see the Release Process Guide.

Project Maintainers

Getting Help

If you don't get a response within seven days of creating your issue or pull request, please send us an email at oss-community-management@datarobot.com.

Additional Resources

Thank you for contributing to the DataRobot CLI!