Skip to content

Commit

Permalink
Improved developer and contribution docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ziegfried committed Dec 17, 2020
1 parent 620ef75 commit bf6b53c
Show file tree
Hide file tree
Showing 6 changed files with 257 additions and 29 deletions.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Feature request
about: Have an idea on how to improve the app?
title: ''
labels: enhancement
assignees: ''

---

*Describe your enhancement idea*
72 changes: 72 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
## Code of Conduct

### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

### Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

### Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

### Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
112 changes: 112 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Contributing to Slack Alerts for Splunk

This document is the single source of truth on contributing towards this codebase. Please feel free to browse the open issues and file new ones - all feedback is welcome!

## Topics

- [Prerequisites](#prerequisites)
- [Contributor License Agreement](#contributor-license-agreement)
- [Code of Conduct](#code-of-conduct)
- [Setup development environment](#setup-development-environment)
- [Contribution Workflow](#contribution-workflow)
- [Feature Requests and Bug Reports](#feature-requests-and-bug-reports)
- [Fixing Issues](#fixing-issues)
- [Pull Requests](#pull-requests)
- [Code Review](#code-review)
- [Testing](#testing)
- [Documentation](#documentation)

## Prerequisites

When contributing to this repository, please first discuss the change you wish to make via a GitHub issue, Slack message, email, or via other channels with the owners of this repository.

##### Contributor License Agreement

At the moment, we can only accept pull requests submitted from either:

- Splunk employees or
- Individuals that have signed our contribution agreement

If you wish to be a contributing member of our community, please see the agreement [for individuals](https://www.splunk.com/goto/individualcontributions) or [for organizations](https://www.splunk.com/goto/contributions).

##### Code of Conduct

Please make sure to read and observe our [Code of Conduct](CODE_OF_CONDUCT.md). Please follow it in all of your interactions involving the project.

##### Setup Development Environment

Check out the [developer documentation](./DEVELOPING.md)

##### Code Style

See [code style guidance](./DEVELOPING.md#code-style) in the developer documentation.

##### Testing

See [testing section](./DEVELOPING.md#run-tests) in the developer docs.

## Contribution Workflow

Help is always welcome! For example, documentation can always use improvement. There's always code that can be clarified, functionality that can be extended, and tests to be added to guarantee behavior. If you see something you think should be fixed, don't be afraid to own it.

##### Feature Requests and Bug Reports

Have ideas on improvements? See something that needs work? While the community encourages everyone to contribute code, it is also appreciated when someone reports an issue. Please report any issues or bugs you find through [GitHub's issue tracker](https://github.com/splunk/slack-alerts/issues).

If you are reporting a bug, please include:

- Any details about your local setup that might be helpful in troubleshooting
- Detailed steps to reproduce the bug

We'd also like to hear about your propositions and suggestions. Feel free to submit them as issues and:

- Explain in detail how they should work
- Keep the scope as narrow as possible - this will make it easier to implement

##### Fixing Issues

Look through our [issue tracker](https://github.com/splunk/slack-alerts/issues) to find problems to fix! Feel free to comment and tag corresponding stakeholders or full-time maintainers of this project with any questions or concerns.

##### Pull Requests

What is a "pull request"? It informs the project's core developers about the changes you want to review and merge. Once you submit a pull request, it enters a stage of code review where you and others can discuss its potential modifications and even add more commits to it later on.

If you want to learn more, please consult this [tutorial on how pull requests work](https://help.github.com/articles/using-pull-requests/) in the [GitHub Help Center](https://help.github.com/).

Here's an overview of how you can make a pull request against this project:

1. Fork the [Slack Alerts GitHub repository](https://github.com/splunk/slack-alerts)
2. Clone your fork using git and create a branch off master
3. Run all the tests to verify your environment
4. Make your changes, commit and push once your tests have passed
5. Submit a pull request through the GitHub website using the changes from your forked codebase

##### Code Review

There are two aspects of code review: giving and receiving.

To make it easier for your PR to receive reviews, consider the reviewers will need you to:

- Follow the project coding conventions
- Write good commit messages
- Break large changes into a logical series of smaller patches which individually make easily understandable changes, and in aggregate solve a broader issue

Reviewers, the people giving the review, are highly encouraged to revisit the [Code of Conduct](contributing/code-of-conduct.md) and must go above and beyond to promote a collaborative, respectful community.

When reviewing PRs from others [The Gentle Art of Patch Review](http://sage.thesharps.us/2014/09/01/the-gentle-art-of-patch-review/) suggests an iterative series of focuses which is designed to lead new contributors to positive collaboration without inundating them initially with nuances:

- Is the idea behind the contribution sound?
- Is the contribution architected correctly?
- Is the contribution polished?

For this project, we require that at least 1 approval is given and a build from our continuous integration system is successful off of your branch. Please note that any new changes made with your existing pull request during review will automatically unapprove and retrigger another build/round of tests.

##### Documentation

We could always use improvements to our documentation! Anyone can contribute to these docs - whether you’re new to the project, you’ve been around a long time, and whether you self-identify as a developer, an end user, or someone who just can’t stand seeing typos. What exactly is needed?

1. More complementary documentation. Have you perhaps found something unclear?
2. More examples or generic templates that others can use.
3. Blog posts, articles and such – they’re all very appreciated.

You can also edit documentation files directly in the GitHub web interface, without creating a local copy. This can be convenient for small typos or grammer fixes.
52 changes: 52 additions & 0 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
## Dev Setup

Prerequisites:

- Node.js 12
- [Yarn](https://yarnpkg.com/) package manager
- Python 2.x and or 3.x

### Bootstrap project - install dependencies

```
$ cd slack_alerts
$ yarn install
```

## Build & Package

In order to build the app run

```sh
$ yarn build
```

If you want to link your built app to a local Splunk instance, run

```sh
$ yarn symlink
```

Note: you'll have to have your `$SPLUNK_HOME` environment variable set correctly.

To build a package you can upload to [Splunkbase](http://splunkbase.com/), run the following command:

```sh
$ yarn package
```

This will create a `*.spl` file in the `dist/` directory.

## Code Style

This project uses [prettier](https://github.com/prettier/prettier) to ensure consistent code formatting. You may want to add a prettier plugin to your editor/ide for a smooth experience.

## Run Tests

To execute unit tests, run:

```sh-session
$ yarn test
```

(This requires a python environment to be set up)
40 changes: 11 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,21 @@
# Slack alert action for Splunk
# Slack Alert Action for Splunk

[![App Inspect](https://github.com/ziegfried/splunk-slack-alerts/workflows/App%20Inspect/badge.svg)](https://github.com/ziegfried/splunk-slack-alerts/actions?query=workflow%3A"App+Inspect"+branch%3Amaster)

This app adds a new custom alert action to your Splunk instance which allows you
to send a message to a Slack channel.
This app adds a new custom alert action to your Splunk instance which allows you to send a message to a Slack channel.

## Dev Setup
<div align="center">
<img src="./screenshots/message_example.png?raw=true" width="569" height="301" alt="Example Screnshot" />
</div>

This project uses the [Yarn](https://yarnpkg.com/) package manager. Once you have Yarn, use the following command to
install the dependencies:
## Get Started

```
$ yarn install
```
See the [developer documentation](./DEVELOPING.md) if you want to make changes to the app and run it locally.

## Build & Package
## Usage Documentation

In order to build the app run
Docs on how to use the app can be found in the [app README](./src/app/README.md).

```sh
$ yarn build
```
## Contributing

If you want to link your built app to a local Splunk instance, run

```sh
$ yarn symlink
```

Note: you'll have to have your `$SPLUNK_HOME` enviroment variable set correctly.

To build a package you can upload to [Splunkbase](http://splunkbase.com/), run the following command:

```sh
$ yarn package
```

This will create a `*.spl` file in the `dist/` directory.
Thank you for considering to contribute to Slack Alerts for Splunk! Please read the [contribution guidelines](./CONTRIBUTING.md) to get started.
Binary file added screenshots/message_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bf6b53c

Please sign in to comment.