Commit graph

1849 commits

Author SHA1 Message Date
Ayoub Kaanich
ec53ef78e9 refactor: lookup use versioning wrapper 2018-06-03 18:08:32 +02:00
Rhys Arkins
0523a6ef99 refactor: simplify filterVersions 2018-06-03 16:45:34 +02:00
Rhys Arkins
527c355b48
refactor: move getRangeStrategy to manager (#2072) 2018-06-03 14:25:05 +02:00
Rhys Arkins
dd09707c20 refactor: default versionScheme to ‘semver’ 2018-06-03 07:43:09 +02:00
Rhys Arkins
5a8c9f57f6 logs: info not warn for no rollback 2018-06-01 17:51:14 +02:00
Rhys Arkins
784a0598b9 refactor: use options for github datasource 2018-06-01 15:32:17 +02:00
Rhys Arkins
bc7728f1d2 refactor: use purl.parse 2018-06-01 14:48:49 +02:00
Rhys Arkins
d02914fd3b tests: update test for repositoryUrl 2018-06-01 10:11:42 +02:00
Rhys Arkins
e39cc9a584
feat: use purl for package lookups (#2041) 2018-06-01 09:02:51 +02:00
Rhys Arkins
54e4733ca5 refactor: fetch return if skipReason present 2018-05-31 21:02:07 +02:00
Rhys Arkins
d6132ff634 fix: flatten only if updates are present 2018-05-31 20:53:29 +02:00
Rhys Arkins
a8bcd004dd logs: fix fileCount 2018-05-31 13:07:09 +02:00
Rhys Arkins
d71639bbf8 refactor: fetch array or object 2018-05-29 10:27:41 +02:00
Rhys Arkins
7b149df595 logs: less debug 2018-05-28 22:25:33 +02:00
Rhys Arkins
2610015467 fix: abort repository when lockfile error 2018-05-24 16:28:36 +02:00
Rhys Arkins
d45f957cfd refactor: defer isX upgrade classifications 2018-05-21 17:20:41 +02:00
Rhys Arkins
2f1e1a979a fix: Revert "feat: permission check in initRepo (#1983)"
This reverts commit 09978ae8dd.
2018-05-19 09:15:10 +02:00
Dragomir Țurcanu
09978ae8dd feat: permission check in initRepo (#1983)
Added permission checking on `initRepo` which, in case of an error, throws a clear message (`The token doesn't have the write permissions to the repository`)

Closes #509
2018-05-19 08:33:41 +02:00
Rhys Arkins
7f4cb4aa57
feat: rangeStrategy (#1954)
This PR replaces the existing `pinVersions`, `upgradeInRange` and `versionStrategy` settings with a single one: `rangeStrategy`.

Previously:
 - `pinVersions` could be `true` or `false`, but defaulted to `null`, which meant that Renovate would decide. `true` meant that Renovate would replace existing ranges like `^1.0.0` with an exact/pinned version such as `1.2.0`.
 - `upgradeInRange` could be true or false, default to false. If `true`, it would mean Renovate would replace an existing range like `^1.0.0` with something like `^1.2.0`
 - `versionStrategy` could be `replace` or `widen` and was mainly used for `peerDependencies` to widen existing ranges, e.g. from `^1.0.0` to `^1.0.0 || ^2.0.0`

It was possible to set conflicting settings, e.g. configuring `pinVersions=true` and `upgradeInRange=true`.

Now, we combine them into a single setting: `rangeStrategy`:
 - `auto` = Renovate decides (this will be done on a manager-by-manager basis)
 - `pin` = convert ranges to exact versions
 - `bump` = same as `upgradeInRange` previously, e.g. bump the range even if the new version satisifies the existing range
 - `replace` = Same as pinVersions === false && upgradeInRange === false, i.e. only replace the range if the new version falls outside it
 - `widen` = Same as previous versionStrategy==='widen'
2018-05-17 07:16:13 +02:00
Rhys Arkins
407b302cfe logs: info not warn for no packageFile content 2018-05-16 08:50:30 +02:00
Rhys Arkins
791f31b9ac fix: handle null content returned for package file 2018-05-16 06:37:26 +02:00
Rhys Arkins
4f5896c908 refactor: monorepo -> internal-package 2018-05-15 13:46:41 +02:00
Rhys Arkins
409cd4adde refactor: monorepoPackages -> internalPackages 2018-05-15 07:21:10 +02:00
Rhys Arkins
2b2b1d92ab logs: packageFiles -> config 2018-05-14 07:56:17 +02:00
Rhys Arkins
69b264cf01 fix(npm): don’t read npmrc files if ignoreNpmrcFiles=true 2018-05-13 23:06:27 +02:00
Rhys Arkins
ebe9607d79 fix(npm): npmrc/ignoreNpmrc logic 2018-05-13 22:04:06 +02:00
Rhys Arkins
49bbcd48e8 fix(onboarding): rebase existing content
# Conflicts:
#	lib/workers/repository/onboarding/branch/rebase.js
2018-05-13 14:43:07 +02:00
Rhys Arkins
8ca30e5b92 fix: use getBranchPr not findPr for onboarding
This allows for the case where the user renames the PR.
2018-05-11 17:59:30 +02:00
Rhys Arkins
6f583ab0e6 fix(presets): set npmrc after first decrypt
In case the renovate config has a npmrc in it that is used to decrypt a preset.
2018-05-11 15:43:14 +02:00
Rhys Arkins
680a0bc193 fix: don’t fetch .npmrc in initApis
It will be fetched if there is a package.json anyway
2018-05-10 21:03:25 +02:00
Rhys Arkins
eccef72b52 fix(npm): restore autodetect pinVersions 2018-05-09 18:17:11 +02:00
Rhys Arkins
4791742060 fix: close configuration issue 2018-05-09 18:03:48 +02:00
Rhys Arkins
3989d47f76 fix: re-enable semantic commit detection 2018-05-09 14:38:17 +02:00
Rhys Arkins
407f8fc576 refactor: drop key after decrypt 2018-05-09 13:43:23 +02:00
Rhys Arkins
43ac21778f logs: decrease debugging 2018-05-09 13:31:04 +02:00
Rhys Arkins
66804bf211 logs: drop excessive debug 2018-05-09 13:26:16 +02:00
Rhys Arkins
d75a220008 fix: filter out disabled updates 2018-05-09 11:37:35 +02:00
Rhys Arkins
9fe651bca9 logs: drop unnecessary flatten debugs 2018-05-09 10:14:35 +02:00
Rhys Arkins
ecdcd9df4f
feat: refactor dependency extraction (#1912)
Rewrite of dependency extraction, particularly for npm. Paves way for easier addition of new package managers.

Closes #1882
2018-05-09 08:03:59 +02:00
Rhys Arkins
9ffd0abda1 refactor: replace stringify/parse with fast-clone 2018-05-07 21:50:40 +02:00
Rhys Arkins
812fe227b8 fix(onboarding): adjust packageFiles check when filtering 2018-05-07 20:14:00 +02:00
Rhys Arkins
ad16528fa0 fix: don’t debug branches when sorting 2018-05-07 13:21:46 +02:00
Rhys Arkins
2517c9f1d9
refactor: renovateRepository split (#1928) 2018-05-07 12:59:32 +02:00
Rhys Arkins
6431cf6861 refactor: move sortBranches 2018-05-07 07:59:53 +02:00
Rhys Arkins
c0c935963e refactor: remove null onboarding case 2018-05-07 07:55:49 +02:00
Rhys Arkins
4a4feb35ab refactor: pass branches explicitly to repo onboarding 2018-05-07 07:02:08 +02:00
Rhys Arkins
7189f4682f refactor: simplify repo init 2018-05-07 06:47:17 +02:00
Rhys Arkins
3dbd470f61 refactor: move repo processResult 2018-05-07 06:33:49 +02:00
Rhys Arkins
1eb37c4373 refactor: move repo finalise logic to own directory 2018-05-07 06:26:07 +02:00
Rhys Arkins
ac2bc0decb refactor: rename upgrades to updates in branchify 2018-05-06 20:12:01 +02:00
Rhys Arkins
93547f12df refactor: simplify stale lock file maintenance deletion 2018-05-06 12:28:37 +02:00
Rhys Arkins
7a6bcfcf0e fix: handle undefined depType in onboarding PR 2018-05-03 18:35:57 +02:00
Rhys Arkins
5e3339aacb
feat: support commit prefix in onboarding commit (#1868)
This PR adds the capability so that the onboarding commit message (“Add renovate.json”) will have a prefix if semanticCommits is explicitly set to true by the bot administrator.

e.g. “renovate a/b —semantic-commits=true —semantic-commit-type=foo” will result in the onboarding commit being “foobar: add renovate.json”.

Closes #1867
2018-04-26 14:06:36 +02:00
Rhys Arkins
6415833a4b refactor: renovateapp.com -> renovatebot.com 2018-04-24 13:59:42 +02:00
Rhys Arkins
1564150d9f refactor: streamline debug logging 2018-04-18 21:19:00 +02:00
Rhys Arkins
da06af8489 logs: log finish 2018-04-18 06:31:55 +02:00
Rhys Arkins
4bec798521 fix: lower case only if the commitType has no uppercase 2018-04-17 14:28:04 +02:00
Rhys Arkins
8fc005b15e fix: group based on commitMessageExtra 2018-04-17 11:47:22 +02:00
Rhys Arkins
f042c8dbe0 fix: keep version in commitMessage/prTitle when grouping with types 2018-04-17 10:06:02 +02:00
Rhys Arkins
9753f9dcba
feat: modular branchName/prTitle/commitMessage templating (#1760)
This PR refactors `branchName`, `commitMessage` and `prTitle` so that they are more easily editable and hopefully more understandable. By breaking each up into subsections, users can modify one part without needing to copy/paste the entire string.

Directly editing any of these fields will now be deprecated and a warning issued.
2018-04-17 08:39:26 +02:00
Rhys Arkins
70ae459890 Add 'not-found' to errors 2018-04-12 17:03:14 +02:00
Rhys Arkins
2dfae8337d refactor: enhance repository result details
renovateRepository now returns “res” - the result of the current renovation, and “status” - the overall status of the repository.
2018-04-12 14:02:10 +02:00
Rhys Arkins
f874ab53e7 refactor: remove try/catch/finally from repository worker 2018-04-10 09:19:24 +02:00
Rhys Arkins
813dd1be79 logs: log err and message for unknown errors 2018-04-10 09:18:39 +02:00
Ayoub Kaanich
eb3c55b125 refactor: set token in config before renovation 2018-04-09 06:08:43 +02:00
Rhys Arkins
990767fa38 fix: await handleError 2018-04-05 07:37:26 +02:00
Rhys Arkins
0dd604f53d tests: fix automerge tests 2018-04-04 19:35:01 +02:00
Rhys Arkins
27db9cfbf8 refactor: remove automerge recursion 2018-04-04 19:23:45 +02:00
Rhys Arkins
b6cf7360e2
fix: clean repo at end of every repo run (#1787)
Closes #1786
2018-04-04 14:16:36 +02:00
Țurcanu Dragomir
101226db97 fix: add 5s sleep after automerge or restart (#1761)
This hopefully gives a better chance of GitHub being able to finish computing the new mergeability status, and reduces the chance of a race condition.

Closes #1617
2018-04-03 11:28:51 +02:00
Ayoub Kaanich
3b8f3c5c16 fix: use sha instead of ref for PRs when possible. (#1772)
Resolves #1658
2018-04-02 22:49:34 +02:00
Rhys Arkins
d9bfa0cd28 fix: await platform.ensureIssueClosing 2018-04-02 18:47:04 +02:00
Rhys Arkins
70ae736988 fix: abort if renovate config returns null 2018-03-28 21:01:38 +02:00
Rhys Arkins
3b2d8d2dd4 fix: consider newFrom when evaluating group logic 2018-03-28 19:54:42 +02:00
Rhys Arkins
b89f448946
feat: validate packageRule selectors (#1728)
Validates that each packageRule must contain at least one selector. Resolves the rule first to allow for presets.

Closes #1345, Closes #1693
2018-03-28 10:04:07 +02:00
Rhys Arkins
39aa1fdf64 fix: pass through migratedConfig warnings 2018-03-28 09:24:54 +02:00
Steven Hargrove
6b67ffa5ff fix: enforce valid git branch names (#1725)
Adds proper enforcement of branch name rules.

Fixes #1724
2018-03-28 05:18:42 +02:00
Rhys Arkins
9ab4e55bc5 chore: reduce logger.debug volume 2018-03-27 21:57:02 +02:00
Rhys Arkins
08f1739e15 fix: ignore npmrc in repository if user has configured one manually 2018-03-27 16:22:26 +02:00
Rhys Arkins
7379d7d1da logs: downgrade resolved config to trace 2018-03-27 15:37:09 +02:00
Rhys Arkins
e03c2c267f fix: add commit signing to onboarding PR 2018-03-27 06:22:58 +02:00
Rhys Arkins
02da88e350 fix(pr validation): skip branch status when it’s a fork 2018-03-26 07:11:11 +02:00
Rhys Arkins
09c7980566 fix: improve debugging of npmrc 2018-03-25 22:14:40 +02:00
Rhys Arkins
fb230a7b29 fix: perform additional decrypt after preset resolve
To catch the use case where encrypted npmToken or npmrc is in the preset itself
2018-03-25 21:29:37 +02:00
Rhys Arkins
f0cd0cb8b8
feat: raise config action issue if failing to look up locked dependency (#1704)
If an npm dependency can’t be found, and the package.json has a lock file, then Renovate will encounter lock file errors every time *any* dependency in that package.json has an update. Instead of raising PRs with an error, we instead now stop raising PRs and instead raise a config warning issue. Users can “dismiss” this by setting config option `updateLockFiles` to false.

Closes #1697
2018-03-22 11:55:58 +01:00
Rhys Arkins
c1a7bff4a1 refactor: allow 10 loops instead of 5 2018-03-22 09:34:00 +01:00
Rhys Arkins
363a2cc2e5 fix: abort renovation if rate limit exceeded (github) 2018-03-22 09:26:20 +01:00
Rhys Arkins
5e898467d2 tests: fix coverage 2018-03-22 09:24:59 +01:00
Rhys Arkins
d83164691b fix: adjust onboarding PR based on requireConfig setting 2018-03-22 05:33:09 +01:00
Rhys Arkins
ee3240908b
feat: requireConfig (#1695)
Adds option to bot owners to require a renovate config be in place.

Closes #1694
2018-03-21 10:08:55 +01:00
Rhys Arkins
85d697c649 chore: remove unused json-stringify-safe 2018-03-20 21:15:24 +01:00
Rhys Arkins
d77a3b2b92 fix: log error response body if present 2018-03-20 18:03:14 +01:00
Rhys Arkins
6c677cbc92 fix: use onboarding status to determine mirror mode config branch 2018-03-20 13:29:08 +01:00
Rhys Arkins
ec34d136cf fix: don’t have blocking pin PRs when in mirror mode 2018-03-17 15:32:43 +01:00
Rhys Arkins
d86891cf81 fix: prTitle compilation with nested templates
Closes #1652
2018-03-17 10:58:42 +01:00
Rhys Arkins
13609b735d fix: improve try/catch for mirrorMode config 2018-03-17 07:02:38 +01:00
Rhys Arkins
e50d9c1f05 feat: mirrorMode
adds feature mirrorMode, aimed for “shadowing” a target repository.
2018-03-17 06:07:39 +01:00
Rhys Arkins
fa2bda45fe fix: delete lockFileMaintenance branch if no longer necessary
If a lockFileMaintenance branch returns no updated lockfiles then we should delete it.

Closes #1655
2018-03-16 10:51:10 +01:00
Rhys Arkins
dbe9fd9dec fix: compile handlebars multiple times to catch nested templates
Closes #1652
2018-03-13 07:44:50 +01:00
Rhys Arkins
e62aa89a6c
feat: customisable prFooter (#1648) 2018-03-12 13:35:15 +01:00
Rhys Arkins
68117f08d3
fix: remove redundant handlebars compilations (#1637) 2018-03-12 05:23:00 +01:00
Rhys Arkins
09b8989b2e chore: error not warn when repository not found 2018-03-09 11:50:04 +01:00
Rhys Arkins
862998c2b4 fix: don’t validate empty config 2018-03-08 08:00:12 +01:00
Rhys Arkins
ef828be054 refactor: log content before validation 2018-03-08 07:32:09 +01:00
Rhys Arkins
c3db85c74e fix: correct setMeta for validatePrs() 2018-03-07 15:06:57 +01:00
Rhys Arkins
d237c6c670 feat: add comment to PRs if config validation fails 2018-03-06 20:00:10 +01:00
Rhys Arkins
e7c325e6f0 fix: validate based on branchPrefix, not branchName 2018-03-06 16:12:59 +01:00
Rhys Arkins
453ce13278 fix: Revert "refactor: array concatenation (#1601)"
This reverts commit dd26a018c5.
2018-03-06 15:54:39 +01:00
Rhys Arkins
96835410d8
feat: validate renovate config PRs (#1602)
feat: validate renovate config PRs
2018-03-06 15:21:17 +01:00
AndreiMargineanu
dd26a018c5 refactor: array concatenation (#1601)
Refactors all instances of .concat() to use array spread operators instead

Closes #1459
2018-03-06 12:34:39 +01:00
Rhys Arkins
e2f067faba Revert "fix: skip pruning for multiple baseBranches"
This reverts commit 81c722473f.
2018-03-05 13:53:37 +01:00
Rhys Arkins
3877b87c36 fix: delete branchList if repository has looped 2018-03-05 13:53:04 +01:00
Rhys Arkins
81c722473f fix: skip pruning for multiple baseBranches 2018-03-05 13:19:39 +01:00
Rhys Arkins
7021a073aa fix: clean up multiple baseBranches correctly
Re-enables branch cleanup for multiple baseBranches
2018-03-05 12:27:10 +01:00
Rhys Arkins
3d65e3a48e fix: disable branch pruning when multiple basebranches in use 2018-03-05 12:12:46 +01:00
Rhys Arkins
a2c4ecefda fix: delete empty errors and warnings from migrated config 2018-03-04 07:12:02 +01:00
Rhys Arkins
faa4cc6171 fix: travis metadata and formatting
Updates travis config and logic to use same variables as for other managers. This fixes the onboarding PR.

Fixes #1551
2018-03-03 20:53:54 +01:00
Rhys Arkins
3c56f8aeb6
refactor: move manager-specific code under lib/manager (#1573)
Refactors all non-npm code to live inside lib/manager/*
2018-03-03 14:39:39 +01:00
Rhys Arkins
7db4951722 fix: use commonConfig branchPrefix only if set 2018-03-01 21:58:34 +01:00
Rhys Arkins
e9eba859ea fix: use original branchPrefix when pruning baseBranches 2018-03-01 21:34:27 +01:00
Rhys Arkins
a3bd0a0e95 Revert "logs: log configs when baseBranches in use"
This reverts commit c4cdfe8989.
2018-03-01 21:08:01 +01:00
Rhys Arkins
3fd090f3ef feat: prBanner
Enables a “banner” at the top of PRs. Must be set inside a config.js to work.
2018-03-01 17:35:11 +01:00
Rhys Arkins
cf336a0b21 refactor: use manager not packageFile 2018-02-28 19:01:35 +01:00
Rhys Arkins
c4cdfe8989 logs: log configs when baseBranches in use 2018-02-28 19:00:40 +01:00
Rhys Arkins
f95058d66b refactor: move npm registry to datasource 2018-02-27 10:49:24 +01:00
Rhys Arkins
9263fd36b3 fix: don’t overwrite edited onboarding configs
Before, we were attempting to rebase edited branches if renovate.json was the only modified file. This “lost” the committer information - which seemed ok - but it also meant that on the subsequent run it then assumed Renovate was the only committer. Now we don’t rebase edited onboarding branches anymore.

Closes #1360
2018-02-22 19:46:57 +01:00
Rhys Arkins
352ac76640 chore: add debugging to semantic commit detection 2018-02-22 08:58:44 +01:00
Rhys Arkins
1fd83139ed
feat: configurable onboarding config (#1543)
Adds configuration option `onboardingConfig` that allows the default onboarding config to be extended or replaced via `config.js` or env configuration.

Closes #1521
2018-02-21 19:50:58 +01:00
Rhys Arkins
8c772348c6 chore: downgrade changed from warn to info 2018-02-09 08:27:24 +01:00
Rhys Arkins
b1ad1bb058 fix: detect renamed repositories and skip 2018-02-08 16:04:25 +01:00
Rhys Arkins
29cae7725b fix: show newDigest for docker digest pinning in onboarding PR 2018-02-06 11:14:55 +01:00
Rhys Arkins
a79222b777 fix: catch initRepo 403 (github) 2018-02-05 22:23:50 +01:00
Rhys Arkins
4a427adcac fix: don’t clean branches if repository is not found or blocked 2018-02-04 21:57:43 +01:00
Rhys Arkins
4c267b210b fix: handle archived repos gracefully 2018-02-04 21:20:28 +01:00
Rhys Arkins
5a11596960 chore: add logging to onboarding pr logic 2018-02-04 13:35:43 +01:00
Rhys Arkins
021242a7bf fix: use json-stringify-safe on unknown errors 2018-02-03 15:58:14 +01:00
Rhys Arkins
e306f707db fix: abort renovation if repository has changed during run
If attempting to create a branch and it already exists, or attempting to update a branch and it no longer exists, then we abort.
2018-02-03 15:45:43 +01:00
Rhys Arkins
720b46696a
feat: gitlab branch cleanup (#1475)
Removes the GitHub-only check when cleaning/pruning branches.
2018-02-03 12:06:25 +01:00
Rhys Arkins
40072e2707 refactor: downgrade 5 loops from error to warn 2018-02-02 18:04:26 +01:00
Rhys Arkins
7afb693151 fix: update all pr body templates to use h1 headings 2018-02-02 10:56:40 +01:00
Rhys Arkins
6fc1f94936 feat: list package files in onboarding PR
Closes #1461
2018-01-31 13:20:55 +01:00
Rhys Arkins
335844e6b7 feat: strip docker-only descriptions from onboarding PR if no Dockerfiles 2018-01-31 13:10:09 +01:00
Rhys Arkins
ad4b9feb92 feat: prConcurrentLimit
Adds a new feature to limit the number of concurrent branches/PRs to have open at any one time. Defaults to 0 (disabled), set it to a positive integer to enforce that limit.
2018-01-30 11:43:16 +01:00
Rhys Arkins
5a02a35afb chore: log branchList before pruning 2018-01-30 09:23:38 +01:00
Rhys Arkins
64cf41e76e refactor: sort PRs by type and then title 2018-01-28 16:14:04 +01:00
Rhys Arkins
f64204b992 fix: pin PRs should be sorted before digest ones 2018-01-28 15:57:20 +01:00
Rhys Arkins
f3c8fd23c9
feat: stringify unknown errors for better visibility (#1449)
feat: stringify unknown errors for better visibility
2018-01-26 19:08:13 +01:00
Rhys Arkins
d66dea7ec3
feat: verify status check (GitHub) (#1444)
Adds a `renovate/verify` status check for those migrating and looking for familiarity. Better to check the GPG verified commit, as mentioned in the associated doc.
2018-01-25 13:36:21 +01:00
Rhys Arkins
9363fd8acf refactor: pass object to platform.initRepo
Also renames repoName to repository
2018-01-25 12:24:13 +01:00
ctaepper
280e74fa9f feat: expose env to npmrc and npm/yarn/pnpm (#1407)
Adds a config option to bot administrators called `exposeEnv`, for cases where repositories are trusted. If set to true, the bot's full `process.env` can be used for `.npmrc` variable substitution and is passed to child processes when generating lock files. Disabled by default, including in the App.
2018-01-25 10:38:30 +01:00
Rhys Arkins
516142b687
feat: import existing greenkeeper config when onboarding (#1431)
Detects any greenkeeper configuration fields and migrates them to Renovate’s config during onboarding.

Closes #1429
2018-01-23 11:59:32 +01:00
Rhys Arkins
0b7deb546c
feat: apply package.json renovate config to whole repository (#1419)
Changes the way Renovate treats renovate config inside `package.json` files. Before, config used to be applied only to that particular file, meaning that it was not applied for the rest of a monorepo, or for other package managers like Docker. Now, any `renovate` section inside the repository’s root `package.json` will be applied globally, just the sams as if it were contained within a `renovate.json` file. This means there is no longer any case where you *must* have a `renovate.json` file instead of `package.json`.

Closes #1323

BREAKING CHANGE: renovate config in `./package.json` is now applied to whole repository, and renovate config inside non-root `package.json` files is now ignored.
2018-01-23 06:59:01 +01:00
Rhys Arkins
85dfa819c1
fix: skip newlines at start of Dockerfile (#1402)
Allow for both comment lines or empty lines prior to FROM in Dockerfile
2018-01-17 17:58:28 +01:00
Rhys Arkins
ac09b9d7cd feat: cache npm results in memory per-run
We currently use got’s inbuilt caching for npmjs, however it still results in a roundtrip/304 even when cached. The when using presets is that a package like renovate-config-default gets looked up 10+ times unnecessarily. With this feature we assume that npm lookups don’t change for the duration of a run, and even if they did then we’d prefer the reliability of using the first lookup.

Closes #1389
2018-01-15 11:53:02 +01:00
Rhys Arkins
b5db28b242 fix: propagate registry-failure errors to avoid config validation warnings
We don’t want npmjs 5xx errors to cause config validation Issues in repositories.

Closes #1388
2018-01-14 18:58:49 +01:00
Rhys Arkins
2a5f189573 fix: ignore onboarding branch when calculating pr hourly limit 2018-01-12 10:02:36 +01:00
Rhys Arkins
dba574950b
feat: baseBranches (multi-branch) support (#1379)
This PR adds the capability to renovate more than one base branch at a time. For instance, a project may have their released `3.x` version on `master`, while an upcoming `4.x` is being prepared using branch `next`. `4.x` might have a quite different set of dependencies (e.g. some removed or some added) so it's not appropriate to only target `master` and keep rebasing, as it will get messy. Instead, it's necessary to target both `master` and `next` to keep both updated.

Closes #1279
2018-01-12 07:47:18 +01:00
Rhys Arkins
2dcb2a70d8 feat: prHourlyLimit
Adds a feature to enforce an hourly limit on PR creations.

Closes #1363
2018-01-11 11:56:16 +01:00
Matt R. Wilson
d0d62e6e7b Allow --renovate-fork Cli flag for onboarding.
Fixes https://github.com/renovateapp/renovate/issues/1371.
2018-01-10 22:52:36 +01:00
Rhys Arkins
2925c0d9a7 feat: automatically group @types companion packages
By stripping ‘types/ from the branch name, package x and @types/x then become automatically combined in the same PR. We then massage it a little to ensure the decription for the non-types package is used, and a note added saying that types is included.

Closes #1365
2018-01-10 15:35:14 +01:00
Rhys Arkins
2e2f53b677 fix: move debug statement to fix tests 2018-01-10 09:38:42 +01:00
Rhys Arkins
a2b3ca440d refactor: debug if repoIsOnboarded 2018-01-10 09:09:17 +01:00
Rhys Arkins
228b823e45 fix: ignore branchPrefix for onboarding branch 2018-01-09 17:24:09 +01:00
Rhys Arkins
910793e5f2 fix: check onboarding pr when handling config error
Instead of checking for config.repoIsOnboarded, just check for the onboarding PR and reverse the logic.

Closes #1339
2018-01-08 15:53:52 +01:00
Rhys Arkins
1bbf0c1692 fix: don’t apply custom branchPrefix when onboarding 2018-01-06 10:19:00 +01:00
Rhys Arkins
b711e0c3aa fix: handle 404 repos gracefully 2017-12-31 20:47:46 +01:00
Rhys Arkins
24b94765ff feat: skip over archived repositories (github) 2017-12-31 20:28:22 +01:00
Rhys Arkins
1cb920fa4b fix: set/reset npmrc during init
Detect npmrc in root of repo and make sure it’s set early. Also ensure npmrc is reset at start of each run if necessary.

Helps #1335
2017-12-30 06:11:04 +01:00
Rhys Arkins
45d7c8f257 fix: check pr state for open or opened 2017-12-30 06:03:57 +01:00
Rhys Arkins
e735ed9eb0 feat: restart renovation if any pr has changed from open to closed 2017-12-28 17:21:06 +01:00
Rhys Arkins
e0e0b9defe fix: Revert "feat: restart renovation after github error"
This reverts commit eb579ff388.

For some reason it seems to be causing a reduction in throughput per hour in the app once deployed.
2017-12-26 19:45:17 +01:00
Rhys Arkins
eb579ff388 feat: restart renovation after github error
When 404 or 422 errors are encountered writing updates, Renovate will now restart in an attempt to fix it. Usually this is because branches/PRs have been edited or closed while Renovate is running.

Closes #1299
2017-12-26 06:26:33 +01:00
Rhys Arkins
4ec85ad818
feat: use version in pr title for synchronised groups (#1333)
Now, if every upgrade in a group has the same new version, then the PR title will include this version.

Closes #1332
2017-12-24 11:14:34 +01:00
Rhys Arkins
146e8f6982
feat: skip onboarding if renovate config detected in root package.json (#1322)
Renovate will now detect if renovate config already exists within the project’s ‘package.json’ root, and skip onboarding if so.

Closes #1159
2017-12-22 19:14:26 +01:00
Rhys Arkins
f4364ccc44 fix: isOnboarded should return true if onboarding is skipped 2017-12-22 18:50:41 +01:00
Rhys Arkins
2c6a2dd43b feat: better semantic commit detection
Limit to looking at last 10 commit messages and only use semantic commits if angular type is found.
2017-12-19 19:45:34 +01:00
Rhys Arkins
eeefc3c8f3
feat: stop and raise error if repository is misconfigured (#1302)
This PR updates Renovate to detect config validation problems and (1) stop processing, and (2) either raise an Issue if already onboarded, or (2) update the onboarding PR to reflect the error if still onboarding.

Closes #1300
2017-12-18 09:39:52 +01:00
Rhys Arkins
cfd02be920 refactor: log renovateConfig when warning of validation errors 2017-12-16 07:09:54 +01:00
Rhys Arkins
b5b714d4b5
fix: writeToken -> forkToken (#1295)
Rename writeToken to forkToken to make it clearer. This enables GitHub API to use one token for all reads, and another token just for writing to the forked repository.
2017-12-14 11:47:00 +01:00
Rhys Arkins
bbb700c54d feat: add github writeToken capability in github wrapper 2017-12-12 14:54:09 +01:00
Rhys Arkins
cb8fd6b4ed
feat: fork mode (#1287)
This PR adds the capability to run Renovate in a new "fork mode". This new mode must be configured by the Renovate admin, and cannot be configured within repositories themselves (for now). Example use: `renovate --autodiscover --fork-mode`

In this mode: 
* Renovate will fork the repository if necessary (first run only)
* If the fork already existed, Renovate will ensure that its base branch is up to date with the source repository's
 * Branches will be created within the fork, PRs will be created in the source
2017-12-11 19:14:51 +01:00
Rhys Arkins
61b1c7f25c refactor: sort branches
This makes the onboarding PR easier to understand by putting pin first, then minor, then major.
2017-12-08 11:03:45 +01:00
Rhys Arkins
696aaa38af
refactor: slim down onboarding PR description (#1274) 2017-12-07 13:32:56 +01:00
Rhys Arkins
987891ba2e
feat: bazel WORKSPACE support (#1268)
This PR adds support for bazel WORKSPACE package files, as suggested https://github.com/alexeagle/angular-bazel-example/issues/17#issuecomment-349167982

Renovate will:
1. Detect `WORKSPACE` files anywhere in the repository
2. Look for all `git_repository()` sections in the file
3. Extract any dependencies with name, remote and tag values
4. Look up any dependencies that (a) have a github https remote, and (b) a valid semver as tag
5. Update the tag to the latest available
2017-12-07 09:22:10 +01:00
renovate[bot]
73506f9043 chore(deps): update dependency prettier to v1.9.0 (#1267)
* chore(deps): update dependency prettier to v1.9.0

* run prettier
2017-12-05 11:50:16 +01:00
Rhys Arkins
b8dadb718d
feat: travis.yml node_js versions support (#1243)
This PR adds support for renovating the `node_js` versions in `.travis.yml` configuration files. Important notes:
- Functionality is disabled by default and hence opt-in via configuration
- Added a new manager type `node` because it is anticipated to support more than just Travis in future, with mostly unified logic
- Added the config option "policy" with supported values: lts, active, current, lts_latest and lts_active
- Policy is actually an array, to allow additive combining, e.g. `["lts_latest", "current"]`
- Actual node versions are *hardcoded*. There is no perfect metadata source for this and they change infrequently enough that it is definitely not a problem for now (next change will be in April 2018)
- If node versions need updating, they are listed from newest to oldest
- Replacing function attempts to detect the indention (spacing) in file and use that

To enable, configure `node.enabled=true` and optionally `node.policy=["<policy>"]` if you want something other than `lts`.

Closes #1208
2017-12-05 07:50:16 +01:00
Rhys Arkins
15dfad63b5
refactor: return ‘onboarding’ from ensureOnboardingPr (#1250) 2017-11-28 14:58:18 +01:00
Rhys Arkins
72d46c20e2
refactor: remove label and assignees description from onboarding pr (#1235)
These can now be described via presets instead
2017-11-24 12:03:57 +01:00
Rhys Arkins
7e6befe4a8
fix: merged PRs should not block new PRs in monorepos (#1230)
Only block if it was closed unmerged.

Fixes #1205

* check for closed only for monorepos
2017-11-24 07:31:20 +01:00
Rhys Arkins
65a5e90bb7
feat: split semanticPrefix into type and scope 2017-11-24 07:14:58 +01:00
Rhys Arkins
d3d9b2be02
refactor: packageFile log debug -> trace (#1191) 2017-11-17 15:10:59 +01:00
Rhys Arkins
414fb7d4d7 chore: add debugging to checkOnboardingBranch 2017-11-16 14:16:24 +01:00
Rhys Arkins
7c72156562
refactor: move semantic commit detection from init to later updates (#1170) 2017-11-15 13:39:44 +01:00
Rhys Arkins
b3ec1c0156
fix: set npmrc at repository level (#1169) 2017-11-15 12:30:39 +01:00
Rhys Arkins
c3d84d4767
fix: find .renovaterc.json when onboarding (#1145) 2017-11-11 05:18:24 +01:00
Rhys Arkins
ede1a59527
feat: support .renovaterc json configuration file (#1142)
Renovate will now check for `renovate.json`, `.renovaterc`, and `.renovaterc.json` in that order. JSON-only supported (no YAML).

Closes #969
2017-11-10 14:10:16 +01:00
Rhys Arkins
8a87bcd918
feat: rebase onboarding branch (#1139)
Previously, Renovate's "Configure Renovate" onboarding branch would never get rebased after it was created. Now, it will be rebased every time the base branch is updated, unless the list of modified files is more than `renovate.json` alone.

Closes #1111
2017-11-10 13:07:06 +01:00
Rhys Arkins
f044aca321 refactor: streamline platform file operations (#1121)
Remove original getFile, getFileContent, and getFileJson and replace with getFile (which used to be getFileContent.. shortened now for convenience). Also remove unused getSubdirectories functions.
2017-11-08 12:23:32 +01:00
Rhys Arkins
8c479071fd
refactor: use global logger (#1116) 2017-11-08 06:44:03 +01:00
Rhys Arkins
602752f9fe
refactor: use platform global (#1115) 2017-11-07 13:31:34 +01:00
renovate[bot]
c1df1b2cb8 chore(deps): update dependency prettier to v1.8.0 (#1113)
* chore(deps): update dependency prettier to v1.8.0

* reformat
2017-11-07 11:52:15 +01:00
Rhys Arkins
f8be45055a
refactor: remove config.api and use platform dispatcher (#1114) 2017-11-07 11:46:10 +01:00
Rhys Arkins
5a852baa61
fix: do not clean uninitiated repository (#1102) 2017-11-05 06:27:46 +01:00
Rhys Arkins
80bed05146
feat: return result from renovateRepository
Repository logic code has been rearranged for better logic and file separation.

Closes #654
2017-11-05 05:45:49 +01:00
Rhys Arkins
d5462049a6
chore: implement require-await eslint rule (#1095) 2017-11-03 11:56:25 +01:00
Rhys Arkins
dcdfc0d004
fix: refactor pin dependencies first using array.some (#1094) 2017-11-03 11:50:57 +01:00
Rhys Arkins
935a70e88c
refactor: use plain markdown for onboarding pr body (#1093)
This PR refactors the onboarding PR logic into its own subdirectory and redesigns it to use plain markdown instead of html. Plain markdown in PR bodies is a requirement for adding VSTS Support ( #1049 ).
2017-11-03 10:01:54 +01:00
Rhys Arkins
9769f5a5db
refactor: detectPackageFiles returns packageFiles not config (#1092) 2017-11-03 09:25:18 +01:00
Rhys Arkins
9c1b7d78cd
refactor: move monorepos logic to npm manager (#1091)
* refactor: move monorepos logic to npm manager

* fix test
2017-11-03 09:06:42 +01:00
Rhys Arkins
543d93c520
refactor: move migrate-validate to config/ (#1090) 2017-11-03 08:25:51 +01:00
Rhys Arkins
11d7f26cc1
refactor: perform decrypt as part of merge renovate.json (#1086)
Also clarify docs that encrypted config must be contained in renovate.json (i.e. not package.json).
2017-11-03 07:51:44 +01:00
Rhys Arkins
143044ed64
fix: set contentBranch to undefined instead of null (#1077)
This allows parameter substitution to work correctly (undefined is replace, null is not).

Closes #1076
2017-11-02 04:59:31 +01:00
Rhys Arkins
90c3b1cdbd
fix: add gitlab MR labels at time of creation (#1006)
This refactor means that createPr now takes `labels` as a new parameter so that the GitLab API can include them with the MR creation request, so save one API call. This also fixes #985 as a result.
2017-11-01 13:55:36 +01:00
Rhys Arkins
58784fc958 feat: add renovateFork option
99% of the time we should not Renovate forked repositories. Previously, we skipped onboarding them unless a renovate.json was present. However, that meant that if someone forked a repository where the source was using Renovate, then the fork gets renovated automatically too. After this change, forked repositories need to set renovateFork=true in their renovate.json

Closes #940

BREAKING CHANGE: Forked repositories now need to configure renovateFork=true in renovate.json
2017-11-01 13:13:55 +01:00
Rhys Arkins
56e6bd32b5
refactor: log if repository is a configured fork (#1071) 2017-11-01 11:42:20 +01:00
Rhys Arkins
caa8c20b1f
fix: prune branches if repo is a fork (#1060) 2017-11-01 06:33:21 +01:00
Rhys Arkins
780b3f3175
feat: autodetect js type during runtime (#1053)
This is instead of autodetecting lib or app during onbiarding. This means some package files might be all pinned while others in the same monorepo can be not. This also simplifies the onboarding logic.
2017-10-29 05:15:59 +01:00
Rhys Arkins
0427604de6 refactor: move language extraction logic to manager (#1046)
* refactor: move docker and meteor extraction to manager

* refactor: move resolve docker logic to manager

* refactor extract config
2017-10-25 10:11:11 +02:00
Rhys Arkins
7d06bebe2e refactor: push detect dockerfiles to manager (#1043)
* refactor platform

* refactor detect package files

* fix

* refactor npm detect

* refactor meteor detect

* refactor: move detect package files completely to manager

* update snapshots
2017-10-25 06:00:07 +02:00
Rhys Arkins
a2bdcde8fb fix: check for dockerfile content before processing (#1039) 2017-10-24 12:11:37 +02:00
Rhys Arkins
01fedc7e0c refactor: move github and gitlab api to platform (#1037) 2017-10-24 10:27:17 +02:00
Rhys Arkins
9c16565a2d feat: enable docker by default (#1026)
Docker does now not need to be explicitly enabled.

Closes #942
2017-10-23 13:59:33 +02:00
Rhys Arkins
b2f35fef44 fix: do not delete semantic commits when migrating (#1025) 2017-10-23 13:06:09 +02:00
Rhys Arkins
9bac600caf refactor: filter pinned dependencies first (#1023) 2017-10-23 12:45:32 +02:00
Rhys Arkins
9c9da3f6de fix: error and exit if cannot parse renovate.json (#1019) 2017-10-22 07:47:18 +02:00
Rhys Arkins
636c7d17de feat: skip group name if all depNames are the same (#1015)
This commonly applies to monorepos where the same dependency may be present in multiple.json files. Instead of using the group name to describe the PR, it uses the dependency name.

Closes #848
2017-10-21 07:46:47 +02:00
Rhys Arkins
d3df597aa7 fix: only detect meteor files that include json Npm.depends (#1009) 2017-10-20 14:29:12 +02:00
Rhys Arkins
aba27eb757 feat: enable meteor by default (#1002)
Renovate will now check for and update meteor package.js files unless explicitly *disabled*.
2017-10-20 07:04:04 +02:00
Rhys Arkins
fa48a7fdef feat: rename open prs before autoclosing (#990)
This is a failsafe against Renovate bugs and potentially also mistakes on the user’s part. Before deleting/pruning any branches, Renovate will rename the PR’s title so that it should not block future PRs.

Closes #989
2017-10-19 07:36:09 +02:00
Rhys Arkins
a4a14861b9 fix: replace some file sync functions with await (#980)
* refactor: await fs.readFile instead of sync version

* fix: replace fs and tmpDir sync with promises
2017-10-18 13:26:56 +02:00
Rhys Arkins
5639f4b601 fix: move renovate repository inner inside outer function (#977)
This solves the missing config.api problem introduced when moving to recursion
2017-10-18 11:18:48 +02:00
Rhys Arkins
dd43fb3237 fix: replace repository do-while loop with recursion (#976) 2017-10-18 10:29:49 +02:00
Rhys Arkins
652b910d81 fix: only detect meteor package.js files containing Npm.depends (#953)
Closes #952
2017-10-16 14:21:45 +02:00
Rhys Arkins
ee44d1c3ba feat: reimplement findFilePaths using trees (#950)
* refactor: replace github code search with getTree/manual search (#944)

Previously Renovate was using the GitHub code search API once for each filename we are looking for. Instead, we now retrieve a list of files in the repository and cache it so it can be reused for filename matches.

Closes #939

* fix: use recursive=true

* fix: reset fileList for every repo (github)

* feat: implement findFilePaths on gitlab (#945)

* refactor: do not check manually for root package.json

* fix: reset fileList for every repo (gitlab)

* fix tests
2017-10-16 11:59:59 +02:00
Rhys Arkins
3c1415844a fix: rename and delete erroneous onboarding PRs if found (#948) 2017-10-16 07:59:42 +02:00
Rhys Arkins
74a590ae8e fix: revert findFilePath changes (#947)
* Revert "feat: implement findFilePaths on gitlab (#945)"

This reverts commit 2820b5eef3.

* Revert "refactor: replace github code search with getTree/manual search (#944)"

This reverts commit 33851a5aea.
2017-10-16 07:33:47 +02:00
Rhys Arkins
33851a5aea refactor: replace github code search with getTree/manual search (#944)
Previously Renovate was using the GitHub code search API once for each filename we are looking for. Instead, we now retrieve a list of files in the repository and cache it so it can be reused for filename matches.

Closes #939
2017-10-15 17:38:45 +02:00
Rhys Arkins
c15cfb6406 fix: refactor package file detection to not modify deep state (#923) 2017-10-12 20:02:04 +02:00
Rhys Arkins
8b99ce5294 feat: detect languages during onboarding (#919)
* refactor: simplify onboarding logic

* docker meteor tests

* handle no package files case

* fix coverage
2017-10-12 16:29:20 +02:00
Rhys Arkins
97ebf27382 refactor: getOnboardingStatus returns config object (#918) 2017-10-12 10:58:16 +02:00
Rhys Arkins
e9ee8002df fix: revert docker/meteor onboarding code (#916)
* Revert "feat: support docker and meteor onboarding without npm"

This reverts commit 437145b901.

# Conflicts:
#	test/workers/repository/onboarding.spec.js

* chore: downgrade npm cache message from debug to trace
2017-10-11 19:25:25 +02:00
Rhys Arkins
68bcb5e726 fix: convert for loop to for..of (#915)
* fix: convert for loop to for..of

* chore: lessen preset debugging

* chore: set detectPackageFiles to debug

* fix lint
2017-10-11 18:54:09 +02:00
Rhys Arkins
bf2491bfc1 fix: don’t automerge pinned dependencies (#914) 2017-10-11 16:20:17 +02:00
Rhys Arkins
1696244ca0 feat: warn in onboarding if package.json missing or failed to parse (#911)
* chore: downgrade json parsing warning from warn to debug

* feat: warn in onboarding if package.json missing or failed to parse

Closes #891
2017-10-11 14:38:40 +02:00
Rhys Arkins
a60748c5ec feat: improve onboarding help
Adds mention of app author + how to recreate PR.
2017-10-11 12:46:30 +02:00
Rhys Arkins
ce178f96bc chore: improve meteor and docker info log 2017-10-11 12:10:31 +02:00
Rhys Arkins
437145b901 feat: support docker and meteor onboarding without npm 2017-10-11 12:10:31 +02:00
Rhys Arkins
ff906bd832 fix: rename javascript types to npm 2017-10-11 12:10:31 +02:00
Rhys Arkins
a1941e309b fix: only check package.json file types for isPrivate 2017-10-11 12:10:31 +02:00
Rhys Arkins
eacd2b258a refactor: check if npm enabled before detecting files 2017-10-11 12:10:31 +02:00
Rhys Arkins
7c17c666f4 fix: better pin description in oboarding 2017-10-11 12:10:31 +02:00
Rhys Arkins
343814d467 fix: use presets js-app and js-lib (#906) 2017-10-10 12:34:35 +02:00
Rhys Arkins
28a18b18da feat: write existing lockfile before regenerating (#881)
It appears that writing the existing lockfile before regenerating a new one can help speed some resolutions up.

Closes #815
2017-10-08 05:52:58 +02:00
Rhys Arkins
88e6406e77 fix: dont log full upgrade object (#876) 2017-10-02 20:34:51 +02:00
Rhys Arkins
853a43937a fix: check if depName exists before replacing (#873) 2017-10-02 14:14:24 +02:00
Rhys Arkins
e42b4034eb feat: sanitize branch names (#872)
Previously, you might see branch names like `renovate/@types/jquery-3.x`. Now, such branches will instead be like `renovate/types-jquery-3.x`.
2017-10-02 11:38:42 +02:00
Rhys Arkins
d392efc36c chore: add filename to Renovating package.json log (#869) 2017-10-01 15:25:05 +02:00
Rhys Arkins
8125c772ae feat: ignoreNpmrcFile (#853)
This feature adds support for ignoring .npmrc files in a repository. Set config option to true if you wish to ignore.

Closes #851
2017-09-29 08:22:22 +02:00
Rhys Arkins
23f8467d1e feat: support non-root yarn workspaces (#852)
Previously, Renovate assumed that any yarn workspaces configuration would be in the root of the repository. Now, workspaces can be located within a subdirectory, e.g. `frontend/`. Note: Renovate still supports only one workspace per repository, please file an issue if you require more than one.

Closes #842
2017-09-29 08:08:52 +02:00
Rhys Arkins
9aad365032 feat: improve logging visibility (#828)
* fix: add upgrade and branch timings to log

Adds timing logs for upgrade detection + branch updating stages.

Closes #821

* improve request retry logging
2017-09-22 07:04:41 +02:00
renovate[bot]
cfc6c5ccdf fix: update dependency eslint-config-airbnb-base to v12 (#771)
* chore(deps): update dependency eslint-config-airbnb-base to v12.0.0

* fix lint
2017-09-15 19:46:25 +02:00
Rhys Arkins
a88ba0d16a feat: Dockerfile digest support (#788)
This feature adds initial support for renovating Dockerfiles. Renovate now:
- Detects all `Dockerfile`s in repo
- Searches for `FROM x` in first non-comment line, breaks x into image, tag, digest
- Queries public Docker registry for image:tag combination to find latest digest
- Patches Dockerfile if necessary
- Creates branches/PRs as like with npm

Closes #795
2017-09-14 09:31:36 +02:00
Rhys Arkins
9c56d6f51c fix: nrefactor config.logger -> logger (#794) 2017-09-14 07:21:22 +02:00
Rhys Arkins
d546f30a8f chore: fix eslint (#793)
* fix eslint configuration

* run eslint fix
2017-09-13 21:43:52 +02:00
Rhys Arkins
d765b34c33 feat: renovate meteor package.js dependencies (#786)
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 #785
2017-09-12 09:33:41 +02:00
Rhys Arkins
8fa94141a1 feat: use package names for ignoring when lerna or workspaces (#787)
* add minimatch

* feat: use package names for ignoring when lerna or workspaces

Renovate will now:
- Find all package.json files matching lerna or yarn workspaces glob pattern
- Retrieve package names from within those package.json files
- Implicitly ignore (not renvoate) any of those names

Closes #781
2017-09-12 07:49:56 +02:00
Rhys Arkins
bae9ae0595 feat: stop branch processing after lock file error or pin dependencies (#768)
If a repository has a lock file error (e.g. can’t look up a private module) then it will no longer attempt to create every branch. Instead, it will error/exit after the first branch. Additionally, “Pin Dependencies” has been sorted to be first and further branches won’t be added or updated until Pin Dependencies has been merged.
2017-09-02 08:51:49 +02:00
Rhys Arkins
47df66143b fix: do not warn when lerna subdirectories not found (#762) 2017-09-01 11:40:12 +02:00
Rhys Arkins
6c0d50703f feat: encrypted configuration strings (#759)
A new config object `encrypted` can be defined at any level and contain encrypted configuration strings. Initial use is for encrypting an npm token for use with the hosted renovate app.

Closes #650
2017-09-01 06:45:51 +02:00
Rhys Arkins
16d36a15e2 feat: add npmToken, npmrc and yarnrc configuration support (#753)
Renovate config can now support the fields `npmToken`, `npmrc` and `yarnrc`. `npmrc` and `yarnrc` (note no `.` prefix) can be used as an alternative to checking the respective files into the repo and have the same effect. `npmToken` is a shorter alternative and allows for just the npm token to be added, defaulting to the public npm registry.
2017-08-29 09:25:44 +02:00
Rhys Arkins
6e9c73e35a feat: restart repo renovate after automerge (#751)
Previously, the automerge feature was causing some undesirable behaviour when multiple branches were open at the same time. Example: #707. The main problem is that other branches will still be calculated based on the original `package.json` contents and not the post-merge contents. The simplest solution seems to be:
- Stop all subsequent branch processing after any automerge
- Restart repository renovation
This continues until no branch has automerged in a cycle.

Closes #750
2017-08-28 15:50:11 +02:00
Rhys Arkins
7c3df0ba23 feat: yarn workspaces lock file support (#743)
This feature adds explicit support for correctly generating the yarn.lock file for workspaces. Specifically, it means that the yarn.lock in the root directory is regenerated whenever *any* package.json is modified. Previously lock files were only every updated if its corresponding package.json changes, but that is not the way yarn workspaces works.

Closes #473
2017-08-27 08:17:34 +02:00
Rhys Arkins
ec1eaa2dd0 feat: convet ignoreNodeModules to ignorePaths (#741)
The ignoreNodeModules feature is replaced with a generic ignorePaths one and allows any array of strings to be defined and package.json file matching them will be skipped/ignored. Also migrates any existing config/presets.
2017-08-26 21:28:29 +02:00
Rhys Arkins
ea9ace2a76 feat: branch worker updates (#736)
This is a major refactor of branch code to prepare for Yarn workspaces plus creating PRs for branches with failing lockfiles. Marked as "feature" to cause a minor version bump due to the moderate chance of accidentally breaking something.
2017-08-26 16:10:18 +02:00
Rhys Arkins
21aa961264 feat: re-use node_modules per package file (#704)
tmpDir is now created once per-repository and package.json files are written and lockfiles generated based on the repo's directory structure. This way node_modules can be reused between branches in same run.

Closes #501
2017-08-22 06:28:46 +02:00
Rhys Arkins
b657d3c291 feat: support lock file maintenance automerge (#712)
Refactored the `automerge` field to change it to boolean. Existing string will be migrated to new config. Automerging lock files is now possible by adding `”lockFileMaintenance”: { ”automerge”: true}` to config.

Closes #706
2017-08-21 13:41:48 +02:00
Rhys Arkins
cffbc00f65 fix: resolve all presets before merge (#710)
Previously, preset resolution was being done last, after merges of renoate.json or package.json config. This caused wrong ordering of config in cases where both presets + regular config was in use. Instead, resolving of presets is now done at each stage before merging.

Fixes #708
2017-08-21 10:19:48 +02:00
Rhys Arkins
68033a7040 fix: imply lerna packages dir if not in config (#700) 2017-08-19 06:50:53 +02:00
Rhys Arkins
7187821416 fix: hand-craft onboarding config string for better formatting (#694) 2017-08-18 12:56:48 +02:00
Rhys Arkins
3265cbbb51 fix: onboarding packages should have : prefix (#693) 2017-08-18 10:29:27 +02:00
Rhys Arkins
ad40f0abd8 feat: shareable preset configs (#658)
This PR implements eslint-inspired shareable configs. With this feature, we:
- Add new config option "extends"
  * This is an array of preset config names that the current config or preset extends/inherits from
- Add new config option "description"
  * Each preset config should include a description of its functionality that is human-readable
- Provide a set of commonly use configs called "preset defaults"
- Provide two "full" preset configs: "app" and "library"
   * Almost the same but app pins *all* version numbers while library only pins devdependencies
- Replace regular config in onboarding with one of these two presets
- Generate human-readable description of config in Onboarding PR
- Support npm for hosting configs (both scoped and non-scoped)

Closes #657, Closes #671, Closes #647
2017-08-18 06:10:19 +02:00
Rhys Arkins
c28176e879 refactor: use logger const in repository worker (#685) 2017-08-17 12:33:21 +02:00
Rhys Arkins
c44bd198c7 fix: cast groupName to string in case it’s not (#684) 2017-08-17 11:24:22 +02:00
Rhys Arkins
ddb1629d9a fix: return massaged config from migrateAndValidate (#681)
* add massage test

* fix: return massaged config from migrateAndValidate
2017-08-15 13:26:05 +02:00
Rhys Arkins
43660d51c4 feat: validate schedule (#674)
Also enables config errors to be shown in Configure Renovate PR.

Closes #550
2017-08-14 11:09:14 +02:00
Rhys Arkins
d27d35e535 feat: allow strings instead of lists (#665)
Updates definitions for schedule and package rules to allow strings to be massaged to lists - instead of erroring.

Closes #662
2017-08-11 07:29:16 +02:00
Rhys Arkins
88aaaccfb9 fix: don't detect semantic commits if config set globally (#664)
Fixes #656
2017-08-10 22:35:05 +02:00
Rhys Arkins
ccb66310b1 feat: Pre-fetch all package.json files (#642)
Repository initialisation is refactored so that all package files and their content is retrieved up-front before an renovating begins. This allows us to know both how many package files as well as determine if there is renovate json in a package.json before triggering the onboarding PR.

Closes #634
2017-08-08 06:25:44 +02:00
Rhys Arkins
f8ec742b3b feat: Detect semantic commits every run (#609)
Now no need to detect at onboarding time. Also suggests removing setting in migration if it is already the same value.

Closes #528
2017-08-04 14:49:02 +02:00
Rhys Arkins
e7ce772e94 feat: Make semanticPrefix implicit in templates (#608)
No need for {{semanticPrefix}} to be specified in templates now - it will be implicitly added to start of commit message and PR titles if semanticCommits=true
2017-08-04 12:34:42 +02:00
Rhys Arkins
134065c7c7 refactor: use branch prefix in templates (#604)
This allows for the easy overriding of our default `renovate/` branch naming.

Closes #586
2017-08-04 08:32:22 +02:00
Rhys Arkins
6c1f27f905 fix: semantic commit messages should always be lower case (#598)
commitMessage and prTitle will be converted to lowercase after compilation if semanticCommits=true

Fixes #594
2017-08-03 21:49:44 +02:00
Rhys Arkins
db2e6dd1b9 refactor: Convert Object.assign to spread (#585)
Closes #226
2017-08-03 08:01:20 +02:00
Rhys Arkins
d2ad057a33 feat: Improve depTypes configuration (#577)
depTypes configuration is now refactored from being an array of strings/objects to having each type of dep (`dependencies`, `devDependencies`, `optionalDependencies`, `peerDependencies`) be a first class object in the namespace. The "old" way of configuring is still supported but is transformed using a migrateConfig script. Later, PRs will be raised to impacted repositories to suggest the new config.
2017-08-02 14:05:45 +02:00
Rhys Arkins
7f97424092 fix: Separate config migration check to own file (#576) 2017-08-02 08:54:42 +02:00
Rhys Arkins
023e520702 fix: Do not log warning when deprecated config options found (#563) 2017-07-31 14:50:44 +02:00
Rhys Arkins
8fc97af5c7 feat: Ignore forked repositories unless already configured (#561)
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 #541
2017-07-30 22:59:53 +02:00
Rhys Arkins
7d493a14bf feat: Log warnings when unknown configuration options or option types found (#554)
This PR adds detection and log warnings for the following config validation errors:
- Unknown config option (e.g misspelling of a valid config option)
- Config option is a wrong type (e.g. string instead of boolean)

It does *not* propagate this warning to the user (i.e. in onboarding or PRs) yet due to the high chance that we'll find a false negative. I will watch logs for a week or so and then once happy with results will activate user-visible warnings via #556.

Closes #548, Closes #555
2017-07-28 21:15:27 +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
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
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
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
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
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
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
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
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
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
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
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
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
82357d81bd refactor: logger.trace configs 2017-07-02 06:35:53 +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
45c3124a8f feat: support "enabled" config option at all configuration levels 2017-06-30 16:04:23 +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
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
9e5eb58b74 Remove duplicate log message 2017-06-28 12:33:58 +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
Rhys Arkins
c472b7e6cc Improve onboarding (#367)
* Add branchName to mergeRenovateJson

* Split onboarding into branch and PR

* Update onboarding description

* remove snapshot

* Update tests

* Update onboarding text
2017-06-28 11:23:40 +02:00
Rhys Arkins
a952506259 Perform gitlab terminology translation in api (#366) 2017-06-28 10:10:40 +02:00
Rhys Arkins
463d2fc39d Refactor worker code (#362)
* 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
ae73655c6e Refactor repository worker (#361)
* Add subdirectory

* Move apis tests

* Move onboarding

* Move more apis functions

* Move upgrades

* Refactor index

* Renames
2017-06-26 14:26:49 +02:00