Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ComFreek authored Jul 5, 2019
2 parents bd36ee2 + 95c8d34 commit ff34fb1
Show file tree
Hide file tree
Showing 29 changed files with 1,588 additions and 334 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules/
.env
.vscode
package-lock.json

# jest coverage output
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ To run the tests you will need [Docker](https://docs.docker.com/engine/installat

```bash
# Install CouchDB on Docker
$ docker pull apache/couchdb:2.1.1
$ docker pull apache/couchdb:2.3.1
```
A fake private key in the .env file is needed generate it like this:
* Linux
Expand Down
2 changes: 1 addition & 1 deletion content/initial-pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ There is a collection of [frequently asked questions](https://greenkeeper.io/faq
// needs to handle files as an array of arrays!
function hasLockFileText (files) {
if (!files) return
const lockFiles = ['package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock'].filter((key) => {
const lockFiles = ['package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock', 'pnpm-lock.yaml'].filter((key) => {
if (_.isArray(files[key]) && files[key].length) {
return true
}
Expand Down
12 changes: 11 additions & 1 deletion content/timeout-issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ module.exports = ({ fullName }) =>
To enable Greenkeeper, you need to make sure that a [commit status](https://help.github.com/articles/about-statuses/) is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didn’t receive a CI status on the ${branchLink(fullName)} branch, it’s possible that you don’t have CI set up yet. We recommend using [Travis CI](https://travis-ci.com), but Greenkeeper will work with every other CI service as well.
Since we didn’t receive a CI status on the ${branchLink(fullName)} branch, it’s possible that you don’t have CI set up yet.
We recommend using:
- [CircleCI](https://circleci.com)
- [Travis CI](https://travis-ci.com)
- [Buildkite](https://buildkite.com/)
- [CodeShip](https://codeship.com)
- [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines)
- [TeamCity](https://www.jetbrains.com/teamcity)
- [Buddy](https://buddy.works)
- [AppVeyor](https://www.appveyor.com)
But Greenkeeper will work with every other CI service as well.
If you _have_ already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with ${md.code('greenkeeper/')}.
Expand Down
9 changes: 8 additions & 1 deletion content/update-pr.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const _ = require('lodash')
const md = require('./template')

module.exports = ({ version, dependencyLink, dependency, monorepoGroupName, release, diffCommits, oldVersionResolved, type, packageUpdateList }) => {
module.exports = ({
version, dependencyLink, dependency, monorepoGroupName, release, diffCommits, oldVersionResolved, type, packageUpdateList, license, licenseHasChanged, previousLicense, publisher
}) => {
const hasReleaseInfo = release && diffCommits
return md`
${monorepoGroupName
Expand All @@ -15,11 +17,16 @@ ${monorepoGroupName && `\nThis monorepo update includes releases of one or more
}
---
${publisher && `**Publisher:** ${publisher}`}
${license && `**License:** ${licenseHasChanged ? `This package’s license **has changed** from \`${previousLicense}\` to \`${license}\` in this release 🤔` : `${license}`}`}
${hasReleaseInfo
? _.compact([release, diffCommits])
: `[Find out more about this release](${dependencyLink}).`
}
---
<details>
<summary>FAQ and help</summary>
Expand Down
21 changes: 21 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,29 @@ require('./lib/rollbar')
setInterval(scheduleReminders, 24 * 60 * 60 * 1000)
setInterval(scheduleMonorepoReleaseSupervisor, 5 * 60 * 1000)

const isBad = (data) => {
const values = Object.values(data)
const baddies = ['gatsby', 'material-ui', 'react-cosmos']
let bad = false
baddies.forEach((baddie) => {
values.forEach((value) => {
if (String(value).match(baddie)) {
bad = true
statsd.increment('jobs.baddie', { tag: baddie })
}
})
})
return bad
}

async function consume (job) {
const data = JSON.parse(job.content.toString())

if (isBad(data)) {
channel.ack(job)
return
}

const jobsWithoutOwners = ['registry-change', 'stripe-event', 'schedule-stale-initial-pr-reminders', 'reset', 'cancel-stripe-subscription', 'update-nodejs-version', 'deprecate-nodejs-version', 'monorepo-supervisor']
if (jobsWithoutOwners.includes(data.name) || data.type === 'marketplace_purchase') {
return queueJob(data.name, job)
Expand Down
14 changes: 11 additions & 3 deletions jobs/create-group-version-branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const {
generateGitHubCompareURL,
hasTooManyPackageJSONs,
getSatisfyingVersions,
getOldVersionResolved
getOldVersionResolved,
getLicenseAndPublisherFromVersions
} = require('../utils/utils')
const {
isPartOfMonorepo,
Expand Down Expand Up @@ -216,7 +217,7 @@ module.exports = async function (
})
const oldVersionResolved = getOldVersionResolved(satisfyingVersions, npmDoc.distTags, 'latest')
if (!oldVersionResolved) {
log.warn(`exited transform creation: could not resolve old version for ${depName} (no update?)`, { newVersion: version, satisfyingVersions, latestDependencyVersion, oldPkgVersion })
log.info(`exited transform creation: ${depName} ${latestDependencyVersion} is not an update for ${oldPkgVersion}`, { newVersion: version, satisfyingVersions, latestDependencyVersion, oldPkgVersion })
return null
}

Expand Down Expand Up @@ -360,6 +361,9 @@ module.exports = async function (
prTitles: config.prTitles })

const dependencyLink = getFormattedDependencyURL({ repositoryURL: transforms[0].repoURL })

const { license, previousLicense, licenseHasChanged, publisher } = getLicenseAndPublisherFromVersions({ versions, version, oldVersionResolved })

// maybe adapt PR body
const body = prContent({
dependencyLink,
Expand All @@ -370,7 +374,11 @@ module.exports = async function (
type: highestPriorityDependency,
release,
diffCommits,
packageUpdateList
packageUpdateList,
license,
previousLicense,
licenseHasChanged,
publisher
})

// verify pull requests commit
Expand Down
13 changes: 10 additions & 3 deletions jobs/create-version-branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const { createTransformFunction,
generateGitHubCompareURL,
hasTooManyPackageJSONs,
getSatisfyingVersions,
getOldVersionResolved
getOldVersionResolved,
getLicenseAndPublisherFromVersions
} = require('../utils/utils')

const prContent = require('../content/update-pr')
Expand Down Expand Up @@ -179,7 +180,7 @@ module.exports = async function (
})
const oldVersionResolved = getOldVersionResolved(satisfyingVersions, npmDoc.distTags, 'latest')
if (!oldVersionResolved) {
log.warn(`exited transform creation: could not resolve old version for ${depName} (no update?)`, { newVersion: version, json, satisfyingVersions, latestDependencyVersion, oldPkgVersion })
log.info(`exited transform creation: ${depName} ${latestDependencyVersion} is not an update for ${oldPkgVersion}`, { newVersion: version, json, satisfyingVersions, latestDependencyVersion, oldPkgVersion })
return null
}

Expand Down Expand Up @@ -336,6 +337,8 @@ module.exports = async function (
dependency: dependencyKey,
prTitles: config.prTitles })

const { license, previousLicense, licenseHasChanged, publisher } = getLicenseAndPublisherFromVersions({ versions, version, oldVersionResolved })

const body = prContent({
dependencyLink,
oldVersionResolved,
Expand All @@ -345,7 +348,11 @@ module.exports = async function (
diffCommits,
monorepoGroupName,
type,
packageUpdateList
packageUpdateList,
license,
previousLicense,
licenseHasChanged,
publisher
})

// verify pull requests commit
Expand Down
1 change: 1 addition & 0 deletions jobs/github-event/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module.exports = async function (data) {
'package.json',
'package-lock.json',
'npm-shrinkwrap.json',
'pnpm-lock.yaml',
'yarn.lock',
'greenkeeper.json'
]
Expand Down
Loading

0 comments on commit ff34fb1

Please sign in to comment.