Commit graph

237 commits

Author SHA1 Message Date
Rhys Arkins
9fdd70232e fix: debug current file content if inserting new value in package.json fails (#735) 2017-08-25 22:43:32 +02:00
Rhys Arkins
3917fc6bae fix: explicitly check automerge = true (#728)
* fix: explicitly check automerge = true

* update presets fixtures and tests

* fix versions tests

* update tests
2017-08-24 12:39:23 +02:00
Rhys Arkins
963a35789e fix: improve ensurePr logs and try/catch (#726) 2017-08-24 10:14:53 +02:00
Rhys Arkins
4bc7009db1 fix: improve schedule massage logic (#725)
- reuse suffix for any “before and after” splits
- move “on every weekday” massage to migrate
2017-08-24 07:04:04 +02:00
Rhys Arkins
5693b17ecf fix: advanced schedules migration (#723)
- Split ‘x and y’ schedule into [x, y]
- Replace schedules like ’on mondays’ with ‘on monday’
2017-08-23 11:50:05 +02:00
Rhys Arkins
52b2de3bdb fix: equalize carriage returns before comparing lock files (#717)
Eliminating one more possibility for #707
2017-08-22 10:46:27 +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
f598c5f899 fix: do not automerge pr if it has been modified (#711)
Add check for pr.canRebase. This will be false if the PR has been modified.

Fixes #790
2017-08-21 11:17:47 +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
d6c5aa6663 fix: info not warn for scoped package 404s (#701) 2017-08-19 07:01:21 +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
f2f15c0650 fix: invalid schedule should only warn in logs (#683) 2017-08-17 11:22:30 +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
3099bf9da1 fix: migrate last day of month schedule to first of month (#680) 2017-08-15 11:54:36 +02:00
Rhys Arkins
06358e32c7 fix: print schedule text along with error message (#679)
* fix: print schedule text along with error message

* update test
2017-08-15 09:13:25 +02:00
Rhys Arkins
26bafe8d7a fix: massage “on every” to “every” in schedules (#677) 2017-08-15 07:18:45 +02:00
Rhys Arkins
c38e2cdcfe fix: wrap and warn non-array schedule (#676) 2017-08-14 22:16:28 +02:00
Rhys Arkins
4a82b7379d fix: better stringify yarn lock error message (#675) 2017-08-14 20:18:26 +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
e9f672060e fix: disable unpublish-safe default (#672)
It was a mistake to enable this feature by default, and should be disabled. A check has been made to set the status to “success” if it was previously “pending” and the setting is now false. This should also cover the case when someone enables it and then disables it.

Fixes #667
2017-08-14 06:27:00 +02:00
Rhys Arkins
99e68cddd3 feat: process all package rules in parent->child order (#666) 2017-08-11 08:03:18 +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
117316c0b1 fix: check current status check before setting (#655)
Fixes #649
2017-08-08 23:03:52 +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
Ika
126e2fdd49 docs(status-checks): fix typo in url (#639) 2017-08-07 05:21:00 +02:00
Rhys Arkins
d7a6bbe367 feat: unpublish-safe status check (#635)
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 #494
2017-08-06 15:38:10 +02:00
Rhys Arkins
ae38fd5d06 fix: return false after successful branch automerge (#631)
This prevents attempts to view the PR or check branch status again.

Fixes #499
2017-08-06 06:36:04 +02:00
Rhys Arkins
99ac394305 fix: lock file generation logger errors (#623) 2017-08-05 06:49:05 +02:00
Rhys Arkins
6d688412b4 fix: parse/stringify lockfile error messages (#622) 2017-08-05 06:20:54 +02:00
Rhys Arkins
a1e1b1770f fix: log full package lock generation error (#621) 2017-08-05 05:53:24 +02:00
Rhys Arkins
ab7884008b fix: always pass logger to getLockFile (#617) 2017-08-04 17:47:03 +02:00
Rhys Arkins
e913feb6ab fix: npm and yarn use branch logger (#615)
Closes #506
2017-08-04 16:23:45 +02:00
Rhys Arkins
5d6652b4bc fix: remove non-functioning yarn cache folder option (#614) 2017-08-04 16:12:24 +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
d14c64ad91 feat: Warn workspaces users (#607)
Links to open issue about workspaces.

Closes #601
2017-08-04 12:06:32 +02:00
Rhys Arkins
b51915912f fix: check for legacy pr title format (#606)
Checks for legacy PR title format so we don't accidentally recreate any of those.
2017-08-04 11:55:49 +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
4a4016f232 fix: escape #issueNumber and backticks in prBody (#602)
Adds a zero width space between the # and first digit in issue numbers to prevent GitHub autolinking, also replaces escaped backticks with `<code></code>`

Closes #595
2017-08-04 07:34:11 +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
3df264501f chore: add warning if yarn workspaces found (#599) 2017-08-03 21:48:58 +02:00
Rhys Arkins
db2e6dd1b9 refactor: Convert Object.assign to spread (#585)
Closes #226
2017-08-03 08:01:20 +02:00
Rhys Arkins
c3b123a83d feat: Advanced package rules (#582)
- Renames `packages` to `packageRules`
- Refactor `packageName` to `packageNames` array
- Refactor `packagePattern` to `packagePatterns` array
- Adds `excludePackageNames` array
- Adds `excludePackagePatterns` array

Closes #529
2017-08-03 07:55:59 +02:00
Rhys Arkins
8809861d3c fix: Circular reference in depTypeConfig (#581) 2017-08-02 21:33:58 +02:00
Rhys Arkins
195988aa0b fix: Incorrect variable used to resolve depTypeConfig (#579) 2017-08-02 16:19:52 +02:00
Rhys Arkins
8f8a4de69f fix: Schedule should always be an array (#580)
Massaging of string to array is done in migration function.
2017-08-02 16:14:09 +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
d9d131de6c feat: Full patch separation support (#572)
This PR adds explicit patch support. A user can set `separatePatchReleases` to true and receive not only major/minor updates but also patch updates separately. This functionality is also implicitly enabled if `automerge` is set to `patch`.
This PR also enables separate major/minor/patch configuration, e.g. config overrides for major versions, for patch versions, etc. `branchName` is currently overridden for patch branches using this technique.

Closes #390, Closes #538
2017-08-01 17:10:53 +02:00
Rhys Arkins
f1d7330f2b fix: Improve PR body fixes for scoped packages (#569)
Escape all scoped package mentions
Escape in group PR bodies too
Remove empty repositoryUrl links
2017-08-01 08:49:41 +02:00
Rhys Arkins
6cd398f0c5 fix: Escape scoped package names in PR bodies (#568)
GitHub attempts to autolink any @user mention and this causes problems when we use scoped npm modules like `@types/gulp`. This escapes such package names with a zero width space to fool GitHub’s parser.

Fixes #518
2017-08-01 07:22:43 +02:00
Rhys Arkins
8374ef6caa fix: Allow ‘@user’ format for assignees and reviewers (#567)
Usernames can now be expressed as like either ‘rarkins’ or ‘@rarkins’
2017-08-01 06:58:13 +02:00
Rhys Arkins
6c7382df14 fix: Check for valid version before performing npm lookup (#565)
Closes #564
2017-07-31 16:03:19 +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
055cfaf73b fix: Don’t warn for any getChangeLogJSON errors (#557) 2017-07-29 10:29:26 +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
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
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
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
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
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
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
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