Skip to content

Latest commit

 

History

History
68 lines (40 loc) · 4.43 KB

CONTRIBUTING.md

File metadata and controls

68 lines (40 loc) · 4.43 KB

Contributing to UDS Releaser

Welcome 🦄 to UDS Releaser! If you'd like to contribute, please reach out to one of the CODEOWNERS and we'll be happy to get you started!

Below are some notes on our core software design philosophies that should help guide contributors.

Table of Contents

  1. Code Quality and Standards
  2. How to Contribute

Code Quality and Standards

Fundamentally, Software Engineering is a communication problem; we write code for each other, not a computer. When working on this project (or any project!) keep your fellow humans in mind and write clearly and concisely. Below are some general guidelines for code quality and standards that make UDS Releaser ✨

  • Write tests that give confidence: Unless there is a technical blocker, every new feature and bug fix should be tested in the project's automated test suite. Although many of our tests are E2E, unit and integration-style tests are also welcomed. Note that unit tests can live in a *_test.go file alongside the source code, and E2E tests live in src/test/e2e

  • Prefer readability over being clever: We have a strong preference for code readability in UDS Releaser. Specifically, this means things like: naming variables appropriately, keeping functions to a reasonable size and avoiding complicated solutions when simple ones exist.

Continuous Delivery

Continuous Delivery is core to our development philosophy. Check out https://minimumcd.org for a good baseline agreement on what that means.

Specifically:

  • We do trunk-based development (main) with short-lived feature branches that originate from the trunk, get merged into the trunk, and are deleted after the merge
  • We don't merge code into main that isn't releasable
  • We perform automated testing on all changes before they get merged to main
  • We create immutable release artifacts

How to Contribute

Please ensure there is a GitHub issue for your proposed change, this helps the UDS Releaser team to understand the context of the change and to track the progress of the work. If there isn't an issue for your change, please create one before starting work. The recommended workflow for contributing is as follows:

  1. Fork this repo and clone it locally
  2. Create a branch for your changes
  3. Create, test your changes
  4. Add docs where appropriate
  5. Push your branch to your fork
  6. Open a PR against the main branch of this repo

Building the app

To build the app, check out the tasks with uds run --list-all, find the appropriate build target for your system, and run it from the root of the repo (ex. uds run build-cli-mac-apple). This will create a binary in the build directory that you can use to test your changes (note that this binary is automatically used when running E2E Tests.

Testing

We strive to test all changes made to UDS Releaser. If you're adding a new feature or fixing a bug, please add tests to cover the new functionality. Unit tests and E2E tests are both welcome, but we leave it up to the contributor to decide which is most appropriate for the change. Below are some guidelines for testing:

Unit Tests

Unit tests reside alongside the source code in a *_test.go file. These tests should be used to test individual functions or methods in isolation. Unit tests should be fast and focused on a single piece of functionality.

E2E Tests

E2E tests reside in the src/test/e2e directory. These tests leverage the releaser.yaml file in src/test and have util functions to work out of src/test/sandbox.

Assertions

We prefer to use Testify's require package for assertions in tests. This package provides a rich set of assertion functions that make tests more readable and easier to debug. See other tests in this repo for examples.

Running Tests

  • Unit Tests: To run unit tests, run uds run test:unit from the root of the repo. This will run all unit tests in the src directory.

  • E2E Tests: To run E2E tests, you'll need build UDS Releaser locally, and re-build any time you make a change to the source code; this is because the binary in the build directory is used to drive the tests. To run the entire suite of E2E tests locally, run uds run e2e.