Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Danger #1455

Merged
merged 4 commits into from
Jul 26, 2016
Merged

Add Danger #1455

merged 4 commits into from
Jul 26, 2016

Conversation

orta
Copy link
Contributor

@orta orta commented Jul 25, 2016

Sorry ~250 watchers, I got hit by isaacs/github#361

Pre-requisite

This requires the CI ENV var DANGER_GITHUB_API_TOKEN to be set up, so someone has to follow this guide from "Creating a GitHub Account for Danger to use".

I'd recommend making a new GitHub account for GrapeCI - see our DangerCI one, don't give it access to any of the repos.

Then re-build this PR. I've not made any README changes, so it should show a message about me adding one.

@dblock
Copy link
Member

dblock commented Jul 26, 2016

Well, this is not going to work.

https://docs.travis-ci.com/user/pull-requests#Pull-Requests-and-Security-Restrictions

Travis CI makes encrypted variables and data available only to pull requests coming from the same repository. These are considered trustworthy, as only members with write access to the repository can send them. Pull requests sent from forked repositories do not have access to encrypted variables or data.

Suggestions?

@orta
Copy link
Contributor Author

orta commented Jul 26, 2016

The guide covers this - http://danger.systems/guides/getting_started.html#setting-up-an-access-token

I can amend it if it wasn't obvious?

To get started, open https://github.com in a private browser session.

OSS PROJECTS

Do not add the bot to repo, or to your organization.

And later

ADDING THE ENV VAR

You need to add the DANGER_GITHUB_API_TOKEN environment variable, to do this, go to your repo's settings, which should look like: https://travis-ci.org/[user]/[repo]/settings.

If you have an open source project, you should ensure "Display value in build log" enabled, so that PRs from forks work.

So long as you haven't given the account any access, the token is effectively valueless for anything but commenting.

@dblock
Copy link
Member

dblock commented Jul 26, 2016

I missed the "Display value in build log" part. Restarted the build.

@dblock
Copy link
Member

dblock commented Jul 26, 2016

The format for our changelog has a dash before [@orta] :)

@orta
Copy link
Contributor Author

orta commented Jul 26, 2016

Cool beans, great, looks good, I've pushed a fix and a CHANGELOG entry. The Danger message should get deleted.

@@ -9,6 +9,8 @@
* [#1366](https://github.com/ruby-grape/grape/pull/1366): Store `message_key` on `Grape::Exceptions::Validation` - [@mkou](https://github.com/mkou).
* [#1398](https://github.com/ruby-grape/grape/pull/1398): Added `rescue_from :grape_exceptions` - allow Grape to use the built-in `Grape::Exception` handing and use `rescue :all` behavior for everything else - [@mmclead](https://github.com/mmclead).
* [#1443](https://github.com/ruby-grape/grape/pull/1443): Extended `given` to receive a `Proc` - [@glaucocustodio](https://github.com/glaucocustodio).
* [#1455](https://github.com/ruby-grape/grape/pull/1455): Adds some automated PR rules around CHANGELOGs and ensuring the `fit` and `fdescribe` don't end up in the test suite. - [@orta](https://github.com/orta).
Copy link
Member

@dblock dblock Jul 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be no period after suite.. Also remove some, that's too verbose. I would remove the bit about fit and fdescribe.

@dblock
Copy link
Member

dblock commented Jul 26, 2016

Lets run rubocop -a Dangerfile, please. Also add Dangerfile to .rubocop.yml.

@@ -24,6 +24,8 @@

require 'virtus'

# I will remove this comment in an amended commit once Danger is set up.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this comment ;)

@orta
Copy link
Contributor Author

orta commented Jul 26, 2016

👍

@dblock
Copy link
Member

dblock commented Jul 26, 2016

Excellent, merging.

@dblock dblock merged commit bad3433 into ruby-grape:master Jul 26, 2016
@dblock
Copy link
Member

dblock commented Jul 26, 2016

Ok, so, how can we make this shareable across the Grape ecosystem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants