From bc0aeb2a2c151fbdeee19b7b348a66ebf466ebf7 Mon Sep 17 00:00:00 2001 From: attiasas Date: Thu, 1 Feb 2024 10:19:14 +0200 Subject: [PATCH] improve guide --- CONTRIBUTING.md | 86 +++++++++++++++++++++++++++---------------------- 1 file changed, 48 insertions(+), 38 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e2b6a758..fd821772 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,43 +1,12 @@ # Contribution Guide +Welcome to the contribution guide for our project! We appreciate your interest in contributing to the development of this project. Below, you will find essential information on local development, running tests, and guidelines for submitting pull requests. + ## Table of Contents -- [📖 Guidelines](#-guidelines) - [🏠🏗️ Local development](#%EF%B8%8F-local-development) - [🚦 Running Tests](#-running-tests) - -## 📖 Guidelines - -Before submitting the pull request, ensure: - -- Your changes are covered by `unit` and `integration` tests. If not, please add new tests. -- The code compiles, by running `go vet ./...`. -- To format the code, by running `go fmt ./...`. - -When creating the pull request, ensure: - -- The pull request is on the `dev` branch. -- The pull request description describes the changes made. - -
- -Before merging the pull request - ---- - -Once you have completed your coding changes, it is recommended to push the modifications made to the other modules first. Once these changes are pushed, you can update this project to resolve dependencies from your GitHub fork or branch. - -To achieve this, modify the `go.mod` file to point the dependency to your repository and branch, as shown in the example below: - -``` -replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 dev -``` - -Finally, execute `go mod tidy` to update the Go module files. Please note that Go will automatically update the version in the `go.mod` file. - ---- - -
+- [📖 Submitting PR Guidelines](#-submitting-pr-guidelines) ## 🏠🏗️ Local Development @@ -50,8 +19,6 @@ go run github.com/jfrog/jfrog-cli-security command [options] [arguments...] --- -Please review our [Plugin Contribution](https://github.com/jfrog/jfrog-cli-core/blob/dev/plugins/README.md) guide. - This project heavily depends on the following modules: - [github.com/jfrog/jfrog-client-go](https://github.com/jfrog/jfrog-client-go) @@ -59,6 +26,11 @@ This project heavily depends on the following modules: During local development, if you come across code that needs to be modified in one of the mentioned modules, it is advisable to replace the dependency with a local clone of the module. +
+Replacing a dependency with a local clone + +--- + To include this local dependency, For instance, let's assume you wish to modify files from `jfrog-cli-core`, modify the `go.mod` file as follows: ``` @@ -67,10 +39,14 @@ replace github.com/jfrog/jfrog-cli-core/v2 => /local/path/in/your/machine/jfrog- Afterward, execute `go mod tidy` to ensure the Go module files are updated. Note that Go will automatically adjust the version in the `go.mod` file. +--- + +
+ + ## 🚦 Running Tests -When running the tests, builds and repositories with timestamps will be created, for example: `cli-rt1-1592990748` and `cli-rt2-1592990748`. -The content of these repositories will be deleted once the tests are completed. +When running tests, builds and repositories with timestamps like `cli-rt1-1592990748` and `cli-rt2-1592990748` will be created. The content of these repositories will be deleted once the tests are completed. To run tests, use the following command: @@ -115,3 +91,37 @@ go test -v github.com/jfrog/jfrog-cli-security [test-types] [flags] + +## 📖 Submitting PR Guidelines + +Once you have completed your coding changes, it is recommended to push the modifications made to the other modules first. Once these changes are pushed, you can update this project to resolve dependencies from your GitHub fork or branch. + +
+ +Resolve dependencies from GitHub fork or branch + +--- + +To achieve this, modify the `go.mod` file to point the dependency to your repository and branch, as shown in the example below: + +``` +replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 dev +``` + +Finally, execute `go mod tidy` to update the Go module files. Please note that Go will automatically update the version in the `go.mod` file. + +--- + +
+ +### Before submitting the pull request, ensure: + +- Your changes are covered by `unit` and `integration` tests. If not, please add new tests. +- The code compiles, by running `go vet ./...`. +- To format the code, by running `go fmt ./...`. +- The documentation covers the changes, if not please add and make changes at [The documentation repository](https://github.com/jfrog/documentation) + +### When creating the pull request, ensure: + +- The pull request is on the `dev` branch. +- The pull request description describes the changes made. \ No newline at end of file