Commit Graph

56 Commits

Author SHA1 Message Date
Lin Jen-Shin e9598f80a1 Resolve "Fix danger commit messages check" 2019-02-22 11:56:45 +00:00
Mike Lewis 09532e38bd Merge branch 'template-improvements-for-documentation' into 'master'
Template and process improvements for documentation

See merge request gitlab-org/gitlab-ce!24315
2019-02-20 22:43:32 +00:00
Kamil Trzciński d8145aa693 Refactor commit_messages#lint_commit
This introduces additional method for linting,
to reduce the complexity of `lint_commits`.
2019-02-20 14:25:12 +01:00
Kamil Trzciński 9d842c704a Ignore revert commits 2019-02-19 15:05:45 +01:00
Mike Lewis 07c32a0df5 Merge branch 'master' into 'template-improvements-for-documentation'
# Conflicts:
#   .gitlab/merge_request_templates/Documentation.md
2019-02-18 21:38:24 +00:00
Mike Lewis f1645c744f Update Documentation Dangerfile with small wording change 2019-02-18 21:23:25 +00:00
Nick Thomas 324a8fa28e
Fix the documentation Dangerfile 2019-02-18 10:03:46 +00:00
Nick Thomas 9afc4f9d11
Reviewer roulette ignores changelogs 2019-02-14 23:52:30 +00:00
Nick Thomas 77b2ecd2b1
Reviewer roulette via Danger
Make danger pick reviewers and maintainers at random, for feontend,
backend, database, etc, changes, whenever files belonging to those
teams get changed.
2019-02-13 16:41:28 +00:00
Nick Thomas 235fe67bdb
Move the ee? helper method into the helper 2019-02-13 16:30:02 +00:00
Nick Thomas f034a35250
Move change category detection to a helper 2019-02-13 16:30:02 +00:00
Mike Lewis 62f65a6d02 Update Dangerfile per updated Technical Writing review policy 2019-02-11 21:19:06 +00:00
Achilleas Pipinellis 722b849651
Change Monitoring to Monitor in docs dangerfile 2019-01-22 15:39:22 +01:00
Drew Blessing efe7f4f768 Fix Danger commit message errors 2019-01-11 22:22:10 +00:00
Paul Slaughter 193f764bc2
Shorten danger 50 char commit warning
- Also pulls URLs into vars
2019-01-11 07:33:02 -06:00
Rémy Coutable 8f9d9112e6
Only detect short refs followed by \b in Danger
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-01-08 16:37:06 +01:00
George Tsiolis 35eee0b4b0 Update danger for documentation [ci skip]
Rename ~Packaging label to ~Package
2018-12-19 13:51:29 +02:00
Rémy Coutable 9e26728cfe Merge branch '51226-check-yarn-lock' into 'master'
Add danger check for duplicate yarn dependencies

Closes #51226

See merge request gitlab-org/gitlab-ce!21591
2018-12-18 10:42:09 +00:00
Lukas Eipert 243bd56f9d
Add danger check for duplicate yarn dependencies
This danger check utilises `yarn-deduplicate` in order to show duplicate
dependencies in the yarn.lock dependency tree.
Often when introducing new dependencies or updating existing ones, yarn
does not seem to build the most optimal dependency tree.

In order to prevent those unnecessary dependency updates we are nudging
developers and maintainers to resolve these issues in MRs. Automating
this with danger especially helps, as yarn.lock files are not that easy
to review.
2018-12-17 09:58:39 +01:00
Sam Bigelow 0f069485c6 Clarify messaging on what fails for too many failed lines 2018-12-17 06:42:59 +00:00
Jasper Maes 44fef4fe4c Remove rails 4 support in CI, Gemfiles, bin/ and config/ 2018-12-14 19:36:22 +01:00
Marcia Ramos b74e6d64a4 Update docs' Dangerfile 2018-12-06 13:32:17 +00:00
Rémy Coutable c8e8ad325c
Don't request changelog for MR with some labels
Namely the `ci-build` and `meta` labels.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-12-05 10:56:49 +01:00
Achilleas Pipinellis 3ed37f181e
Make the table of tech writers and stages more compact 2018-11-16 19:32:14 +01:00
Achilleas Pipinellis bcb2c6de63
Proper markdown table in docs Dangerfile 2018-11-12 10:09:02 +01:00
Mike Lewis ce9e3b891b Edits to docs Dangerfile 2018-11-09 18:55:27 +00:00
Achilleas Pipinellis 3a38ec323d
Dangerbot: mention tech writers based on DevOps stage 2018-11-09 16:40:45 +01:00
Yorick Peterse edd3e107c6
Warn when MR titles are too long
This adds a Danger check to produce a warning for MR titles greater than
72 characters. This is necessary because when squash on merge is used,
the MR title will be used for the commit message (at least by default).
This in turn leads to commit messages that violate our commit message
guidelines.

For more information, refer to
https://gitlab.com/gitlab-org/release/framework/issues/24.
2018-11-07 15:27:39 +01:00
Sean McGivern 0e616d71fb Also count specs in new files in Danger check
We have a Danger check that warns if you made changes in app/ but not in
spec/. However, this only checked for changed files - not new files. If
you added an app file with no specs, it wouldn't warn; and it would warn
erroneously if you added a missing spec file while changing a file in
app/.
2018-10-23 15:45:05 +01:00
Lukas Eipert 253e1818aa
Create helper to get all changed files
Danger apparently has three different objects which could contain files
you often want to check:

 - git.added_files
 - git.modified_files
 - git.renamed_files

The problem: If a file is renamed, `modified_files` contains the file
path before the rename. In some Danger checks we use `added_files` +
`modified_files`, which might contain the deleted paths of renamed
files, but missing the new paths of renamed files.

So we need to consider `renamed_files` as well.
2018-10-22 11:04:55 +02:00
Lukas Eipert 685d579472
Danger check for ignored eslint rules
We disabled a lot of eslint rules on a per-file basis. This checks
touched files for those and reminds you to re-enable the rules and fix
them.
2018-09-29 08:22:12 +02:00
Lukas Eipert 4df24e5f04
Danger check for unprettified JavaScript
This adds a Dangerfile which executes `prettier` to find out if someone
touched Frontend files and forgot to run it on their current branch.
2018-09-28 22:04:26 +02:00
Yorick Peterse 8e3eb91924
Relax the subject line requirements for commits
This changes the hard limit of 50 to a soft limit of 50, with the new
hard limit being 72 characters. This gives people a bit more space,
while still (hopefully) guiding them towards subject lines that are
roughly 50 characters long.

Fixes https://gitlab.com/gitlab-org/release/framework/issues/16
2018-09-19 15:27:50 +02:00
Yorick Peterse 4ef1dd09dd
Improve Emoji detection in commit messages
This changes our Danger integration so that it is smarter about
detecting GitLab emoji in commit messages. This is done using a two step
process:

1. We use the old regular expression to determine if a commit message
   _might_ include an emoji.

2. If this regular expression matches, we then check for all existing
   emoji names in the commit message. This might be a wee bit expensive,
   but because we couple it with the previous step it should be rarely
   executed.

This ensures we don't trigger an error when a commit message includes
text such as `:foo:bar:`, which is not a valid Emoji.

Fixes https://gitlab.com/gitlab-org/release/framework/issues/15
2018-09-18 16:22:29 +02:00
Robert Speicher 69925767b7 Merge branch 'danger-commit-count' into 'master'
Relax Danger requirements about changed lines

Closes gitlab-org/release/framework#13

See merge request gitlab-org/gitlab-ce!21739
2018-09-14 17:12:47 +00:00
Lukas Eipert 40f8145845 Fix typo in Danger message 2018-09-14 14:01:52 +00:00
Yorick Peterse 42f90b5f50
Relax Danger requirements about changed lines
This relaxes the commit rules regarding the number of changed lines.
Previously we required a detailed description if 20 or more lines were
changed. Starting with this commit we change the rules so Danger only
notifies you about writing a detailed description if:

1. A commit changes more than 3 files
2. The same commit changes more than 30 lines

This should make it easier to do a find replace to fix a typo, without
having to repeat what the subject line already says, while still
reminding developers to write a detailed description for new features
and other larger changes.

Fixes https://gitlab.com/gitlab-org/release/framework/issues/13
2018-09-14 13:55:29 +02:00
Yorick Peterse 28b56b7172
Added Danger file to lint commit messages
This Dangerfile ensures that commit authors write good commit messages.
We also prevent the use of Emoji, since these add no value and may not
always be displayed properly.

Merge commits are currently ignored. In the future we most likely want
to stop using these, but this is a separate discussion, hence we ignore
them for the time being.

The rules enforced by this Dangerfile are based on the article found at
https://chris.beams.io/posts/git-commit/. For more information, refer to
https://gitlab.com/gitlab-org/gitlab-ce/issues/50003.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/50003
2018-09-10 14:12:58 +02:00
Mike Lewis 79322c3c93 Merge branch 'docs/dangerfile' into 'master'
Add Documentation Dangerfile

See merge request gitlab-org/gitlab-ce!21395
2018-09-07 21:18:36 +00:00
Achilleas Pipinellis b1b55371c6
Add Documentation Dangerfile
Every time a doc change is made, a comment to
ping the @gl-docsteam is added.
2018-09-06 10:50:35 +02:00
Sean McGivern 9add8e3a66 Fix wording in Danger warning about MRs to non-master
If it's most of the time, then it's not all.
2018-09-04 09:57:22 +01:00
Winnie Hellmann 705da921ba Drop WIP from changelog command in Danger comment 2018-08-24 20:54:55 +00:00
Rémy Coutable 674882fe5d Merge branch '49631-fix-dangerfile-schema-rb' into 'master'
Resolve "Dangerfile reporting that db/schema.rb wasn't updated"

Closes #49631

See merge request gitlab-org/gitlab-ce!20852
2018-07-26 09:47:40 +00:00
Thong Kuah 8f4745deb4 Fix regexp for detected `db/schema.rb` and `ee/db/geo/schema.rb` 2018-07-26 10:31:45 +12:00
Robert Speicher f5df4976b6
Make the frozen_string Danger check more resilient
It's possible for a Ruby file to be empty and thus `gets` returns `nil`.

Also indents the Markdown since we're using `<<~` and removes an
unneeded variable.
2018-07-25 14:32:44 -07:00
gfyoung db00a9c641 Add Dangerfile for frozen_string_literal
Checks that new Ruby files will enable
frozen string literal.

Partially addresses #47424.
2018-07-24 02:17:45 -07:00
Rémy Coutable 8ce6381f3c
Improve danger/specs/Dangerfile by not requiring new specs if specific labels are applied
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-07-17 09:43:47 +02:00
Rémy Coutable 3e573142b7
Improve danger/changelog/Dangerfile to include the title in the bin/changelog command
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-07-17 09:43:46 +02:00
Gabriel Mazetto 9265e76920 Use the correct exceptions to look for invalid YAML in Changelogs 2018-07-13 05:08:45 +02:00
Stan Hu 209b66fb0d Fix Dangerfile 2018-07-12 01:19:07 -07:00