Skip to content

Commit

Permalink
docs: refresh contributing guide (windows dev setup and auto-gen cmd …
Browse files Browse the repository at this point in the history
…docs) (#960)

Issue #, if available: #942

*Description of changes:*
- Update contribution docs to reflect changes over the past few months: 
   - Windows dev setup
   - Doc updates when commands change


*Testing done:*



- [x] I've reviewed the guidance in CONTRIBUTING.md


#### License Acceptance

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

---------

Signed-off-by: Justin Alvarez <alvajus@amazon.com>
  • Loading branch information
pendo324 authored May 28, 2024
1 parent 08d7a34 commit d3c4165
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
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

0 comments on commit d3c4165

Please sign in to comment.