Commit graph

87 commits

Author SHA1 Message Date
renovate[bot]
cfc6c5ccdf fix: update dependency eslint-config-airbnb-base to v12 ()
* chore(deps): update dependency eslint-config-airbnb-base to v12.0.0

* fix lint
2017-09-15 19:46:25 +02:00
Rhys Arkins
d765b34c33 feat: renovate meteor package.js dependencies ()
This feature adds support for renovating Meteor's `package.js` files. Meteor config is disabled by default so must be manually enabled to work. If enabled, Renovate uses GitHub's search API to look for any files named `package.js` that include the text `Npm.depends`. If so then the file is parsed using Regex to extract its dependencies and check them for updates.

Closes 
2017-09-12 09:33:41 +02:00
Rhys Arkins
8086a4eb79 fix: remove black-cat header from github reviewers api () 2017-09-08 11:19:59 +02:00
Rhys Arkins
5f708c2297 fix: do not restart renovation if automerging failed () 2017-08-31 07:15:53 +02:00
Rhys Arkins
deac76b015 feat: support timeout for pr creation = not-pending ()
We should not leave the PR unopened forever if the branch remains in not-pending state too long. Some status checks may leave the status as “pending” instead of “failed”. Defaults to 12 hours but is configurable.

Closes 
2017-08-28 11:37:09 +02:00
Rhys Arkins
d98130f50e fix: support pagination for file search () 2017-08-26 22:15:22 +02:00
Rhys Arkins
a43e436a84 logs: add pr to merge fail message () 2017-08-24 12:00:38 +02:00
Rhys Arkins
71c49ecd77 fix: separate gh-got-retry to separate file () 2017-08-20 09:49:39 +02:00
Rhys Arkins
e649d49615 fix: retry after github abuse trigger () 2017-08-19 11:46:30 +02:00
Rhys Arkins
117316c0b1 fix: check current status check before setting ()
Fixes 
2017-08-08 23:03:52 +02:00
Rhys Arkins
b369f670d6 fix: use baseBranch when branchName is null ()
Using fallback in function params only replaces if branchName is undefined but we also need to handle when it is `null`.
2017-08-07 10:51:17 +02:00
Rhys Arkins
d7a6bbe367 feat: unpublish-safe status check ()
Renovate now adds a status check renovate/unpublish-safe that has the following behaviour:
If any upgrade in the branch is < 24 hours old then the status check state is "pending"
If all upgrades in the branch are 24 hours or more old then the status check state is "success"
This is able to be disabled via a new option "unpublishSafe".

Closes 
2017-08-06 15:38:10 +02:00
Rhys Arkins
cb3c4ece38 refactor: improve github retry logic ()
5 retries
use settimeout
retry on any 5xx error code
2017-08-04 18:13:49 +02:00
Rhys Arkins
6a7f57165f fix: add loki-preview headers to repository query ()
Should enable merge settings to be shown during initRepo
2017-08-04 14:51:21 +02:00
Rhys Arkins
134065c7c7 refactor: use branch prefix in templates ()
This allows for the easy overriding of our default `renovate/` branch naming.

Closes 
2017-08-04 08:32:22 +02:00
Rhys Arkins
f7db11c9d7 fix: Downgrade merge failure to warning () 2017-08-02 07:16:31 +02:00
Rhys Arkins
75b0bdc322 fix: Fix merge debug message () 2017-08-01 13:31:27 +02:00
Rhys Arkins
8fc97af5c7 feat: Ignore forked repositories unless already configured ()
This feature is particularly useful in the case that renovate is enabled on all repositories a user/account has. Many of those might be forks, and it makes no sense to renovate those by default. Instead, Renovate will skip over forked repositories unless a renovate.json has been added to their root.
Also, Renovate will now prune branches after deciding to skip a repository, whether because of a fork or disablement.

Closes 
2017-07-30 22:59:53 +02:00
Rhys Arkins
603f63af4d fix: Retry github API when 502 error ()
The GitHub API will now retry up to 3 times before giving up, if it is receiving a 502 Bad Gateway response.
2017-07-30 11:06:15 +02:00
Rhys Arkins
8aafdaf182 refactor: Use promise.reject to simulate non-200 responses in github tests () 2017-07-30 08:20:19 +02:00
Rhys Arkins
feffa774d8 feat(lerna): Add lerna support ()
If a `lerna.json` is present in the root of the repository, then Renovate will automatically ignore (i.e. not renovate) all package names found in the `packages/*` path. It does not require an explicit configuration to work.
2017-07-27 09:36:36 +02:00
Rhys Arkins
f866f54a14 fix(github): Return repoForceRebase to main config () 2017-07-26 10:56:11 +02:00
Rhys Arkins
cd2b1193ad fix(github): Use more specific URI when checking branch protection () 2017-07-26 08:19:27 +02:00
Rhys Arkins
1eea69f164 fix(github): Gracefully catch 403 response to branch protection () 2017-07-26 06:55:25 +02:00
Rhys Arkins
2331d6e840 feat(branch): Check for rebase if repo branch protection is strict ()
We now check branch protection configuration for the repository's base branch to see if branches must be kept up-to-date. If so then we check Renovate branches for rebasing even if rebaseStalePrs is not set to true.

Closes 
2017-07-25 18:18:19 +02:00
Rhys Arkins
8e48d97392 feat(logs): Support custom log detail fields
This removes the need to JSON.stringify() objects in logs. Default bunyan fields plus our custom meta fields are stripped out, and everything else is stringified in the details field.

Closes 
2017-07-19 08:05:26 +02:00
Rhys Arkins
8666835bc8 fix(repository): Ignore uninitiated repositories
Closes 
2017-07-18 14:31:48 +02:00
Rhys Arkins
64e91eed0f fix(github): Hyperlink issues on GitHub only if private repo ()
Adding hyperlinks to all  issues/PRs in upstream dependencies causes undesirable noise for maintainers of those repositories.
Now, such hyperlinking is done only for private repos as that won’t result in the same GitHub annotations.

Closes 
2017-07-09 15:13:03 +02:00
Rhys Arkins
06504b4abe feat(onboarding): conventional commits detection ()
When onboarding, retrieve the most recent commits from the repository and use https://github.com/conventional-changelog/conventional-commits-detector to parse the commit messages to detect if any conventional commit approach is being used.

Closes 
2017-07-07 07:54:09 +02:00
Rhys Arkins
eb468341c4 fix: Don’t stringify options body for PR labels ()
This has been broken since the upgrade to got 7.x

Closes 
2017-07-06 19:24:09 +02:00
Rhys Arkins
997c4efac2 feat: baseBranch onboarding ()
baseBranch is now used when computing the onboarding description in 'Configure Renovate' PR.
2017-07-06 14:12:52 +02:00
Rhys Arkins
dc5773c2e5 feat: Configurable base branch for PRs ()
Collaborator
rarkins commented 14 hours ago
Base branch for Pull Requests is now configurable via a new baseBranch configuration option. To take effect, this much be present in the default branch (e.g. master in most cases) so that it can be discovered and used. See FAQ for more details.

Closes 
2017-07-06 10:26:18 +02:00
Rhys Arkins
ea4e370d3f feat: Prune stale branches ()
A separate routine is run after branch creation to detect any branches that should be deleted. A branch will be removed if:
- It was not created by renovate in the last run, AND
- It has no PR, or its corresponding PR is not mergeable

Closes , Closes 
2017-07-05 11:57:22 +02:00
Rhys Arkins
c30472dd43 feat: Add ability to skip status checks for automerge ()
This starts off [](https://github.com/singapore/renovate/issues/359) (configurable status checks) but only implements one sub-feature of it: disabling status checks to allow automerge if tests fail or if no tests are present.
2017-07-05 07:02:25 +02:00
Rhys Arkins
6034159909 Fix: add extra check for commit author ()
* fix: Detect undefined commit.author

Closes 

* refactor author check

* Add debug

* Update test
2017-07-04 19:22:09 +02:00
Rhys Arkins
552b5e68c5 Refactor helpers ()
* Move yarn and npm helpers into branch worker

* Fix name

* Move package-json helper

* Update name

* Move changelog

* Move github-app

* Remove unused platform

* Move logger

* Fix lint
2017-06-29 07:29:41 +02:00
Rhys Arkins
fe82c7ad7c Skip repositories with no package.json ()
* Skip repositories with no package.json

Closes 

* Fix await

* Refactor file file check

* Update tests
2017-06-28 19:37:08 +02:00
Rhys Arkins
c459ba66d6 Fix rebasing logic ()
* Add debug messages to API

* Fix rebase logic

* Fix tests

* Simplify logic

* Update branch.spec.js
2017-06-28 13:20:31 +02:00
Rhys Arkins
085e0ed3e4 Return default package.json if GitHub api finds no files 2017-06-28 11:39:51 +02:00
Rhys Arkins
463d2fc39d Refactor worker code ()
* Move package-file worker

* rename to renovatePackageFile

* Move packageJson

* Add getDepTypeConfig

* Add

* Revert "Add"

This reverts commit d034e6149a.

* Refactor versions

* rename findPackageFileUpgrades

* rename versions

* packageWorker

* Refactor promises

* move snapshots

* Rename

* Refactor versions

* Refactor

* Finish package worker

* Major refactor

* Remove worker tests

* package/versions

* Finish packageWorker tests

* package-json test

* Finish dep-type tests

* Add back package-json helper test

* Refactor package-file

* Add back branch and pr

* Add back remaining worker tests

* update tests

* remove snapshot

* Fix dep-type coverage

* Remove old tests

* Coverage
2017-06-27 13:44:03 +02:00
Rhys Arkins
19f4b3b0bc Refactor repository worker ()
* Move to subdir

* Downgrade eslint to 3

* Refactor api and config usage

* Refactor mergeRenovateJson

* Test mergeRenovateJson

* getOnboardingStatus tests

* Refactor repository structure

* Refactor config.logger

* Revert "Refactor config.logger"

This reverts commit 6d7f81af6e.

* Refactor repository logging

* Refactor try/catch

* Refactor platform and onboarding

* Refactor setNpmrc

* Fix github logger

* npm api use config.logger

* Refactor repo worker logger

* Refactor repo worker

* Refactor branched upgrades

* Repository refactoring

* Move some debug logging to trace

* Deprecate fileName

* Refactor upgrades

* Refactor repository logs

* More repository log refactoring

* Refactor repository location

* Revert "Refactor repository location"

This reverts commit faecbf2951.

* Fix tests

* mergeRenovateJson

* Recombine repository worker

* Add initApis tests

* add detectPackageFiles tests

* Add determineRepoUpgrades tests

* start groupUpgradesByBranch tests

* add test

* add test

* Finish groupUpgradesByBranch coverage

* Test updateBranchesSequentially

* Finish repo coverage

* Finish branch worker coverage

* Finish workers coverage

* Fix isPin

* Complete workers coverage

* Finish helpers coverage

* Add gitlab api tests

* getBranchStatus tests

* test createPr

* start getPr testing

* getPr

* update and merge PR tests

* getFile

* getFileContent tests

* getFileJson tests

* createFile

* updateFile

* createBranch

* commitFilesToBranch

* update yarn

* Update yarn
2017-06-25 07:36:13 +02:00
Rhys Arkins
10622a1811 Refactor to enable log context ()
Closes  

* Install traverse

* Scrub api and logger in stringify config

* Use stringifyConfig

* Ignore logs

* Add meta to CLI logs

* Refactor repo structure

* rename repoWorker

* renamed worker

* Refactor logger location

* Refactor main worker

* Refactor getRepoConfig

* Refactor err

* Refactor repo logger

* Add config serializer and logger

* Refactor redact

* Remove stringifyConfig

* Refactor onboarding

* Set packageFile logger

* Refactor package file logic

* branch and pr logging

* Improve log context

* Fix tests part 1

* more test fixes

* Fix github init

* All tests passing

* Rename cli helper

* Refactor logger

* Add logger tests

* Add config serializer tests

* Add configParser tests

* Fix package file tests

* Expand package-file tests

* Use defaultConfig

* Add package-file tests

* Refactor

* Finish package-file tests
2017-06-22 09:03:36 +02:00
Rhys Arkins
34421a3837 Replace winston logging with bunyan ()
Closes  

* Install bunyan

* Set log level for jest

* Replace winston requires with relative logger require

* Add cliHelper

* Strip unused

* Trim unused and update colors

* Update log messages

* Enable dynamic log level

* Update cli.js
2017-06-20 17:57:04 +02:00
Rhys Arkins
112ff0b410 Support branch automerging ()
Add support for automerging without PR, Closes  

* update definitions and docs


* Add mergeBranch api

* support merge commit

* set automergeType

* Update API

* Refactor merge commit

* branch-push working

* Refactor branch

* Add back base tree

* Fix failing tests

* Update definitions and docs

* Fix automerge logic

* Test isBranchStale

* start mergeBranch test

* test mergeBranch branch-push throws

* more tests

* test unknown commit type

* pr tests

* Detect automerge in versions helper

* update tests for new automergeEnabled flag

* refactor pr logic

* complete pr worker tests

* branch automerge tests

* Update docs

* refactor branch automerge check
2017-06-08 06:18:21 +02:00
Rhys Arkins
d293143475 Fix github api base branch update ()
* Update base commit SHA after merge

* drop unnecessary getcommittree
2017-06-07 15:42:20 +02:00
Rhys Arkins
db031e7361 Revert "Update base SHA after merge PR ()" ()
This reverts commit 981d446cb0.
2017-06-07 14:42:54 +02:00
Rhys Arkins
981d446cb0 Update base SHA after merge PR () 2017-06-07 14:39:17 +02:00
Rhys Arkins
25a83d829f Fix baseBranch/defaultBranch in github api () 2017-06-07 14:38:20 +02:00
Rhys Arkins
a50e65e143 Add robustness to package.json parsing ()
* Add robustness to package.json parsing

* Add tests
2017-06-04 08:06:40 +02:00
Rhys Arkins
edade684e6 Support lazy grouping ()
Closes 
2017-06-03 15:27:11 +02:00