Permalink
Switch branches/tags
bugfix/arraydatasource-cache-query-result-2023 bugfix/command-instances-3076 bugfix/containers-php-fatal-errors-2216 bugfix/disable-inactive-ido-backend bugfix/domain-user-groups-3250 bugfix/filter-editor-new-elements-2900 bugfix/fix-ldap-domain-discovery-2956 bugfix/gravatar-isnt-loading-through-proxy-9916 bugfix/group_name_attribute-should-be-sAMAccountName-by-default-12295 bugfix/hook-resource-locking-3055 bugfix/improve-error-handling-when-responding-to-non-html-requests-2635 bugfix/js-close-container-8590 bugfix/ldap-group-membership-2-5-1-3324 bugfix/ldapbackendform-s-discover-button-persist-result-2994 bugfix/navigation-massive-useless-class_exists-2129 bugfix/remove-leading-and-trailing-whitespace-from-text-12208 bugfix/resource-config-forms-createelements-don-t-return-anything-3048 bugfix/rpm-php-fpm-9669 bugfix/update-group-memberships-2622 bugfix/web-serve feature/balance-visual-weight-of-main-nav-icons feature/beautify-filter-styling feature/bulk-execute-monitoring-actions-11309 feature/change-form-style feature/collapsible-container-9566 feature/collapsible-sidebar-issues-3187 feature/collapsible-sidebar-menu-3081 feature/css-flyout-menu feature/dark-sidebar-style-3086 feature/dark-sidebar feature/detailview-improvement feature/disable-auto-refresh-of-inactive-tabs-2761 feature/filter-acknowleged-service-problems-in-service-grid-2665 feature/filter-styles feature/fs-improve-detail-view feature/guest-mode-11281 feature/hooks-for-custom-resource-types-2790 feature/http-resource-type-3035 feature/icinga-2-api-detect-ido-setup-wizard-2544 feature/icinga-2-api-expand-commands-1344 feature/js-collapsible-containers feature/memory-json-csv-13623 feature/optimize-ido-mysql-12732 feature/phone-mail-render-hook-2152 feature/phpcodevaliditytest feature/po-lib feature/redesign-detail-state-table feature/redesign-state-badges feature/redo-pdf-export feature/requirements-interface feature/responsive-perfdata-table feature/restructure-layout-markup feature/semantic-search-4469 feature/store-php-sessions-in-redis-3162 feature/style-forms feature/tls-certificate-and-key-store-3016 feature/toggleable-containers-3024 feature/translation-msgfmt-statistics-7052 feature/update-dashlets-by-filter-editor-13071 feature/user-menu-flattened feature/userconfig-show-roles-2657 feature/whitelist-for-iframe-3296 feature/wip-storage-abstraction fix/cli-command fix/ldap-group-membership-regression fix/state-names-should-be-written-in-uppercase fix/window-id-cannot-be-used-to-differentiate-containers-3609 master support/2.1 support/2.2 support/2.4 translation/transifex
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
329 lines (220 sloc) 9.67 KB

Contributing

Icinga is an open source project and lives from your ideas and contributions.

There are many ways to contribute, from improving the documentation, submitting bug reports and features requests or writing code to add enhancements or fix bugs.

Table of Contents

  1. Introduction
  2. Fork the Project
  3. Branches
  4. Commits
  5. Pull Requests
  6. Testing
  7. Source Code Patches
  8. Documentation Patches
  9. Review

Introduction

Please consider our roadmap and open issues when you start contributing to the project.

Before starting your work on Icinga Web 2, you should fork the project to your GitHub account. This allows you to freely experiment with your changes. When your changes are complete, submit a pull request. All pull requests will be reviewed and merged if they suit some general guidelines:

  • Changes are located in a topic branch
  • For new functionality, proper tests are written
  • Changes should follow the existing coding style and standards

Please continue reading in the following sections for a step by step guide.

Fork the Project

Fork the project to your GitHub account and clone the repository:

git clone git@github.com:dnsmichi/icingaweb2.git
cd icingaweb2

Add a new remote upstream with this repository as value.

git remote add upstream https://github.com/icinga/icingaweb2.git

You can pull updates to your fork's master branch:

git fetch --all
git pull upstream HEAD

Please continue to learn about branches.

Branches

Choosing a proper name for a branch helps us identify its purpose and possibly find an associated bug or feature. Generally a branch name should include a topic such as fix or feature followed by a description and an issue number if applicable. Branches should have only changes relevant to a specific issue.

git checkout -b fix/service-template-typo-1234
git checkout -b feature/config-handling-1235

Continue to apply your changes and test them. More details on specific changes:

Commits

Once you've finished your work in a branch, please ensure to commit your changes. A good commit message includes a short topic, additional body and a reference to the issue you wish to solve (if existing).

Fixes:

Fix missing style in detail view

refs #4567

Features:

Add DateTime picker

refs #1234

You can add multiple commits during your journey to finish your patch. Don't worry, you can squash those changes into a single commit later on.

Pull Requests

Once you've committed your changes, please update your local master branch and rebase your fix/feature branch against it before submitting a PR.

git checkout master
git pull upstream HEAD

git checkout fix/style-detail-view
git rebase master

Once you've resolved any conflicts, push the branch to your remote repository. It might be necessary to force push after rebasing - use with care!

New branch:

git push --set-upstream origin fix/style-detail-view

Existing branch:

git push -f origin fix/style-detail-view

You can now either use the hub CLI tool to create a PR, or nagivate to your GitHub repository and create a PR there.

The pull request should again contain a telling subject and a reference with fixes to an existing issue id if any. That allows developers to automatically resolve the issues once your PR gets merged.

hub pull-request

<a telling subject>

fixes #1234

Thanks a lot for your contribution!

Rebase a Branch

If you accidentally sent in a PR which was not rebased against the upstream master, developers might ask you to rebase your PR.

First off, fetch and pull upstream master.

git checkout master
git fetch --all
git pull upstream HEAD

Then change to your working branch and start rebasing it against master:

git checkout fix/style-detail-view
git rebase master

If you are running into a conflict, rebase will stop and ask you to fix the problems.

git status

  both modified: path/to/conflict.php

Edit the file and search for >>>. Fix, build, test and save as needed.

Add the modified file(s) and continue rebasing.

git add path/to/conflict.php
git rebase --continue

Once succeeded ensure to push your changed history remotely.

git push -f origin fix/style-detail-view

If you fear to break things, do the rebase in a backup branch first and later replace your current branch.

git checkout fix/style-detail-view
git checkout -b fix/style-detail-view-rebase

git rebase master

git branch -D fix/style-detail-view
git checkout -b fix/style-detail-view

git push -f origin fix/style-detail-view

Squash Commits

Note:

Be careful with squashing. This might lead to non-recoverable mistakes.

This is for advanced Git users.

Say you want to squash the last 3 commits in your branch into a single one.

Start an interactive (-i) rebase from current HEAD minus three commits (HEAD~3).

git rebase -i HEAD~3

Git opens your preferred editor. pick the commit in the first line, change pick to squash on the other lines.

pick e4bf04e47 Fix style detail view
squash d7b939d99 Tests
squash b37fd5377 Doc updates

Save and let rebase to its job. Then force push the changes to the remote origin.

git push -f origin fix/style-detail-view

Testing

Basic unit test coverage is provided by running icingacli test php unit. The development Vagrant box provides a pre-built environment for development and tests.

Snapshot packages from the laster development branch are available inside the package repository.

You can help test-drive the latest Icinga 2 snapshot packages inside the Icinga 2 Vagrant boxes.

Source Code Patches

Icinga Web 2 is written in PHP and JavaScript.

In order to develop Icinga Web 2 please use the development Vagrant box. You can edit the source code in your local git repository and review changes live from the Vagrant environment.

Documentation Patches

The documentation is written in GitHub flavored Markdown. It is located in the doc/ directory and can be edited with your preferred editor. You can also edit it online on GitHub.

vim doc/02-Installation.md

In order to review and test changes, you can use the doc module in Icinga Web 2. Navigate to Configuration - Modules and enable the doc module. Open Documentation - Icinga Web 2 from the menu.

Review

Pull Request Review

This is only important for developers who will review pull requests. If you want to join the development team, kindly contact us.

  • Ensure that the style guide applies.
  • Verify that the patch fixes a problem or linked issue, if any.
  • Discuss new features with team members.
  • Test the patch in your local dev environment.

If there are changes required, kindly ask for an updated patch.

Once the review is completed, merge the PR via GitHub.

Pull Request Review Fixes

In order to amend the commit message, fix conflicts or add missing changes, you can add your changes to the PR.

A PR is just a pointer to a different Git repository and branch. By default, pull requests allow to push into the repository of the PR creator.

Example for #4956:

At the bottom it says "Add more commits by pushing to the fix/persistent-comments-are-not-persistent branch on TheFlyingCorpse/icinga2."

First off, add the remote repository as additional origin and fetch its content:

git remote add theflyingcorpse https://github.com/TheFlyingCorpse/icinga2
git fetch --all

Checkout the mentioned remote branch into a local branch (Note: theflyingcorpse is the name of the remote):

git checkout theflyingcorpse/fix/persistent-comments-are-not-persistent -b fix/persistent-comments-are-not-persistent

Rebase, amend, squash or add your own commits on top.

Once you are satisfied, push the changes to the remote theflyingcorpse and its branch fix/persistent-comments-are-not-persistent. The syntax here is git push <remote> <localbranch>:<remotebranch>.

git push theflyingcorpse fix/persistent-comments-are-not-persistent:fix/persistent-comments-are-not-persistent

In case you've changed the commit history (rebase, amend, squash), you'll need to force push. Be careful, this can't be reverted!

git push -f theflyingcorpse fix/persistent-comments-are-not-persistent:fix/persistent-comments-are-not-persistent