Skip to content

Commit

Permalink
Add Contributing.md (#251)
Browse files Browse the repository at this point in the history
* Add contributing.md

* remove local config test for user config

* Update CONTRIBUTING.md

Co-authored-by: Jarryd Tilbrook <jarryd@buildkite.com>

* Updated with suggested revisions

---------

Co-authored-by: Jarryd Tilbrook <jarryd@buildkite.com>
  • Loading branch information
lizrabuya and jradtilbrook authored May 10, 2024
1 parent 44d94d4 commit ea8864b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Contributing

We welcome contributions from the community to make Buildkite CLI, `bk`, project even better.

## Getting Started

To get started with contributing, please follow these steps:

1. Fork the repository
2. Create a feature branch with a nice name (`git checkout -b cli-new-feature`) for your changes
3. Write your code
* We use `golangci-lint` and would be good to use the same in order to pass a PR merge. You can use `docker-compose -f .buildkite/docker-compose.yaml run lint` for that.
* Make sure the tests are passing by running go test ./...
5. Commit your changes and push them to your forked repository.
7. Submit a pull request with a detailed description of your changes and linked to any relevant issues.

The team maintaining this codebase will review your PR and start a CI build for it. For security reasons, we don't automatically run CI against forked repos, and a human will review your PR prior to its CI running.

## Reporting Issues

If you encounter any issues or have suggestions for improvements, please open an issue on the GitHub repository. Provide as much detail as possible, including steps to reproduce the issue.

## Contact

If we're really dragging our feet on reviewing a PR, please feel free to ping us through GitHub or Slack, or get in touch with [support@buildkite.com](mailto:support@buildkite.com), and they can bug us to get things done :)

Happy contributing!
5 changes: 1 addition & 4 deletions fixtures/config/user.basic.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
selected_org: buildkite-org
organizations:
buildkite-test:
api_token: test-token-abcd
preferences:
pipelines:
- first-pipeline
api_token: test-token-abcd
24 changes: 0 additions & 24 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,4 @@ func TestConfig(t *testing.T) {
t.Errorf("PreferredPipelines() does not match: %d", len(conf.PreferredPipelines()))
}
})

t.Run("read in user config", func(t *testing.T) {
t.Parallel()

fs := afero.NewMemMapFs()
err := prepareTestDirectory(fs, "user.basic.yaml", configFile())
if err != nil {
t.Fatal(err)
}

// try to load configuration
conf := New(fs, nil)
// confirm we get the expected values
if conf.userConfig.GetString("selected_org") != "buildkite-org" {
t.Errorf("OrganizationSlug() does not match: %s", conf.OrganizationSlug())
}
if conf.userConfig.GetString("organizations.buildkite-test.api_token") != "test-token-abcd" {
t.Errorf("APIToken() does not match: %s", conf.APIToken())
}

if len(conf.userConfig.GetStringSlice("preferences.pipelines")) != 1 {
t.Errorf("PreferredPipelines() does not match: %d", len(conf.PreferredPipelines()))
}
})
}

0 comments on commit ea8864b

Please sign in to comment.