From ea8864be7ef49124943a1a1830e99a0e6e8f0c49 Mon Sep 17 00:00:00 2001 From: lizrabuya <115472349+lizrabuya@users.noreply.github.com> Date: Fri, 10 May 2024 16:29:49 +1000 Subject: [PATCH] Add Contributing.md (#251) * Add contributing.md * remove local config test for user config * Update CONTRIBUTING.md Co-authored-by: Jarryd Tilbrook * Updated with suggested revisions --------- Co-authored-by: Jarryd Tilbrook --- CONTRIBUTING.md | 27 +++++++++++++++++++++++++++ fixtures/config/user.basic.yaml | 5 +---- internal/config/config_test.go | 24 ------------------------ 3 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..5d546a6d --- /dev/null +++ b/CONTRIBUTING.md @@ -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! \ No newline at end of file diff --git a/fixtures/config/user.basic.yaml b/fixtures/config/user.basic.yaml index 8f657be4..d643cef2 100644 --- a/fixtures/config/user.basic.yaml +++ b/fixtures/config/user.basic.yaml @@ -1,7 +1,4 @@ selected_org: buildkite-org organizations: buildkite-test: - api_token: test-token-abcd -preferences: - pipelines: - - first-pipeline \ No newline at end of file + api_token: test-token-abcd \ No newline at end of file diff --git a/internal/config/config_test.go b/internal/config/config_test.go index d31811d5..8188261a 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -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())) - } - }) }