github.com/siglens/siglens@v0.0.0-20240328180423-f7ce9ae441ed/CONTRIBUTING.md (about)

     1  # Siglens Contributor Guide
     2  
     3  - [Siglens Contributor Guide](#siglens-contributor-guide)
     4    - [Ways to Contribute](#ways-to-contribute)
     5    - [Find an Issue](#find-an-issue)
     6    - [Ask for Help](#ask-for-help)
     7    - [Pull Request Lifecycle](#pull-request-lifecycle)
     8    - [Development Environment Setup](#development-environment-setup)
     9      - [Start up Siglens](#start-up-siglens)
    10      - [Send Data to SigLens](#send-data-to-siglens)
    11      - [Send Queries on Siglens](#send-queries-on-siglens)
    12    - [Pull Request Checklist](#pull-request-checklist)
    13  
    14  Hello there! We are glad that you want to contribute to our project! đź’–
    15  
    16  As you get started, you are in the best position to give us feedback on areas of
    17  our project that we need help with including:
    18  
    19  * Problems found during setting up a new developer environment
    20  * Gaps in our documentation
    21  
    22  If anything doesn't make sense, or doesn't work when you run it, please open a
    23  bug report and let us know!
    24  
    25  ## Ways to Contribute
    26  
    27  We welcome many different types of contributions including:
    28  
    29  * New features
    30  * Bug fixes
    31  * Documentation
    32  * Issue Triage
    33  
    34  Not everything happens through a GitHub pull request. Please join our Slack: [SigLens Community](https://www.siglens.com/slack) and let's discuss how we can work together.
    35  
    36  
    37  ## Find an Issue
    38  
    39  We have good first issues for new contributors and help wanted issues suitable
    40  for any contributor. [good first issue](https://github.com/siglens/siglens/labels/good%20first%20issue) has extra information to help you make your first contribution.
    41  [help wanted](https://github.com/siglens/siglens/labels/help%20wanted) are issues suitable for someone who isn't a core maintainer and is good to move onto after your first pull request.
    42  
    43  Sometimes there won’t be any issues with these labels. That’s ok! There is
    44  likely still something for you to work on. If you want to contribute but you
    45  don’t know where to start or can't find a suitable issue, you can
    46  join our slack [SigLens Community](https://www.siglens.com/slack)
    47  
    48  Once you see an issue that you'd like to work on, please post a comment saying
    49  that you want to work on it. Something like `"I want to work on this"` is fine.
    50  
    51  ## Open an Issue
    52  
    53  ### Check for existing Issues
    54  
    55  * Before you create a new issue, please search on the [open issues](https://github.com/siglens/siglens/issues) page to see if the issue or feature request has already been filed.
    56  * If you can not find your issue exists, [choose a specific issue type](https://github.com/siglens/siglens/issues/new/choose) and open a new issue.
    57  
    58  ### Issue Types
    59  
    60  * **Bug report**: You’ve found a bug with the code, and want to report or track the bug. Show more details, and let us know about an unexpected error, a crash, or an incorrect behavior.
    61  * **New feature request**: Suggest a new feature. This allows feedback from others before the code is written.
    62  * **Story**: Clearly describe the task. Break it down as much as you can so it's easier to implement. Link to existing issues if appropriate using #issue-number.
    63  * **Report a security vulnerability**: Review our security policy first and then report a vulnerability.
    64  
    65  ## Ask for Help
    66  
    67  The best way to reach us with a question when contributing is to ask on:
    68  
    69  * The original github issue
    70  * Our Slack channel : [SigLens Community](https://www.siglens.com/slack)
    71  
    72  ## Pull Request Lifecycle
    73  
    74  Once you have found the issue to be fixed or feature to be added, you can comment on the issue and put the approach you want to follow to solve the issue. Once we agree upon the approach, you can open a PR.
    75  
    76  If its your first time on github, please read [FIRST_TIME_GIT_USERS_GUIDE.md](FIRST_TIME_GIT_USERS_GUIDE.md) to understand terms like `fork`, `clone`, `create a repo`, and others.
    77  
    78  Steps to open a PR:
    79  
    80  1. Fork Siglens repo and clone it on your local machine.  
    81  2. Make your desired code changes
    82  3. Make sure local tests work. (`make all`)
    83  4. Make sure go code is formatted correctly. (`make pr`)
    84  5. Commit your changes to your fork.
    85  6. Create a pull request. (Automated CI tests will run)
    86  7. Once the change has been approved and merged, we will inform you in a comment.
    87  
    88  
    89  ## Development Environment Setup
    90  
    91  Download golang version that is defined in `go.mod` and make sure git is installed.
    92  
    93  VS Code is the recomended IDE and offers good extensions and tools that will help developers write code.
    94  
    95  To run the Go linter locally, install it from [here](https://golangci-lint.run/welcome/install/#local-installation).
    96  
    97  Siglens currently support `Linux` and `macOS` for development purposes.
    98  
    99  - To setup project locally on macOS please jump to [Start up Siglens](#start-up-siglens) section.
   100  - For Linux systems, the `build-essential` package is necessary. If it's already installed, no action is needed. Otherwise, please execute the following commands:
   101  
   102      - For Debian/Ubuntu:
   103  
   104      ```bash
   105      sudo apt update
   106      sudo apt install build-essential
   107      ```
   108      
   109      - For Fedora/CentOS/RHEL:
   110     ```bash
   111     sudo yum groupinstall "Development Tools"
   112     sudo yum install gcc g++ make
   113     ```
   114  
   115  ### Start up Siglens
   116  
   117  Once golang is installed, start up SigLens by running the following command at the root of the repo:
   118  ```
   119  go run cmd/siglens/main.go --config server.yaml
   120  ```
   121  
   122  By default, the UI server will start up on port `5122` and the backend will start on port `8081`.
   123  
   124  You should be able to access `http://localhost:5122` and see the SigLens UI. If you are not able to, check `siglens.log` for any error messages.
   125  
   126  
   127  ### Send Data to SigLens
   128  
   129  In another terminal, go to the location of sigclient:
   130  ```
   131  cd tools/sigclient
   132  ```
   133   start the ingestion via `sigscalr-client` by running:
   134  ```
   135  go run main.go ingest esbulk -t 10_000 -d http://localhost:8081/elastic --processCount 1 -n 1 -b 500 -g dynamic-user
   136  ```
   137  
   138  Look through the [sigscalr-client ReadMe](tools/sigclient/README.md) to see all command arguments.
   139  
   140  
   141  ### Send Queries on Siglens
   142  
   143  Using the UI, you should be able to send queries using our pipe search query langauge. Look through the dropdown highlighting different query syntax and try running some test queries on the UI.
   144  
   145  The sigscalr-client also supports sending queries using:
   146  ```
   147  go run main.go query -d http://localhost:5122/elastic -n 10 -v
   148  ```
   149  
   150  
   151  ## Pull Request Checklist
   152  
   153  When you submit your pull request, or you push new commits to it, our automated
   154  systems will run some checks on your new code. We require that your pull request
   155  passes these checks, but we also have more criteria than just that before we can
   156  accept and merge it. We recommend that you check the following things locally
   157  before you submit your code:
   158  
   159  lint, UTs, gofmt :
   160  ```
   161      make pr
   162  ```