Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: refresh contributing guide (windows dev setup and auto-gen cmd docs) #960

Merged
merged 2 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
[self-hosted, macos, arm64, 13, test],
[self-hosted, macos, arm64, 14, test],
]
test-command: ['test-e2e-vm-serial', 'test-e2e-container']
runs-on: ${{ matrix.os }}
steps:
- run: echo "Skipping CI for docs & contrib files"
Expand Down
34 changes: 31 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ This is needed because we use `Loose` instead of `Strict` regarding [branch prot

## Development Environment Setup

This section describes how one can develop Finch CLI locally on macOS, build it, and then run it to test out the changes. The design ensures that the local development environment is isolated from the installation (i.e., we should not need to run `make install` to do local development). Please note that this section uses [Homebrew](https://brew.sh/) to install dependencies.
This section describes how one can develop Finch CLI locally, build it, and then run it to test out the changes. The design ensures that the local development environment is isolated from the installation (i.e., we should not need to run `make install` to do local development).

### Linter

Expand All @@ -114,18 +114,42 @@ For more details, see [`.golangci.yaml`](./.golangci.yaml) and the `lint` target

### Install dependencies

Before building, install dependencies required to build the project binaries.
#### macOS

Please note that this section uses [Homebrew](https://brew.sh/) to install dependencies, which has to be installed before continuing to the next steps.

Before building Finch, install dependencies required to build the project binaries using Homebrew:

```sh
brew install go lz4 automake autoconf libtool yq
```

Note that you may need to add the following to the `.profile` file of your shell if `which libtool` does not return the one installed by Homebrew. The one that comes with macOS is too old for our use.
Note that you may need to add the following to the `.profile` file of your shell if `which libtool` does not return the one installed by Homebrew. The one that comes with macOS is too old for use with Finch.

```sh
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
```

#### Windows

The easiest way to install dependencies on Windows is through the use of `winget`, which comes [pre-installed on modern versions of Windows](https://learn.microsoft.com/en-us/windows/package-manager/winget/#install-winget). Follow the instructions in the link if typing `winget` in your Terminal does not work out of the box.

After ensuring `winget` is working, running the following command will setup all of the pre-requisites needed to build Finch on Windows:

```powershell
winget install -e --id GnuWin32.Make
winget install -e --id Git.Git
winget install -e --id=GoLang.Go
winget install -e --id MikeFarah.yq
```

In order to actually run Finch on Windows, you will need to also configure WSL 2 ([the runfinch.com website has detailed instructions](https://runfinch.com/docs/managing-finch/windows/installation/)):

```powershell
wsl --update
wsl --install Ubuntu
```

### Build

Clone the repo and make sure to include the submodules by adding `--recurse-submodules`. For example:
Expand Down Expand Up @@ -258,6 +282,10 @@ make lint
We also have more criteria than just that before we can accept and merge it. We recommend that you check the following things locally
before you submit your code:

### Documentation

If your change adds any new commands or parameters (for example, if adding a new `--example` flag to `finch vm stop`), ensure that `./_output/bin/finch gen-docs generate -p ./docs/cmd` is run and the result is added to a commit in the PR branch. [PR #938](https://github.com/runfinch/finch/pull/938) is a good example of when documentation had to be added for a new command parameter. Another case when this may happen is when a nerdctl command or parameter is modified.

### Testing

#### Unit Testing - Parallel by Default
Expand Down
Loading