Commit graph

313 commits

Author SHA1 Message Date
Ika
3c83075fb8 feat: add 'patch' option to automerge (#539)
* feat: add 'patch' option to automerge

* test: add tests for automerge = patch

* docs: add patch option to automerge

* refactor(isAutomergeEnabled): write code verbosely

* feat: export isAutomergeEnabled

* test(isAutomergeEnabled): add tests
2017-07-27 22:17:28 +02:00
Rhys Arkins
984b5a89b8 fix(lerna): Use packages path from lerna.json (#542) 2017-07-27 22:15:50 +02:00
Rhys Arkins
434def2bf4 fix(lerna): Return empty lerna packages if 404 for packages/* (#540) 2017-07-27 14:58:26 +02:00
Rhys Arkins
feffa774d8 feat(lerna): Add lerna support (#535)
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 (#533) 2017-07-26 10:56:11 +02:00
Rhys Arkins
cd2b1193ad fix(github): Use more specific URI when checking branch protection (#532) 2017-07-26 08:19:27 +02:00
Rhys Arkins
c4e8b6bf94 fix(npm): Log correct package name when 404 (#531)
Because we are running Promise.all on package lookups, we were getting some incorrect package names in our log messages.
2017-07-26 08:15:28 +02:00
Rhys Arkins
1eea69f164 fix(github): Gracefully catch 403 response to branch protection (#530) 2017-07-26 06:55:25 +02:00
Rhys Arkins
2331d6e840 feat(branch): Check for rebase if repo branch protection is strict (#527)
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 #524
2017-07-25 18:18:19 +02:00
Rhys Arkins
c22fc69785 fix(branch): Add check before rebasing stale PRs (#526)
We should not rebase stale PRs if they have been edited any anyone. This adds a check from the PR to see if it can be rebased. If no PR then we assume we can - nobody should be editing our branches directly without PR.

Closes #525
2017-07-25 15:07:53 +02:00
Rhys Arkins
beb37bc128 feat(lockFile): Support lockFileMaintenance disabling in env
It’s now possible to set `RENOVATE_LOCK_FILE_MAINTENANCE={}` in env to disable lock file maintenance.

Closes #515
2017-07-24 20:56:15 +02:00
Rhys Arkins
d48ba65528 fix(npm): Pass npm version and logger to getLockFile 2017-07-24 08:38:45 +02:00
Rhys Arkins
9af6117386 fix(lockFiles): Pass NODE_ENV=dev to npm and yarn installs
Without this setting, it can result in an incomplete `package-lock.json` if renovate is run on a system with NODE_ENV=production set.

Fixes #517
2017-07-24 08:10:42 +02:00
Rhys Arkins
2bd452281f fix(npm): Run npm install with —ignore-scripts 2017-07-24 06:54:13 +02:00
Rhys Arkins
cd762c7bc6 fix(onboarding): Don’t hyperlink package name if undefined repository URL 2017-07-23 14:25:37 +02:00
Rhys Arkins
ee2a344013 fix(onboarding): Escape scoped npm repos in PR body
Uses a zero length space
2017-07-23 14:25:13 +02:00
Rhys Arkins
a39a86c6ba fix(yarn): Filter out pure-lockfile option from yarnrc
A repository with .yarnrc specifying pure-lockfile was preventing our yarn from saving a lockfile too! Now filter it out before writing the yarnrc to our tmp directory.

Closes #507
2017-07-21 10:58:11 +02:00
Rhys Arkins
47044a11e1 feat(yarn): Use embedded yarn version (#510)
Renovate now uses an embedded yarn binary. This way, the version of yarn used can be known + there is no requirement for Renovate admins to install yarn separately.
2017-07-21 08:47:05 +02:00
Rhys Arkins
89200842f1 fix(yarn): Add —ignore-scripts when generating yarn.lock
This should avoid us accidentally trying to “build” anything post-install.
2017-07-20 20:24:11 +02:00
Rhys Arkins
27b443c4a1 fix(onboarding): De-duplicate onboarding branch commits (#504)
Now checks in case `renovate.json` content is identical and if so then doesn’t unnecessarily re-commit the same file each run.
2017-07-19 17:47:45 +02:00
Rhys Arkins
cadc148cd0 fix(changelog): Check that err.message exists 2017-07-19 08:46:00 +02:00
Rhys Arkins
30155782f5 chore(logs): Ignore start_time log field 2017-07-19 08:41:09 +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 #498
2017-07-19 08:05:26 +02:00
Rhys Arkins
8e7fe1d37b chore(logger): Reduce some log.warn to debug 2017-07-19 05:55:21 +02:00
Rhys Arkins
475e548e9c feat(versions): Roll back if current version missing/unpublished (#497)
If the current version is not in the version list on the npm registry, we assume it has been unpublished and we raise a roll back PR.

Closes #493
2017-07-18 20:01:00 +02:00
Rhys Arkins
8f3f624c22 refactor(npm): Don’t warn twice in logs for dep lookup
Closes #496
2017-07-18 16:33:54 +02:00
Rhys Arkins
8666835bc8 fix(repository): Ignore uninitiated repositories
Closes #379
2017-07-18 14:31:48 +02:00
Rhys Arkins
f6980b51f2 fix(cleanup): Add pr exists check 2017-07-18 07:48:24 +02:00
Rhys Arkins
4eb20e0e57 refactor(repositoryWorker): Separate token from config 2017-07-18 07:41:19 +02:00
Rhys Arkins
e41c44ea77 fix(prBody): Update PR body link 2017-07-18 07:33:37 +02:00
Rhys Arkins
fdaa88efb1 feat(cleanup): Add specific lock file maintenance cleanup
Now cleans up lock file maintenance branch - which is usually scheduled - if it has become unmergeable or pointless.
2017-07-17 16:13:59 +02:00
Rhys Arkins
c73a6c3ce6 fix(cleanup): Call cleanup only once 2017-07-17 16:00:48 +02:00
Rhys Arkins
d59911127b fix(lockFileMaintenance): Add missing await to branchExists
A call to api.branchExists() was missing an await, as a result we were causing errors when yarn lock maintenance had no files to commit.
2017-07-17 15:33:16 +02:00
Rhys Arkins
73df88c473 fix(pr): Prevent accidental hyperlinks in PR body (#490)
GitHub incorrect assumes these #12345 issue numbers refer to the *local* repo, not the source. Adding ` ` should prevent that auto-hyperlinking.

Closes #489
2017-07-16 18:37:17 +02:00
Rhys Arkins
5f02c91823 refactor(config): Warn instead of error when no repositories found 2017-07-15 06:47:20 +02:00
Rhys Arkins
95f7eab826 feat(onboarding): simplify default config (#486)
Onboarding PRs now include much less default configuration options than before.

Closes #484
2017-07-14 07:34:01 +02:00
Rhys Arkins
192c9b998c feat(config): mergeable depTypes (#485) 2017-07-13 22:18:24 +02:00
Rhys Arkins
b10bcecade fix(groups): Assign a groupName to lockFileMaintenance to prevent unwanted grouping
Previously, when someone declared a repository groupName such as “All”, it resulted in lock file maintenance updates being grouped together as well. This is undesirable, especially if the All group then inherits the lock file maintenance schedule.

Fixes #483
2017-07-13 13:37:06 +02:00
Rhys Arkins
64e91eed0f fix(github): Hyperlink issues on GitHub only if private repo (#479)
Adding hyperlinks to all #12345 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 #478
2017-07-09 15:13:03 +02:00
Rhys Arkins
93b13b55db feat(onboarding): Allow branch cleanup after onboarding (#477)
Refactored location of branch cleanup so that it can be run even if onboarding is enabled.
This means someone can “undo” a closed Configure Renovate and all other PRs would get cleaned up.
2017-07-09 05:35:41 +02:00
Rhys Arkins
b55ba07b47 feat(repository): Ignore package files discovered inside node_modules
Renovate will now ignore any package.json files found within node_modules folders, with the option to disable this functionality by setting config.ignoreNodeModules=false.
2017-07-08 07:00:58 +02:00
Rhys Arkins
7a841de7e6 feat(onboarding): dependencies.pinVersions=true for private repos (#475)
Closes #369
2017-07-08 06:01:02 +02:00
Rhys Arkins
3fa4d9236e refactor(workers): Rename core function names for readability 2017-07-07 19:44:49 +02:00
Rhys Arkins
1395187ccc feat(npm): Support packagelock.json maintenance (#471)
Renovate will now "maintain" npm@5's `package-lock.json` files on the same schedule as existing `yarn.lock` maintenance.

Closes #470
2017-07-07 13:57:43 +02:00
Rhys Arkins
4897d2721f fix(onboarding): fix typo in description 2017-07-07 12:53:24 +02:00
Rhys Arkins
6bd74c979d refactor: send config to ensurePr 2017-07-07 12:37:33 +02:00
Rhys Arkins
0e00dc3f83 fix(templates): Set semanticPrefix for Pin Dependencies 2017-07-07 11:16:03 +02:00
Rhys Arkins
d8a054410b feat(onboarding): Allow update of renovate.json if it’s unmodified (#469)
This allows for improvements to renovate’s default renovate.json to be passed on to users who haven’t merged or modified their Configure Renovate PR.

Closes #465
2017-07-07 11:09:52 +02:00
Rhys Arkins
fd33996f0f refactor(onboarding): Update onboarding description (#468)
Better describe renovate.json and if/when it needs to be added.
2017-07-07 09:53:22 +02:00
Rhys Arkins
06504b4abe feat(onboarding): conventional commits detection (#463)
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 #462
2017-07-07 07:54:09 +02:00
Rhys Arkins
04e20dce8e feat: Prune all orphan branches (#461)
Schedule logic has been refactored to enable the pruning of all orphan branches. 
Now, schedules aren't checked at package-time, instead package upgrades are queued regardless of schedule. 
At branch time, it is checked whether the *branch* is scheduled and then the branch is not created/updated if it's off-schedule.
This enables the repository worker to know all possible branches and hence be able to determine which remaining branches in the repository are "orphans" to be deleted.

Closes #428, Closes #426
2017-07-07 06:25:38 +02:00
Rhys Arkins
eb468341c4 fix: Don’t stringify options body for PR labels (#460)
This has been broken since the upgrade to got 7.x

Closes #456
2017-07-06 19:24:09 +02:00
Rhys Arkins
0ee24ebadf refactor: Use (deps) in semantic prefix defaults (#458)
Closes #417
2017-07-06 14:39:50 +02:00
Rhys Arkins
44de0886a0 feat: Skip schedules when onboarding (#456)
All PRs/branches will be shown in onboarding even if they have been scheduled for another day or time, providing a "full view" in the onboarding.

Closes #429
2017-07-06 14:31:39 +02:00
Rhys Arkins
997c4efac2 feat: baseBranch onboarding (#453)
baseBranch is now used when computing the onboarding description in 'Configure Renovate' PR.
2017-07-06 14:12:52 +02:00
Rhys Arkins
3f35ba73d0 feat: Detect duplicate keys in renovate.json (#455)
Closes #450
2017-07-06 14:09:35 +02:00
Rhys Arkins
80e4fd91fc fix: Use res.upgrades when returning from branchify 2017-07-06 11:05:03 +02:00
Rhys Arkins
1122f76e98 fix: branchifyUpgrades should return an object (#451) 2017-07-06 10:59:25 +02:00
Rhys Arkins
48c960b841 refactor: Move generateConfig code from branchWorker to repositoryWorker (#449)
This allows the onboarding PR to share the grouping logic and not have to duplicate it.
2017-07-06 10:35:27 +02:00
Rhys Arkins
dc5773c2e5 feat: Configurable base branch for PRs (#448)
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 #443
2017-07-06 10:26:18 +02:00
Rhys Arkins
ea4e370d3f feat: Prune stale branches (#441)
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 #426, Closes #428
2017-07-05 11:57:22 +02:00
Rhys Arkins
5c34b74b08 feat: Show schedules in PRs (#439)
Closes #425
2017-07-05 08:09:35 +02:00
Rhys Arkins
1716e122cd feat: expand PR errors (#437)
Errors in PRs are expanded to include:
- If renovate.json parsing fails
- If an empty or unparseable package.json was found

Closes #435
2017-07-05 07:12:25 +02:00
Rhys Arkins
c30472dd43 feat: Add ability to skip status checks for automerge (#438)
This starts off [#359](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 (#436)
* fix: Detect undefined commit.author

Closes #409

* refactor author check

* Add debug

* Update test
2017-07-04 19:22:09 +02:00
Rhys Arkins
116a330eef fix: close if tag in group.prBody template 2017-07-04 14:29:18 +02:00
Rhys Arkins
e0e0b259c3 feat: Show warnings and errors in regular PRs (#433)
If errors or warnings are present, they will be displayed in the PR body of all PRs now (not just onboarding).

Closes #431
2017-07-04 13:52:23 +02:00
Rhys Arkins
2f987a4037 feat: Show warnings and errors in Onboarding PR (#432)
Warnings and Errors are bubbled up when renovating a repository, together with the existing upgrades. The Onboarding PR ("Configure Renovate") now displays them and encourages the user to fix before merging/closing the PR.

Closes #414
2017-07-04 12:39:28 +02:00
Rhys Arkins
4272b113d2 refactor: configuration options and update docs (#423) 2017-07-03 11:34:46 +02:00
Rhys Arkins
f2833c8275 refactor: Add 'package' stage to config definitions (#421)
* Add package phase

* Rename phase to stage
2017-07-03 10:31:36 +02:00
Rhys Arkins
faa754d136 Use NPM_TOKEN for registry lookup 2017-07-02 20:52:31 +02:00
Rhys Arkins
b67b3087e5 refactor: rename option.level to option.phase 2017-07-02 09:15:33 +02:00
Rhys Arkins
1cf8330125 fix: group branchName handlebars error
Closes #410
2017-07-02 07:50:46 +02:00
Rhys Arkins
c608ac2e46 refactor: rename branchWorker.updateBranch -> processBranchUpgrades 2017-07-02 06:44:49 +02:00
Rhys Arkins
b58452620a refactor: rename groupUpgradesByBranch to branchifyUpgrades 2017-07-02 06:40:40 +02:00
Rhys Arkins
3ec668225a fix: use new config for pin.group.prTitle 2017-07-02 06:38:59 +02:00
Rhys Arkins
82357d81bd refactor: logger.trace configs 2017-07-02 06:35:53 +02:00
Rhys Arkins
c4dcad7de8 chore: squash template fields in config log serializer 2017-07-02 06:32:52 +02:00
Rhys Arkins
372b445260 refactor: set recreateClosed in group and lockFileMaintenance 2017-07-02 06:25:42 +02:00
Rhys Arkins
8dc7e47526 fix: relative lib require in config definitions 2017-07-02 06:18:07 +02:00
Rhys Arkins
3d9cd11611 refactor: change group config structure
This changes how group are configured to align with the new lock file configuration.

BREAKING CHANGE: old group* template options are no longer supported but can be migrated into group object
2017-07-01 06:49:32 +02:00
Rhys Arkins
6f49927a45 feat: schedule support for lock file maintenance
This feature now allows a custom schedule to be defined for lock file maintenance. It is now enabled by default but runs only before 5m on Sundays. Closes #399

BREAKING CHANGE: lock file maintenance is enabled by default.
Rules will apply to both yarn and npm (npm is yet to be implemented however). Existing mainainYarn* variables are removed and replaced by new lockFileMaintenance object.
2017-07-01 06:46:11 +02:00
Rhys Arkins
3a68dafab2 fix: drop packageFile.fileName support
No longer massages packageFile.fileName -> packageFile.packageFile

BREAKING CHANGE: “fileName” notation no longer supported
2017-07-01 06:42:12 +02:00
Rhys Arkins
9209982b6d fix: drop preformatted changelog
No longer supporting preformatted (markdown) changelog input for templates.

BREAKING CHANGE: Preformatted {{changeloge}} no longer supported in PR body template.
Generate changelog using handlebars as in the default templtaes.
2017-07-01 06:40:37 +02:00
Rhys Arkins
45c3124a8f feat: support "enabled" config option at all configuration levels 2017-06-30 16:04:23 +02:00
Rhys Arkins
6664110c29 feat: schedules (#397)
This PR adds a scheduling feature, including timezone support.
It's described in detail in the FAQ, but the summary is:

*   Timezones can be defined so that schedules are written in timezone of target repository
*   Schedules can be written in "plain english"
*   Multiple schedules allowed
*   Schedules can be defined all the way down to package level

Closes #387
2017-06-30 14:04:46 +02:00
Rhys Arkins
0ac3625e4f fix: more semanticCommitsEnabled -> semanticCommits 2017-06-30 06:04:15 +02:00
Rhys Arkins
01df41086b fix: semanticCommitsEnabled -> semanticCommits 2017-06-30 06:01:50 +02:00
Rhys Arkins
4c79dae98c feat: semantic commit support (#389)
Defaults to disabled. Included in onboarding.

Closes #303
2017-06-29 19:50:26 +02:00
Rhys Arkins
87967b4945 fix: Onboarding config should use repo config, not defaults (#386) 2017-06-29 15:38:18 +02:00
Rhys Arkins
552b5e68c5 Refactor helpers (#382)
* 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
742060c8b5 Improve npm and yarn lock error messages (#380)
Closes #375 

* Detect versions at startup

* Add meaningful error messages when problems with npm or yarn

* Test helpers

* Test global versions
2017-06-28 22:33:27 +02:00
Rhys Arkins
fe82c7ad7c Skip repositories with no package.json (#378)
* Skip repositories with no package.json

Closes #376

* Fix await

* Refactor file file check

* Update tests
2017-06-28 19:37:08 +02:00
Rhys Arkins
698a63ad32 Fetch multiple pages from gitlab projects api endpoint (#377)
Fixes #371
2017-06-28 15:01:05 +02:00
Rhys Arkins
c459ba66d6 Fix rebasing logic (#372)
* 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
a8da588f13 Don’t warn if currentVersion is a known tag
Closes #333
2017-06-28 12:45:18 +02:00
Rhys Arkins
8bc3c00c32 Fix onboarded branchName 2017-06-28 12:35:07 +02:00
Rhys Arkins
9e5eb58b74 Remove duplicate log message 2017-06-28 12:33:58 +02:00
renovate[bot]
5a9a66bd2b Update dependency prettier to version 1.5.2 (#365)
* Update dependency prettier to version 1.5.2

* lint fix
2017-06-28 12:23:57 +02:00
Rhys Arkins
285c977cf7 Use package.json renovate config when onboarding (#370)
* Store repoIsOnboarded in config

* Use package file renovate config for onboarding

Closes #368
2017-06-28 12:16:25 +02:00