Commit graph

133 commits

Author SHA1 Message Date
Rhys Arkins
27ee7687d9 fix: skip branch creation if unpublishable pr not ready for creating
Don’t create a branch until its unpublishable.

Fixes 
2018-03-21 11:40:28 +01:00
Rhys Arkins
52ad9d8277
fix: skip branch creation if the updated dependency fails to lock ()
There are times when an npm dependency has an update available yet the “npm/yarn/pnpm install” fails to find it, and the lock file can’t be generated. We check for this any time there’s a lock file error and abort the branch creation, hoping it fixes itself on the next run.

Closes 
2018-03-21 11:17:54 +01:00
Rhys Arkins
2364efdb39 fix: improve lockfile maintenance deletion logic
Set lock file branches to always rebase stale, and delete if there’s no work to do.
2018-03-20 06:48:27 +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 
2018-03-16 10:51:10 +01:00
Rhys Arkins
9119568fe4 fix: add checks if pr branch still exists (gitlab)
in GitLab, a PR may be open while the branch itself has been removed. We cant just assume that the branch exists because the PR does, even if it’s an edge case.
2018-02-28 04:43:30 +01:00
Rhys Arkins
9766a94fbf fix: check for truthy arrays before checking length 2018-02-11 19:58:59 +01:00
Rhys Arkins
5e767472ee fix: check for prHourlyLimitReached before generating lockfiles 2018-02-08 20:07:32 +01:00
Rhys Arkins
dc1bcee68e chore: downgrade closed PR warning to info 2018-02-07 12:03:49 +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
a7083c5688 refactor: Recommend blocking PRs be renamed and not reopened 2018-01-23 10:50:05 +01:00
Rhys Arkins
fa68a5a216 refactor: skip ignore notification comment if PR was merged 2018-01-20 15:09:23 +01:00
Rhys Arkins
dba574950b
feat: baseBranches (multi-branch) support ()
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 
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 
2018-01-11 11:56:16 +01:00
Rhys Arkins
21a6b1acea fix: delete blocking branch if it still exists 2018-01-10 10:26:57 +01:00
Rhys Arkins
8684ff8a6b fix: don’t debug log the open pr twice 2017-12-30 06:29:40 +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
97fc3e6135 fix: pr should be ensured if branch automerge previously failed
If branch automerge *previously* failed, then still make sure we are keeping the PR up to date.

Closes 
2017-12-28 17:19:59 +01:00
Rhys Arkins
1a3b0b61ea refactor: remove edited PR comment and log warn instead 2017-12-28 16:29:03 +01:00
Rhys Arkins
6b91b87dee feat: stop updating PR if edited
Previously, Renovate would attempt to keep a branch up to date even if users had edited it. e.g. adding commits on top of the existing branch if newer versions were released. Now, Renovate adds a warning comment if a user has edited a branch, making it clear that responsibility for the branch is over to them and how they can undo this.

Closes 
2017-12-27 15:20:32 +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 
2017-12-26 06:26:33 +01:00
Rhys Arkins
bf6d774cfc refactor: simplify duplicate removal of dependency names 2017-12-15 21:33:54 +01:00
Rhys Arkins
4a57cfd3cd
fix: only return no-work if branch doesn’t exist () 2017-11-28 09:00:59 +01:00
Rhys Arkins
eabff37a15
fix: exit gracefully if no files to commit ()
This handles case where checking for lock file maintenance but lock file is up-to-date.
2017-11-27 08:25:07 +01:00
Rhys Arkins
804d7ba955 refactor: don't cache lock files ()
* refactor: don’t store yarn.lock content in packageFile

* chore: don’t log full lockfile

* refactor: don’t save package-lock.json

* update tests
2017-11-17 14:53:29 +01:00
Rhys Arkins
0e81a88a54 fix: drop branchExists check after create () 2017-11-16 23:51:47 +01:00
Rhys Arkins
d3955f1a32
fix: only remove lock file warning comment when successfully updating… () 2017-11-16 21:54:13 +01:00
Rhys Arkins
ca5b080aac
refactor: check blocked PR before checking schedule ()
Instead of checking schedule first, now we check first if the PR is blocked by a closed PR. This provides more consistent feedback.

Closes 
2017-11-10 13:32:33 +01:00
Rhys Arkins
0bc2953113
fix: lock file stderr was not being included in pr comments () 2017-11-08 13:26:55 +01:00
Rhys Arkins
8c479071fd
refactor: use global logger () 2017-11-08 06:44:03 +01:00
Rhys Arkins
602752f9fe
refactor: use platform global () 2017-11-07 13:31:34 +01:00
renovate[bot]
c1df1b2cb8 chore(deps): update dependency prettier to v1.8.0 ()
* 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 () 2017-11-07 11:46:10 +01:00
Rhys Arkins
31e7c8a881 refactor: move languages from branch worker to manager () 2017-10-25 06:48:08 +02:00
Rhys Arkins
2fa50b3771 feat: rebase branch whenever versions need updating () 2017-10-21 16:42:40 +02:00
Rhys Arkins
76ddde1cb5 fix: ignored digest pr comment () 2017-10-20 06:55:52 +02:00
Rhys Arkins
00dabb5dc1 feat: raise pr with warning if lock file generation fails ()
Previously, upgrades with failing lock files were not raised as PRs. Usually this is because of missing private module configuration. Now, Renovate will raise a PR but add a comment warning of the error, with the error log. It's raised as a comment because we now won't need to regenerate the lock file error every run, and we don't want to "lose" it if the PR description gets updated.

Closes 
2017-10-19 14:05:10 +02:00
Rhys Arkins
01211f119f fix: strip duplicates from dependencies log
* fix: strip duplicates from dependencies log

* chore: update prAlreadyExisted log messages
2017-10-18 21:39:10 +02:00
Rhys Arkins
f980fea6ca feat: comment in closed PR when it is blocking an update (github) ()
This feature adds a new behaviour to Renovate, where it will now add a comment to any existing closed PRs that are "blocking" currently valid updates. A new API function "ensureComment" has been added, its purpose is so we can ensure there exists only one comment with a certain subject/heading. This lets us prevent duplicates as well as update existing, without having to keep state about it. ensureComment needs porting to gitlab, but should be quite easy.
2017-10-18 15:28:51 +02:00
Rhys Arkins
1a174226ed feat: keep branches/PRs updated when out of schedule ()
By default, Renovate will now continue *updating* - but not creating - branches even if off-schedule. This applies to features such as (a) rebasing branches if master changes, (b) updating if new version comes, (c) creating PRs if tests pass, (d) automerging. It is planned that (b) will be configurable in a future feature. To disable this behaviour altogether, set updateNotScheduled to false.

Closes 
2017-10-13 06:42:17 +02:00
Rhys Arkins
913d0cf208 feat: create PRs if branch automerge failed () 2017-10-05 09:31:10 +02:00
Rhys Arkins
bae9ae0595 feat: stop branch processing after lock file error or pin dependencies ()
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
6e9c73e35a feat: restart repo renovate after automerge ()
Previously, the automerge feature was causing some undesirable behaviour when multiple branches were open at the same time. Example: . 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 
2017-08-28 15:50:11 +02:00
Rhys Arkins
8ebb32cd87 feat: display extended error in onboarding if lookup fails ()
Closes 
2017-08-27 13:55:41 +02:00
Rhys Arkins
b0715ba5c0 fix: info not error when lock file fails () 2017-08-26 16:47:21 +02:00
Rhys Arkins
ea9ace2a76 feat: branch worker updates ()
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
3917fc6bae fix: explicitly check automerge = true ()
* 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
21aa961264 feat: re-use node_modules per package file ()
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 
2017-08-22 06:28:46 +02:00
Rhys Arkins
b657d3c291 feat: support lock file maintenance automerge ()
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 
2017-08-21 13:41:48 +02:00
Rhys Arkins
e9f672060e fix: disable unpublish-safe default ()
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 
2017-08-14 06:27:00 +02:00
Rhys Arkins
117316c0b1 fix: check current status check before setting ()
Fixes 
2017-08-08 23:03:52 +02:00
Ika
126e2fdd49 docs(status-checks): fix typo in url () 2017-08-07 05:21:00 +02:00
Rhys Arkins
d7a6bbe367 feat: unpublish-safe status check ()
Renovate now adds a status check renovate/unpublish-safe that has the following behaviour:
If any upgrade in the branch is < 24 hours old then the status check state is "pending"
If all upgrades in the branch are 24 hours or more old then the status check state is "success"
This is able to be disabled via a new option "unpublishSafe".

Closes 
2017-08-06 15:38:10 +02:00
Rhys Arkins
ae38fd5d06 fix: return false after successful branch automerge ()
This prevents attempts to view the PR or check branch status again.

Fixes 
2017-08-06 06:36:04 +02:00
Rhys Arkins
a1e1b1770f fix: log full package lock generation error () 2017-08-05 05:53:24 +02:00
Rhys Arkins
ab7884008b fix: always pass logger to getLockFile () 2017-08-04 17:47:03 +02:00
Rhys Arkins
5d6652b4bc fix: remove non-functioning yarn cache folder option () 2017-08-04 16:12:24 +02:00
Rhys Arkins
e7ce772e94 feat: Make semanticPrefix implicit in templates ()
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
b51915912f fix: check for legacy pr title format ()
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
6c1f27f905 fix: semantic commit messages should always be lower case ()
commitMessage and prTitle will be converted to lowercase after compilation if semanticCommits=true

Fixes 
2017-08-03 21:49:44 +02:00
Rhys Arkins
db2e6dd1b9 refactor: Convert Object.assign to spread ()
Closes 
2017-08-03 08:01:20 +02:00
Rhys Arkins
2331d6e840 feat(branch): Check for rebase if repo branch protection is strict ()
We now check branch protection configuration for the repository's base branch to see if branches must be kept up-to-date. If so then we check Renovate branches for rebasing even if rebaseStalePrs is not set to true.

Closes 
2017-07-25 18:18:19 +02:00
Rhys Arkins
c22fc69785 fix(branch): Add check before rebasing stale PRs ()
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 
2017-07-25 15:07:53 +02:00
Rhys Arkins
2bd452281f fix(npm): Run npm install with —ignore-scripts 2017-07-24 06:54:13 +02:00
Rhys Arkins
47044a11e1 feat(yarn): Use embedded yarn version ()
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
8e48d97392 feat(logs): Support custom log detail fields
This removes the need to JSON.stringify() objects in logs. Default bunyan fields plus our custom meta fields are stripped out, and everything else is stringified in the details field.

Closes 
2017-07-19 08:05:26 +02:00
Rhys Arkins
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
1395187ccc feat(npm): Support packagelock.json maintenance ()
Renovate will now "maintain" npm@5's `package-lock.json` files on the same schedule as existing `yarn.lock` maintenance.

Closes 
2017-07-07 13:57:43 +02:00
Rhys Arkins
6bd74c979d refactor: send config to ensurePr 2017-07-07 12:37:33 +02:00
Rhys Arkins
04e20dce8e feat: Prune all orphan branches ()
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 , Closes 
2017-07-07 06:25:38 +02:00
Rhys Arkins
48c960b841 refactor: Move generateConfig code from branchWorker to repositoryWorker ()
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
ea4e370d3f feat: Prune stale branches ()
A separate routine is run after branch creation to detect any branches that should be deleted. A branch will be removed if:
- It was not created by renovate in the last run, AND
- It has no PR, or its corresponding PR is not mergeable

Closes , Closes 
2017-07-05 11:57:22 +02:00
Rhys Arkins
1716e122cd feat: expand PR errors ()
Errors in PRs are expanded to include:
- If renovate.json parsing fails
- If an empty or unparseable package.json was found

Closes 
2017-07-05 07:12:25 +02:00
Rhys Arkins
c30472dd43 feat: Add ability to skip status checks for automerge ()
This starts off [](https://github.com/singapore/renovate/issues/359) (configurable status checks) but only implements one sub-feature of it: disabling status checks to allow automerge if tests fail or if no tests are present.
2017-07-05 07:02:25 +02:00
Rhys Arkins
e0e0b259c3 feat: Show warnings and errors in regular PRs ()
If errors or warnings are present, they will be displayed in the PR body of all PRs now (not just onboarding).

Closes 
2017-07-04 13:52:23 +02:00
Rhys Arkins
1cf8330125 fix: group branchName handlebars error
Closes 
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
372b445260 refactor: set recreateClosed in group and lockFileMaintenance 2017-07-02 06:25:42 +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 

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
0ac3625e4f fix: more semanticCommitsEnabled -> semanticCommits 2017-06-30 06:04:15 +02:00
Rhys Arkins
4c79dae98c feat: semantic commit support ()
Defaults to disabled. Included in onboarding.

Closes 
2017-06-29 19:50:26 +02:00
Rhys Arkins
552b5e68c5 Refactor helpers ()
* Move yarn and npm helpers into branch worker

* Fix name

* Move package-json helper

* Update name

* Move changelog

* Move github-app

* Remove unused platform

* Move logger

* Fix lint
2017-06-29 07:29:41 +02:00
Renamed from lib/workers/branch.js (Browse further)