Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !1769

[WIP] add danger module and dangerfile

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/camacho/danger into master Mar 08, 2017
  • Overview 4
  • Commits 1
  • Pipelines 0
  • Changes 3

Created by: camacho

This PR adds in Danger to help with cultural rules.

What is Danger?

Danger runs during your CI process, and gives teams the chance to automate common code review chores.

This provides another logical step in your build, through this Danger can help lint your rote tasks in daily code review.

You can use Danger to codify your teams norms. Leaving humans to think about harder problems.

She does this by leaving messages inside your PRs based on rules that you create with the Ruby scripting language.

Over time, as rules are adhered to, the message is amended to reflect the current state of the code review.

What can danger do?

I borrowed some of the cultural rules from Jest's dangerfile, but I believe there are probably a handful of additional rules (like making sure a PR is tagged with a label) that would be helpful. Danger does not enforce any rules, it just provides a mechanism to communicate information via the PR, as well as data about the PR and the files affected (via git).

Some examples of the types of rules Danger can help with:

  • Ensure new files follow a naming convention
  • Ensure new files have @flow turned on
  • Ensure new JS files have corresponding new test files
  • Ensure PR messages follow a format or provide certain information
  • Ensure an individual is assigned to review the PR
  • Ensure the PR title follows a format
  • Ensure the changelog is updated
  • Ensure yarn.lock is updated when package.json is updated

To Do:

  • Add danger npm
  • Add dangerfile
  • Add DANGER_GITHUB_API_TOKEN env var to CI
  • Add npm run danger task to be run on CI

cc/ @orta

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/camacho/danger