Commit graph

308 commits

Author SHA1 Message Date
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
039ff55b88 refactor: rename depType docker to Dockerfile 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
renovate[bot]
8866603a46 fix(deps): update dependency get-installed-path to v4 (#892)
* fix(deps): update dependency get-installed-path to v4.0.3

* fix
2017-10-08 06:30:01 +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
913d0cf208 feat: create PRs if branch automerge failed (#888) 2017-10-05 09:31:10 +02:00
Rhys Arkins
5dab080ef7 fix: info message if automerge branch fails (#886)
* fix: info message if automerge branch fails

* fix snapshot
2017-10-04 16:52:50 +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
1c42140475 fix: write npmrc to subdirectories with lock file (#858)
* fix: write npmrc to subdirectories with lock file

* fix lint
2017-09-29 10:42:16 +02:00
Rhys Arkins
6969ff3a36 fix: only massage package name if name exists (#859) 2017-09-29 10:37:02 +02:00
Rhys Arkins
d5f11ad9bd feat: remove {} template strings from package.json name (#855) 2017-09-29 09:18:59 +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
singapore
7ef9e65052 chore: downgrade rebase warning to info 2017-09-28 15:04:27 +02:00
Rhys Arkins
636b5fd82a fix: log npm version when generating lockfile (#836)
Now adds `stdout` and `stderr` from `npm` and `yarn` installs to the "Generated lockfile" log message, so that the exact versions of npm and yarn can be known in the default logs.

Closes #827
2017-09-24 16:53:47 +02:00
Rhys Arkins
fe61fe2e7f fix: add —ignore-engines to yarn install (#831) 2017-09-23 08:05:43 +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
Rhys Arkins
9ff555c74b fix: promisify lockfiles (#826)
`npm` and `yarn` lockfile generation use promisified child process `exec` now instead of `spawnSync`.
2017-09-20 22:56:57 +02:00
Rhys Arkins
d7025f25d6 fix: Detect npm & yarn when globally installed (#825)
This fix improves the way Renovate detects embedded/installed npm and yarn. It tries:
- locally installed npm or yarn
- npm or yarn embedded inside globally installed renovate
- globally installed npm or yarn
- global `yarn` or `npm` commands as fallback

Fixes #824
2017-09-20 07:52:44 +02:00
Rhys Arkins
710d0262e2 fix: logger.info not warn when failing to look up dep (#819) 2017-09-16 08:25:31 +02:00
Rhys Arkins
450b16b459 fix: downgrade dep not found error to warning (#818) 2017-09-16 07:39:27 +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
f9b12dbb3e fix: don’t massage packagefile name (#814) 2017-09-15 13:34:53 +02:00
Rhys Arkins
3956877288 fix: use replace rather than full substitution for invalid package file name (#813) 2017-09-15 12:58:06 +02:00
Rhys Arkins
2e40724856 fix: pass PATH to lockfile scripts (#812) 2017-09-15 11:48:12 +02:00
Rhys Arkins
a4490add1e fix: log lock file generation times (#811) 2017-09-15 09:10:50 +02:00
Rhys Arkins
20542e7529 fix: write only updated package.json files when checking for lock files (#810) 2017-09-14 22:10:51 +02:00
Rhys Arkins
6f60289782 feat: install npm as dependency (#808)
* install npm from npm

* use embedded npm and remove versions checking
2017-09-14 18:24:14 +02:00
Rhys Arkins
e4b62a32b2 fix: pass empty env to lock file scripts (#807) 2017-09-14 18:05:38 +02:00
Rhys Arkins
a8126a383f feat: use yarn as a dependency (#806)
Renovate will now depend on yarn like any other dependency and call this version directly, instead of having an embedded version. This will allow us to "renovate" the yarn version we use too.
2017-09-14 17:57:17 +02:00
singapore
75c9203ae0 fix: more check package.json name 2017-09-14 13:57:28 +02:00
Rhys Arkins
60f54f8a5a fix: Check for package.json name first (#805) 2017-09-14 13:56:09 +02:00
Rhys Arkins
760b128b3e feat: massage package.json files before lock file generation (#804)
- Any package names not matching valid pattern will be rewritten to “dummy”
- “engines” and “scripts” fields will be completely removed

Closes #801, Closes #784
2017-09-14 10:54:41 +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
31b1ee4ef7 refactor: separate npm specifics from package worker (#792) 2017-09-13 21:20:07 +02:00
Rhys Arkins
dd6f3630b6 refactor: move pin config to definitions (#791) 2017-09-13 20:52:07 +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
e5654fc812 fix: convert only first line of commit message to lowercase (#779)
Helps #777
2017-09-07 21:18:50 +02:00
Rhys Arkins
1957bba62d feat: update embedded yarn to v1.0.1 (#778) 2017-09-07 20:34:53 +02:00
Rhys Arkins
4e6c7e2ef5 feat: delete branch if PR creation fails (#774)
This will help “self heal” in cases where the branch becomes invalid and PR creation continually fails.

Closes #773
2017-09-03 10:02:48 +02:00
Rhys Arkins
33d58ce2a3 fix: log prTitle when creating pr (#772) 2017-09-03 06:59:51 +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
5f708c2297 fix: do not restart renovation if automerging failed (#755) 2017-08-31 07:15:53 +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
deac76b015 feat: support timeout for pr creation = not-pending (#748)
We should not leave the PR unopened forever if the branch remains in not-pending state too long. Some status checks may leave the status as “pending” instead of “failed”. Defaults to 12 hours but is configurable.

Closes #747
2017-08-28 11:37:09 +02:00
Rhys Arkins
8ebb32cd87 feat: display extended error in onboarding if lookup fails (#744)
Closes #626
2017-08-27 13:55:41 +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
b0715ba5c0 fix: info not error when lock file fails (#739) 2017-08-26 16:47:21 +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
b4dc6aedb2 fix: don’t throw error if failing to set new package.json value (#737) 2017-08-26 08:02:29 +02:00
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