Commit graph

330 commits

Author SHA1 Message Date
Rhys Arkins
9354b5e36c fix(gitfs): add try/catch around deleteBranch 2018-09-10 12:04:27 +02:00
Rhys Arkins
a4107b44c6 fix(gitfs): reset local branches after fetch 2018-09-10 11:59:17 +02:00
Rhys Arkins
085ce43a47 refactor(gitfs): determineBaseBranch 2018-09-10 11:49:26 +02:00
Rhys Arkins
34bb649b39 fix(gitfs): force delete local branch 2018-09-10 11:26:58 +02:00
Rhys Arkins
69ddb156c2 fix(gitfs): prune local branches after fetch
Closes #2490
2018-09-08 17:02:02 +02:00
Rhys Arkins
2e01d4247c fix(gitfs): fetch prune
Closes #2489
2018-09-08 10:09:51 +02:00
Rhys Arkins
55ded1cae1 fix(gitfs): better git dir detection 2018-09-07 21:46:31 +02:00
Rhys Arkins
832706f0d4 tests: skip gitfs.fetch 2018-09-07 13:52:23 +02:00
Rhys Arkins
6190d990c2 fix(gitfs): set new remote before fetching 2018-09-07 13:31:04 +02:00
Rhys Arkins
9fa3ea4e90 refactor: appMode 2018-09-07 06:28:07 +02:00
Rhys Arkins
280c98e243 fix(gitfs): appMode x-access-token 2018-09-06 19:44:36 +02:00
Rhys Arkins
eb61280fe8 fix(github): throw platform error for ETIMEDOUT 2018-09-06 11:30:08 +02:00
Rhys Arkins
73df75d0c0 feat(gitfs): reuse cloned git directory
Closes #2430
2018-09-05 21:51:39 +02:00
Rhys Arkins
bdd30bb2a5 logs: less info 2018-09-05 20:50:13 +02:00
Rhys Arkins
c4f67cf077 refactor: measure git clone time 2018-09-05 16:03:14 +02:00
Rhys Arkins
88c6a48b2a logs: less debug 2018-09-05 15:04:18 +02:00
Rhys Arkins
e2b8cef040 refactor: gitFs configuration option
Adds configuration option gitFs for git-based file operations.
2018-09-05 14:46:36 +02:00
Rhys Arkins
bf3f086240 refactor: clear stats only if more than one request 2018-09-05 14:19:03 +02:00
Rhys Arkins
4539487d26 refactor: less logging 2018-09-05 14:18:31 +02:00
Rhys Arkins
d6b1040de2 refactor: improve get stats 2018-09-05 11:03:47 +02:00
Rhys Arkins
80463651ca feat: logger err serializer
Include body, message and stack with every error if present
2018-09-05 10:32:53 +02:00
Rhys Arkins
8c613a6149 refactor(gitfs): clone depth 2 2018-09-05 06:41:23 +02:00
Rhys Arkins
b54ffa5661 logs: log git fs mode 2018-09-05 06:40:30 +02:00
Rhys Arkins
58b731798e refactor(github): don’t prefetch prList and fileList 2018-09-05 06:34:39 +02:00
Rhys Arkins
f5b93de82d refactor(github): simplify getAllRenovateBranches 2018-09-05 06:23:55 +02:00
Rhys Arkins
a548837b7b fix: maintainer_can_modify for forked PRs
Closes #2476
2018-09-04 18:35:42 +02:00
Rhys Arkins
31a1c11660 feat(github): dump request stats per-repo
Closes #1516
2018-09-04 17:56:28 +02:00
Rhys Arkins
c13c49863e logs: drop retries debug from gh wrapper 2018-09-04 17:45:21 +02:00
Rhys Arkins
9867ac3dc8 refactor: print masked Token when Bad credentials 2018-09-04 14:51:58 +02:00
Rhys Arkins
9572eaa6f9 refactor(github): getBranchList 2018-09-04 06:40:47 +02:00
Rhys Arkins
6f0b477777 fix: revert pagination cache 2018-09-03 18:57:20 +02:00
Rhys Arkins
63f062b13a refactor: better debug cached pagination 2018-09-03 18:32:35 +02:00
Rhys Arkins
6e494d11aa fix: try/catch all cache attempts 2018-09-03 17:52:19 +02:00
Rhys Arkins
1e1cdf8b6d
feat(github): cache pagination results (#2458)
Renovate will cache the results body of any paginated results from GitHub, such as list of Pull Requests or release tags. Then, after receiving the first page of results in future, Renovate will compare the received eTag with the cached eTag and if they match then it will return the cached results instead of querying them again via the GitHub API.

The benefits should be two-fold:
- Reduce the number of API calls required to GitHub
- Reduce the time taken to retrieve such results
2018-09-03 17:35:48 +02:00
Rhys Arkins
8bfe3897de fix(github): platform-error if ENOTFOUND 2018-09-03 10:58:20 +02:00
Hutson Betts
e469cf1a6a feat(gitlab): ignore archived repositories (#2461)
Ignore archived GitLab repositories.

Closes #2437
2018-09-02 21:13:23 +02:00
Rhys Arkins
f510a1999d refactor(gitlab): extra strength cleanup 2018-08-29 13:38:06 +02:00
Rhys Arkins
a88463de05 docs: Bitbucket beta 2018-08-29 07:32:34 +02:00
Vladimir Starkov
608d8c5be0 feat: Bitbucket Cloud support
Adds platform support for Bitbucket cloud.

Closes #136, Closes #2238
2018-08-29 07:30:23 +02:00
Rhys Arkins
e2f51b51ce refactor: RENOVATE_USER_AGENT 2018-08-28 17:07:00 +02:00
Rhys Arkins
d19ac8b666 refactor: log err.headers when rate limit exceeded 2018-08-28 16:10:33 +02:00
Ayoub Kaanich
ce5f434b56 feat: Git FS (#2323)
Methods to support performing Git operation using filesystem instead of web API. GitHub only and experimental only. Usage: define env variable `RENOVATE_GIT_FS`.

Closes #1925
2018-08-25 15:50:49 +02:00
Rhys Arkins
6b6d1bf859 refactor(logs): return logs to app layer 2018-08-23 20:35:25 +02:00
Rhys Arkins
1be6c9f713 refactor(logs): adjust log levels for branch and pr events 2018-08-23 20:11:38 +02:00
Ayoub Kaanich
def2c8f518 refactor: Prepare GitHub storage for Git storage (#2378)
Contains GitHub specific changes from #2323
2018-08-15 07:57:09 +02:00
Ayoub Kaanich
8d3f164f19 refactor(github): move git API into its own file (#2346)
Related to #2323 and #1925
2018-08-06 09:04:08 +02:00
Sarun Intaralawan
ffb96cabcd fix(gitlab): use correct API for closing issues (#2327)
GitLab's API for closing issue is to send a PUT request with `state_event` set to `close`.

Reference: https://docs.gitlab.com/ce/api/issues.html#edit-issue
2018-07-30 11:32:06 +02:00
Rhys Arkins
0a50abbbca fix(github): handle case of no vulnerability alerts 2018-07-28 10:32:25 +02:00
Rhys Arkins
0fa593d5ab feat: log github vulnerability alerts 2018-07-28 08:47:49 +02:00
Rhys Arkins
a01b0b80ba fix(gitlab): html formatting to fix details/summary
Fixes #2317
2018-07-27 19:49:56 +02:00
Rhys Arkins
b932829060 fix: Revert "refactor(github): don’t try/catch getAllRenovateBranches"
This reverts commit ba12183626.
2018-07-27 19:26:18 +02:00
Rhys Arkins
728b44d74a refactor(github): don’t try/catch getBranchCommit 2018-07-26 21:28:10 +02:00
Rhys Arkins
ba12183626 refactor(github): don’t try/catch getAllRenovateBranches 2018-07-26 21:13:41 +02:00
Rhys Arkins
785ff84c31 feat(github): replace github links with renovatebot redirects
Converts to HTML then replaces hrefs to github.com with renovatebot.com/gh/. Skips if non-github.com endpoint detected.

Closes #1804
2018-07-25 19:34:01 +02:00
Rhys Arkins
56de9339b5 fix(github): throw platform-failure for 5xx errors 2018-07-25 15:22:23 +02:00
Rhys Arkins
8c41640c87 fix: pass platform errors up 2018-07-23 16:47:37 +02:00
Rhys Arkins
2bb97240f1 fix(github): detect rate limit correctly 2018-07-23 13:11:56 +02:00
Rhys Arkins
1892b90348 feat(gitlab): use markdown for pr bodies 2018-07-22 22:03:14 +02:00
Rhys Arkins
981d5a1cce feat: set prBody formatting per-platform
Pushes “getPrBody” logic into platform level to allow platforms to individually do things like text replacements and body length limiting.

Closes #2267
2018-07-22 07:47:23 +02:00
Rhys Arkins
2af433094c fix(github): treat 401 Bad Credentials as platform failure 2018-07-21 08:38:13 +02:00
Rhys Arkins
5d0b63bd06 fix(github): try large files only if in root dir 2018-07-20 18:52:23 +02:00
Rhys Arkins
6d86a2753d feat: retry gitlab 429 for up to 5 minutes
Retries every minute up to 5 times if receiving 429 from gitlab.

Closes #1578
2018-07-19 18:17:00 +02:00
Rhys Arkins
ef92d69a88 fix(github): throw error if commit checking fails
Closes #2246
2018-07-12 07:58:31 +02:00
Rhys Arkins
ee4132fd14 refactor: if/else with return 2018-07-09 11:28:42 +02:00
Rhys Arkins
11c4741271 refactor: fix import order 2018-07-09 11:15:06 +02:00
Ayoub Kaanich
219950399e feat: endpoints credentials handling 2018-07-06 07:26:52 +02:00
Rhys Arkins
180e68fd43 feat(github): delete duplicate issues when ensuring issue 2018-07-05 14:05:29 +02:00
Rhys Arkins
0f1d946c90 fix: delete issueList after creating issue
Delete cached issueList after creating any new issue, so that we don’t end up with “old” state and potentially create duplicate issues.
2018-07-05 09:52:31 +02:00
Rhys Arkins
f3c3761772 refactor: opts.useCache
Adds option for useCache to github and gitlab wrappers.
2018-07-05 09:46:36 +02:00
Rhys Arkins
0e83d471fe feat(github): pagination page limit 2018-07-03 11:53:09 +02:00
Rhys Arkins
c99c74b8e4 logs: additional logs for abuse detection rejection 2018-07-02 21:31:37 +02:00
Rhys Arkins
068ff16ec4 fix: Revert "feat: endpoint credentials handling (#2146)"
This reverts commit 04e0ca1f80.
2018-07-02 13:18:37 +02:00
Dragomir Țurcanu
3e19a4708e feat(gitlab): mergeBranch (#2178) 2018-07-02 11:27:08 +02:00
Ayoub Kaanich
04e0ca1f80 feat: endpoint credentials handling (#2146)
Refactors credentials/token handling to rely less on env variables and instead use an endpoints middleware for credentials handling.

First step towards #2105
2018-07-02 10:01:42 +02:00
Rhys Arkins
d2eb44ea04 fix(gitlab): massage state opened -> open
Closes #2200
2018-06-30 23:07:37 +02:00
Marvin Altemeier
a29228398a fix(gitlab): correct prFiles gitlab api (#2192)
Fixes call to Gitlab API.
Settings require direct path to API, the fixed string doubled it
2018-06-29 12:09:11 +02:00
Rhys Arkins
b4f7ed2e0d refactor: simplify mergeBranch 2018-06-28 13:56:08 +02:00
Rhys Arkins
aa4aee0e56
feat: check pr commit author against gitAuthor (#2170)
If gitAuthor is configured, checks that a PR’s commit matches. If not, it is assumed that someone else force pushed to the repo and we should not rebase it.

Closes #2169
2018-06-28 08:45:28 +02:00
Rhys Arkins
57249e105b
feat: pass gitAuthor to platform during init (#2183)
Refactors platforms to take the admin-only `gitAuthor` and `gitPrivateKey` values during repository initialisation instead of during file commits.
2018-06-27 18:40:54 +02:00
Dragomir Țurcanu
eec196b8b8 fix: Update GitLab wrapper and snapshots (#2185) 2018-06-27 10:35:33 +02:00
Dragomir Țurcanu
17005fa3e8 fix: Shortened the URLs in the GitLab wrapper (#2184)
fix: Shortened the URLs in the GitLab wrapper
2018-06-27 10:15:15 +02:00
Rhys Arkins
8da5888ef6 feat: combine branch automergeTypes
This deprecates branch-push and branch-merge-commit automergeTypes and replaces with “branch”, which has the same behaviour as the previous branch-push.

BREAKING CHANGE: branch-merge-commit automergeType behaviour is no longer supported, all branch automerges now use branch push approach.
2018-06-26 14:01:13 +02:00
Rhys Arkins
1362d980b9 logs: info not warn when branch automerge fails 2018-06-26 12:54:57 +02:00
Rhys Arkins
e51f152eaf feat: gitlab recursive file list disabling
For very large repositories, recursing through the entire repo can be very time consuming. Bot admins can now disable file list recursion by setting the env `RENOVATE_DISABLE_FILE_RECURSION=true`. Then only files within the root directory of repositories will be found.

Closes #2172
2018-06-26 12:28:43 +02:00
Rhys Arkins
25ecbb8a18 fix: correct/update all urls
Updates renovateapp -> renovatebot
2018-06-26 11:31:18 +02:00
Rhys Arkins
1b935db8ad fix: skip setBranchStatus when in forkMode 2018-06-26 10:51:27 +02:00
Dragomir Țurcanu
12519bbf8f feat: Add GitLab issue functions (#2150)
This PR adds issue handling functions to the GitLab platform. The implemented functions are `getIssueList`, `ensureIssue` and `ensureIssueClosing` (migrated from GitHub).

Closes #1587
2018-06-21 08:39:24 +02:00
Rhys Arkins
65122fc3ba fix: throw err for bad credentials when fetching commit messages 2018-06-20 07:38:02 +02:00
Rhys Arkins
6916d924c5 refactor(github): log rate limit when receiving bad-credentials 2018-06-19 19:18:01 +02:00
Dragomir Țurcanu
e82e5d0d7b feat: GitLab getPrFiles function (#2131)
This PR integrates the `getPrFiles` function into the GitLab's wrapper.
2018-06-19 13:39:25 +02:00
Rhys Arkins
67c7d9a6cf fix(gitlab): remove absolute gitlab.com api endpoints 2018-06-15 07:20:48 +02:00
Dragomir Țurcanu
188005c91e feat: GitLab wrapper commenting functionality (#2091)
Adds a series of functions related to the commenting aspect of GitLab for the API wrapper. These functions are: `getComments`, `addComment`, `editComment`, `deleteComment`, `ensureComment` and `ensureCommentRemoval`.
2018-06-12 07:18:28 +02:00
Rhys Arkins
801bfbef11 fix(github): don’t check branch protection if fork mode
Closes #2073
2018-06-08 11:33:46 +02:00
Rhys Arkins
98e9198c8e refactor: replace indexOfs 2018-06-04 20:44:32 +02:00
Connor Brathwaite
398303235b (refactor): delegate generic predicate checking to @sindresorhus/is (#2021)
Closes #1764
2018-06-04 20:07:22 +02:00
Rhys Arkins
b6ee52e74d fix(github): do not retry blog size 403s 2018-06-03 09:44:35 +02:00
Dragomir Țurcanu
89978d4ebe fix: GitLab MR rebasing logic (#2006)
Fixed the 404 error on branch rebasing. (GitLab)

Closes #1992
2018-05-23 19:26:56 +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
Ayoub Kaanich
70252b0513 feat(github): parallel paginate (#1973)
Fetch pages 2..10 in parallel

Closes #1944
2018-05-16 07:23:59 +02:00