Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • smartdatalab/public/applications/renovate
1 result
Select Git revision
Show changes
Commits on Source (1000)
Showing with 576 additions and 145 deletions
{
"presets": [
[
"@babel/env",
{
"targets": {
"node": true
}
}
],
"@babel/typescript"
],
"plugins": [
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread"
],
"sourceMaps": true,
"retainLines": true
}
version: 2.1
commands:
test:
steps:
- checkout
- run:
name: Initial Setup
command: |
python --version
python3 --version
curl https://bootstrap.pypa.io/get-pip.py | python
pip --version
git config --global user.email "bot@renovateapp.com"
git config --global user.name "Renovate Bot"
git --version
- run:
name: Installing Dependencies
command: |
yarn install --frozen-lockfile
pip install --user -r requirements.txt
- save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- '.cache'
- '.eslintcache'
- run:
name: Lint
command: |
yarn lint
yarn test-schema
- run:
name: Build
command: |
yarn build
- run:
name: Unit Tests
command: |
yarn jest --runInBand
- run:
name: E2E Tests
command: |
yarn test-e2e
- run:
name: Coverage
command: |
bash <(curl -s https://codecov.io/bash) -Z -C $CIRCLE_SHA1
jobs:
test_node_10:
docker:
- image: amd64/node:10.16.0@sha256:7af3328e235a92c949e0b7c3c738b4c3d05ceb82306fddbe75136f2e7842e6f4
steps:
- test
test_node_12:
docker:
- image: amd64/node:12.5.0@sha256:78acf4f4a80d23f94546bf80c174b182c43c1ca88befa9bfbc36878085e14ecf
steps:
- test
release:
docker:
- image: amd64/node:10.16.0@sha256:7af3328e235a92c949e0b7c3c738b4c3d05ceb82306fddbe75136f2e7842e6f4
steps:
- checkout
- run: yarn install --frozen-lockfile
- run: yarn build
- run: yarn semantic-release
- run: curl -X POST -d '{}' $NETLIFY_DEPLOY_WEBHOOK
workflows:
version: 2
test_and_release:
jobs:
- test_node_10
- test_node_12
- release:
requires:
- test_node_10
- test_node_12
filters:
branches:
only:
- master
......@@ -4,3 +4,5 @@
!hooks
!lib
!bin/yarn*
!tsconfig*.json
!data
test/_fixtures
test/**/**/_fixtures
......@@ -2,23 +2,46 @@ module.exports = {
env: {
node: true,
},
extends: ['airbnb-base', 'prettier'],
plugins: ['import', 'promise'],
extends: [
'plugin:promise/recommended',
'plugin:@typescript-eslint/recommended',
'airbnb-typescript/base',
'prettier',
'prettier/@typescript-eslint',
],
parserOptions: {
ecmaVersion: 9,
project: './tsconfig.json',
},
rules: {
'import/no-unresolved': 0, // only required for js, see overrides
'require-await': 'error',
'no-use-before-define': 0,
'no-restricted-syntax': 0,
'no-await-in-loop': 0,
'prefer-destructuring': 'off',
'prefer-template': 'off',
'promise/always-return': 'error',
'promise/no-return-wrap': 'error',
'promise/param-names': 'error',
'promise/catch-or-return': 'error',
'promise/no-native': 'off',
'promise/no-nesting': 'warn',
'promise/no-promise-in-callback': 'warn',
'promise/no-callback-in-promise': 'warn',
'promise/avoid-new': 'warn',
'no-underscore-dangle': 0,
// TODO: fix lint
'@typescript-eslint/camelcase': 'off', // disabled until ??
'@typescript-eslint/no-var-requires': 'off', // disable until all files converted to typescript
'@typescript-eslint/no-use-before-define': 'off', // disable until all files converted to typescript
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-non-null-assertion': 0,
},
overrides: [
{
// TODO: should be removed in near future, uses around ~50% lint time
files: ['*.js'],
rules: {
'import/no-unresolved': [
'error',
{ commonjs: true, caseSensitive: true },
],
},
},
],
};
......@@ -6,11 +6,11 @@ If you think you've found a **security issue**, please do not mention it in this
## Support
If you have a **configuration question**, please create an issue in https://github.com/renovateapp/config-help
If you have a **configuration question**, please create an issue in https://github.com/renovatebot/config-help
## Bug Reports and Feature Requests
If you've found a **bug** or have a **feature request** then please create an issue here (but search first in case it already exists).
If you've found a **bug** or have a **feature request** then please create an issue in this repository (but search first in case a similar issue already exists).
## Code
......@@ -23,6 +23,12 @@ afterwards. Also, let the maintainers know that you plan to work on a particular
Pull Requests can only be merged once all status checks are green, which means `yarn test` passes, and coverage is 100%.
## Slack collaboration with maintainers
We won't lie - sometimes the codebase can be a challenge to navigate. We don't want you spending an hour trying to work out something that might take us a minute to explain.
For that reason, we host a Slack channel dedicated to helping anyone who's working on PRs for Renovate. It's strictly developers-only and not intended for general support, so please email support@renovatebot.com to ask to be added.
## Legal
Pull Request authors must sign the [Renovate CLA](https://cla-assistant.io/renovateapp/renovate).
......
......@@ -6,8 +6,9 @@
.DS_Store
.cache
/*.log
/.vscode
/.idea
package-lock.json
/package-lock.json
*.pyc
renovate-0.0.0-semantic-release.tgz
/e2e/node_modules
.eslintcache
......@@ -9,5 +9,5 @@
.cache
/*.log
package.json
test/_fixtures/
test/**/**/_fixtures
bin/yarn*
notifications:
email: false
language: node_js
node_js:
- '10.15.0'
sudo: false
branches:
only:
- master
- stable
- v13
if: tag IS blank
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
- python --version
install:
- yarn install --frozen-lockfile
- pip install --user -r requirements.txt
cache:
yarn: true
directories:
- '.cache'
- '.eslintcache'
- 'node_modules'
script:
- yarn prettier --list-different
- yarn lint
- yarn jest --maxWorkers=4
after_success:
- yarn codecov
deploy:
provider: script
script: curl -X POST -d '{}' $NETLIFY_DEPLOY_WEBHOOK && yarn semantic-release
skip_cleanup: true
on:
branch: master
{
"recommendations": [
"EditorConfig.editorconfig",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"Orta.vscode-jest"
]
}
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "debug",
"program": "${workspaceFolder}/lib/renovate.ts",
"env": { "LOG_LEVEL": "debug" },
"console": "integratedTerminal",
"disableOptimisticBPs": true,
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/babel-node",
"runtimeArgs": ["--nolazy", "--extensions", ".ts,.js"],
"protocol": "inspector",
"skipFiles": ["<node_internals>/**/*.js"]
},
{
"type": "node",
"request": "launch",
"name": "Jest Current File",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"--runInBand",
"--collectCoverage=false",
"${fileBasenameNoExtension}"
],
"env": { "LOG_LEVEL": "debug" },
"console": "integratedTerminal",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
},
"runtimeArgs": ["--nolazy", "--preserve-symlinks"],
"protocol": "inspector",
"skipFiles": ["<node_internals>/**/*.js"]
},
{
"type": "node",
"request": "launch",
"name": "Jest All",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["--runInBand", "--collectCoverage=false"],
"env": { "LOG_LEVEL": "debug" },
"console": "integratedTerminal",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
},
"runtimeArgs": ["--nolazy", "--preserve-symlinks"],
"protocol": "inspector",
"skipFiles": ["<node_internals>/**/*.js"]
}
]
}
{
"eslint.validate": [
"javascript",
{ "language": "typescript", "autoFix": true }
],
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
FROM amd64/ubuntu:18.04@sha256:eb5d7eda6804359e4fc5223a31a2d9caa4c8ea590b14060d81c8bc05b22ca04e
FROM amd64/node:10.16.0 AS tsbuild
COPY package.json .
COPY yarn.lock .
RUN yarn install --frozen-lockfile
COPY lib lib
COPY tsconfig.json tsconfig.json
COPY tsconfig.app.json tsconfig.app.json
RUN yarn build
FROM amd64/ubuntu:18.04@sha256:eb70667a801686f914408558660da753cde27192cd036148e58258819b927395
LABEL maintainer="Rhys Arkins <rhys@arkins.net>"
LABEL name="renovate"
LABEL org.opencontainers.image.source="https://github.com/renovatebot/renovate"
WORKDIR /usr/src/app/
......@@ -9,13 +23,17 @@ ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
RUN apt-get update && apt-get install -y gpg curl wget unzip xz-utils git openssh-client && apt-get clean -y
RUN apt-get update && apt-get install -y gpg curl wget unzip xz-utils git openssh-client bsdtar && apt-get clean -y
## Gradle
RUN apt-get update && apt-get install -y --no-install-recommends openjdk-8-jdk gradle && apt-get clean -y
## Node.js
# START copy Node.js from https://github.com/nodejs/docker-node/blob/master/10/jessie/Dockerfile
ENV NODE_VERSION 10.15.0
ENV NODE_VERSION 10.16.0
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
&& case "${dpkgArch##*-}" in \
......@@ -50,7 +68,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& bsdtar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs
......@@ -60,7 +78,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
RUN apt-get update && apt-get install -y php-cli php-mbstring && apt-get clean
ENV COMPOSER_VERSION=1.7.2
ENV COMPOSER_VERSION=1.8.6
RUN php -r "copy('https://github.com/composer/composer/releases/download/$COMPOSER_VERSION/composer.phar', '/usr/local/bin/composer');"
......@@ -68,7 +86,9 @@ RUN chmod +x /usr/local/bin/composer
# Go Modules
ENV GOLANG_VERSION 1.11.1
RUN apt-get update && apt-get install -y bzr && apt-get clean
ENV GOLANG_VERSION 1.12
RUN wget -q -O go.tgz "https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz" && \
tar -C /usr/local -xzf go.tgz && \
......@@ -82,6 +102,17 @@ RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
ENV CGO_ENABLED=0
# Python
RUN apt-get update && apt-get install -y python3.7-dev python3-distutils && apt-get clean
RUN rm -fr /usr/bin/python3 && ln /usr/bin/python3.7 /usr/bin/python3
RUN rm -rf /usr/bin/python && ln /usr/bin/python3.7 /usr/bin/python
# Pip
RUN curl --silent https://bootstrap.pypa.io/get-pip.py | python
# Set up ubuntu user
RUN groupadd --gid 1000 ubuntu \
......@@ -89,17 +120,53 @@ RUN groupadd --gid 1000 ubuntu \
RUN chmod -R a+rw /usr
# Docker client and group
RUN groupadd -g 999 docker
RUN usermod -aG docker ubuntu
ENV DOCKER_VERSION=18.09.2
RUN curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz \
&& tar xzvf docker-${DOCKER_VERSION}.tgz --strip 1 \
-C /usr/local/bin docker/docker \
&& rm docker-${DOCKER_VERSION}.tgz
USER ubuntu
ENV YARN_VERSION=1.13.0
# Pipenv
ENV PATH="/home/ubuntu/.local/bin:$PATH"
RUN pip install --user pipenv
# Poetry
RUN curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
RUN npm i -g yarn@${YARN_VERSION}
ENV PATH="/home/ubuntu/.poetry/bin:$PATH"
RUN poetry config settings.virtualenvs.create false
# npm
ENV NPM_VERSION=6.9.0
RUN npm install -g npm@$NPM_VERSION
# Yarn
ENV YARN_VERSION=1.16.0
RUN curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}
ENV PATH="/home/ubuntu/.yarn/bin:/home/ubuntu/.config/yarn/global/node_modules/.bin:$PATH"
COPY package.json .
COPY yarn.lock .
RUN yarn install --production && yarn cache clean
COPY lib lib
RUN yarn install --production --frozen-lockfile && yarn cache clean
COPY --from=tsbuild dist dist
COPY bin bin
COPY data data
ENTRYPOINT ["node", "/usr/src/app/lib/renovate.js"]
CMD ["--help"]
ENTRYPOINT ["node", "/usr/src/app/dist/renovate.js"]
CMD []
const fs = require('fs-extra');
const os = require('os');
const path = require('path');
(async () => {
await fs.remove(os.tmpdir() + '/renovate');
const tmpDir = process.env.RENOVATE_TMPDIR || os.tmpdir();
const baseDir = path.join(tmpDir, 'renovate');
console.log('Removing ' + baseDir);
await fs.remove(baseDir);
})();
#!/usr/bin/env node
const fs = require('fs-extra');
const { validateConfig } = require('../lib/config/validation');
const { massageConfig } = require('../lib/config/massage');
const { initLogger } = require('../lib/logger');
const { configFileNames } = require('../lib/config/app-strings');
const os = require('os');
const { validateConfig } = require('../dist/config/validation');
const { massageConfig } = require('../dist/config/massage');
const { getConfig } = require('../dist/config/file');
const { initLogger } = require('../dist/logger');
const cache = require('../dist/workers/global/cache');
const { configFileNames } = require('../dist/config/app-strings');
initLogger();
// istanbul ignore if
if (!global.renovateCache) {
cache.init(os.tmpdir());
}
/* eslint-disable no-console */
let returnVal = 0;
......@@ -37,7 +43,7 @@ async function validate(desc, config, isPreset = false) {
const jsonContent = JSON.parse(rawContent);
await validate(file, jsonContent);
} catch (err) {
console.log(`${file} is not valid JSON`);
console.log(`${file} is not valid Renovate config`);
returnVal = 1;
}
} catch (err) {
......@@ -59,6 +65,18 @@ async function validate(desc, config, isPreset = false) {
} catch (err) {
// ignore
}
try {
const fileConfig = getConfig(process.env);
console.log(`Validating config.js`);
try {
await validate('config.js', fileConfig);
} catch (err) {
console.log(`config.js is not valid Renovate config`);
returnVal = 1;
}
} catch (err) {
// ignore
}
if (returnVal !== 0) {
process.exit(returnVal);
}
......
const fs = require('fs');
const upath = require('upath');
const { getOptions } = require('../lib/config/definitions');
const schema = {
title: 'JSON schema for Renovate config files (https://renovatebot.com/)',
$schema: 'http://json-schema.org/draft-04/schema#',
type: 'object',
properties: {},
};
const options = getOptions();
const properties = {};
function createSingleConfig(option) {
const temp = {};
if (option.description) {
temp.description = option.description;
}
temp.type = option.type;
if (temp.type === 'array') {
if (option.subType) {
temp.items = {
type: option.subType,
};
if (option.format) {
temp.items.format = option.format;
}
if (option.allowedValues) {
temp.items.enum = option.allowedValues;
}
}
} else {
if (option.format) {
temp.format = option.format;
}
if (option.allowedValues) {
temp.enum = option.allowedValues;
}
}
if (option.default !== undefined) {
temp.default = option.default;
}
if (temp.type === 'object' && !option.freeChoice) {
temp.$ref = '#';
}
return temp;
}
function createSchemaForParentConfigs() {
for (const option of options) {
if (!option.parent) {
properties[option.name] = createSingleConfig(option);
}
}
}
function addChildrenArrayInParents() {
for (const option of options) {
if (option.parent) {
properties[option.parent].items = {
allOf: [
{
type: 'object',
properties: {},
},
],
};
}
}
}
function createSchemaForChildConfigs() {
for (const option of options) {
if (option.parent) {
properties[option.parent].items.allOf[0].properties[
option.name
] = createSingleConfig(option);
}
}
}
function generateSchema() {
createSchemaForParentConfigs();
addChildrenArrayInParents();
createSchemaForChildConfigs();
schema.properties = properties;
fs.writeFileSync(
upath.join(__dirname, '../renovate-schema.json'),
JSON.stringify(schema, null, 2),
'utf-8'
);
}
generateSchema();
{
"v0.10": {
"start": "2013-03-11",
"end": "2016-10-31"
},
"v0.12": {
"start": "2015-02-06",
"end": "2016-12-31"
},
"v4": {
"start": "2015-09-08",
"lts": "2015-10-12",
"maintenance": "2017-04-01",
"end": "2018-04-30",
"codename": "Argon"
},
"v5": {
"start": "2015-10-29",
"maintenance": "2016-04-30",
"end": "2016-06-30"
},
"v6": {
"start": "2016-04-26",
"lts": "2016-10-18",
"maintenance": "2018-04-30",
"end": "2019-04-30",
"codename": "Boron"
},
"v7": {
"start": "2016-10-25",
"maintenance": "2017-04-30",
"end": "2017-06-30"
},
"v8": {
"start": "2017-05-30",
"lts": "2017-10-31",
"maintenance": "2019-01-01",
"end": "2019-12-31",
"codename": "Carbon"
},
"v9": {
"start": "2017-10-01",
"maintenance": "2018-04-01",
"end": "2018-06-30"
},
"v10": {
"start": "2018-04-24",
"lts": "2018-10-30",
"maintenance": "2020-04-01",
"end": "2021-04-01",
"codename": "Dubnium"
},
"v11": {
"start": "2018-10-23",
"maintenance": "2019-04-22",
"end": "2019-06-01"
},
"v12": {
"start": "2019-04-23",
"lts": "2019-10-22",
"maintenance": "2021-04-01",
"end": "2022-04-01",
"codename": ""
},
"v13": {
"start": "2019-10-22",
"maintenance": "2020-04-20",
"end": "2020-06-01"
},
"v14": {
"start": "2020-04-21",
"lts": "2020-10-20",
"maintenance": "2022-04-01",
"end": "2023-04-01",
"codename": ""
}
}
......@@ -7,7 +7,7 @@ Configuration is supported via any or all of the below:
- Configuration file
- Environment
- CLI
- `renovate.json`, `.github/renovate.json`, `.renovaterc.json`, or `.renovaterc` in target repository
- `renovate.json`, `renovate.json5`, `.github/renovate.json`, `.github/renovate.json5`, `.renovaterc.json`, or `.renovaterc` in target repository
- `renovate` field of `package.json` in target repository
The above are listed in reverse order of preference. i.e. `package.json`
......@@ -32,29 +32,11 @@ different set for `frontend/package.json` in the same repository.
```javascript
module.exports = {
labels: ['upgrade'],
repositories: [
{
repository: 'singapore/repo1',
packageRules: [
{
paths: ['frontend/package.json'],
labels: ['upgrade', 'frontend'],
},
],
},
{
repository: 'singapore/repo2',
labels: ['renovate'],
},
'singapore/repo3',
],
packageRules: [
{
packageNames: ['jquery'],
labels: ['jquery', 'uhoh'],
},
],
npmrc: '//registry.npmjs.org/:_authToken=abc123',
baseDir: '/tmp/renovate',
logLevel: 'debug',
includeForks: true,
gradle: { enabled: false },
};
```
......
......@@ -5,7 +5,7 @@ This file documents the design choices as well as configuration options.
#### Stateless
No state storage is needed on `renovate` or the source code repository apart
from what you see publicly (branches, Pull Requests). It therefore doesn't
from what you see publicly (branches, Pull Requests). It, therefore, doesn't
matter if you stop/restart the script and would even still work if you had it
running from two different locations, as long as their configuration was the
same.
......@@ -21,7 +21,7 @@ all operations are performed via the API.
The script current processes repositories, package files, and dependencies
within them all synchronously.
- Greatly reduces chance of hitting simultaneous API rate limits
- Greatly reduces the chance of hitting simultaneous API rate limits
- Simplifies logging
Note: Initial queries to NPM are done in parallel.
......@@ -41,11 +41,10 @@ are global (all repositories).
## Automatic discovery of package.json locations
Default behaviour is to auto-discover all `package.json` locations in a
The default behaviour is to auto-discover all `package.json` locations in a
repository and process them all. Doing so means that "monorepos" are supported
by default. This can be overridden by the configuration option `includePaths`,
where you list the file paths manually (e.g. limit to just `package.json` in
root of repository).
where you list the file paths manually (e.g. limit to just `package.json` in the root of the repository).
## Separate Branches per dependency
......@@ -63,7 +62,7 @@ the value `All`) and then all dependency updates will be in the same branch/PR.
## Separate Minor and Major PRs
`renovate` will create multiple branches/PRs if both major and minor branch upgrades
are available. For example if the current example is 1.6.0 and upgrades to 1.7.0
are available. For example, if the current example is 1.6.0 and upgrades to 1.7.0
and 2.0.0 exist, then `renovate` will raise PRs for both the 1.x upgrade(s) and
2.x upgrade(s).
......@@ -90,7 +89,7 @@ Note: Branch names are configurable using string templates.
## Pull Request Recreation
By default, the script does not create a new PR if it finds an identical one
already closed. This allows users to close unwelcome upgrade PRs and worry about
already closed. This allows users to close unwelcome upgrade PRs and not worry about
them being recreated every run. Typically this is most useful for major
upgrades. This option is configurable.
......
......@@ -11,7 +11,7 @@ If you will contribute to the project, you should first "fork" the main project
#### Node version
Renovate supports node.js versions 8 and above. Use a version manager like `nvm` or `n` if you'll need to switch between versions easily.
Renovate supports Node.js `>= 10.13.0 <11.0.0`. Use a version manager like `nvm` or `n` if you'll need to switch between versions easily.
#### Install dependencies
......@@ -22,7 +22,7 @@ We use [yarn](https://github.com/yarnpkg/yarn) so run `yarn install` to install
Run `yarn start`. You should see this error:
```
FATAL: Renovate fatal error: You need to supply a GitHub token.
Fatal error: No authentication found for platform https://api.github.com/ (github)
```
## Platform Account Setup
......@@ -37,7 +37,7 @@ e.g. if your GitHub username is "alex88" then maybe you register "alex88-testing
#### Generate platform token
Once you have decided on your platform and account, log in and [generate a "Personal Access Token"](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) that can be used to authenticate Renovate.
Once you have decided on your platform and account, log in and [generate a "Personal Access Token"](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) that can be used to authenticate Renovate. Select **repo** scope when generating the token.
#### Export platform token
......@@ -58,6 +58,12 @@ You can run `yarn test` locally to test your code. We test all PRs using the sam
You can run just the Jest unit tests by running `yarn jest`. You can also run just a subset of the Jest tests using file matching, e.g. `yarn jest composer` or `yarn jest workers/branch`. If you get a test failure due to a "snapshot" mismatch, and you are sure that you need to update the snapshot, then you can append `-u` to the end. e.g. `yarn jest composer -u` would update the saved Snapshots for _all_ tests in `test/manager/composer/*`.
#### Prerequisites
You need to have Python with `mock` installed for all tests to pass. Version 3.7 of Python includes `mock` so that approach is recommended.
You also need to make sure that you don't have a local `.npmrc` file that overrides npm's default registry.
#### Coverage
The Renovate project maintains 100% test coverage, so any Pull Request will fail if it does not contain full coverage for code.
......@@ -84,7 +90,7 @@ Then, make sure your fork is up to date with `master` each time before creating
## Tips and tricks
#### Runnign Renovate against forked repositories
#### Running Renovate against forked repositories
Quite often, the quickest way for you to test or fix something is to fork an existing repository.
However, by default Renovate skips over repositories that are forked.
......@@ -97,7 +103,7 @@ Option 2: Run Renovate with the CLI flag `--renovate-fork=true`
Usually, `debug` is good enough to troubleshoot most problems or verify functionality.
When logging at debug, it's usually easiest to view the logs in a text editor, so in that case you can run like this:
When logging at debug, it's usually easiest to view the logs in a text editor, so in that case, you can run like this:
```
$ rm -f debug.log && yarn start myaccount/therepo --log-level=debug > debug.log
......@@ -121,3 +127,18 @@ It's really easy to debug Renovate using Chrome's inspect tool. Try like this:
2. Add a `debugger;` statement somewhere in the source code where you want to start debugging
3. Run Renovate using `yarn debug ...` instead of `yarn start ...`
4. Click "Resume script execution" in Chrome DevTools and wait for your break point to be triggered
If you are using VS Code, try like this:
1. In the configuration file, i.e `config.js` in the root directory of the project, add `token` with your personal access token.
2. In the same configuration file, add `repositories` with the repository you want to test against. The file `config.js` would look something like this:
```javascript
module.exports = {
token: 'xxxxxxxx',
repositories: ['r4harry/testrepo1'],
};
```
3. Set a breakpoint somewhere in the source code and launch the application in debug mode with selected configuration as `debug`.
4. Wait for your breakpoint to be triggered.