gemfarmer / content-linter Goto Github PK
View Code? Open in Web Editor NEWA houndci-like tool to keep your content consistent
A houndci-like tool to keep your content consistent
What ultimately makes this application useful is its integration into Github, and ability to leave comments.
accesslint authenticates with a repo by asking users to login to Github and obtain an ACCESSLINT_API_KEY
. This is slick, but we could probably go for something a little more simple at first.
We could run the app with a simple omniauth that gathered Github login credentials. Using those credentials, it could create a webhook on that user's github (.subscribe
)
The next step is ensuring that we can deploy the app on cloud.gov
In order for this app to be viable, it will need to support additional webhook events, namely push
and pull_request_review
.
Currently, the app works if there is only one error (one comment) and it is on a pull_request
event. This PR demonstrates that.
If there is a follow up push event nothing will happen.
If there is more than 1 error, the CF logs will read roughly as follows:
2017-03-06T11:37:43.47-0600 [RTR/1] OUT content-linter.app.cloud.gov - [2017-03-06T17:37:38.476+0000] "POST /github_webhooks HTTP/1.1" 500 28624 1477 "-" "GitHub-Hookshot/6b02022" "127.0.0.1:61338" "10.10.4.12:61376" x_forwarded_for:"192.30.252.41" x_forwarded_proto:"https" vcap_request_id:"47f85ad9-d95d-4e1f-659b-a38babb5c7dc" response_time:4.998956126 app_id:"da8fd063-82ee-4009-94ee-5d4e997d0ec2" app_index:"0"
2017-03-06T11:37:43.52-0600 [APP/PROC/WEB/0]OUT I, [2017-03-06T17:37:43.524357 #8] INFO -- : [6ed05960-6132-4a65-80a6-174900658eb0] Completed 500 Internal Server Error in 4975ms
2017-03-06T11:37:43.52-0600 [APP/PROC/WEB/0]OUT F, [2017-03-06T17:37:43.525231 #8] FATAL -- : [6ed05960-6132-4a65-80a6-174900658eb0]
2017-03-06T11:37:43.52-0600 [APP/PROC/WEB/0]OUT F, [2017-03-06T17:37:43.525301 #8] FATAL -- : [6ed05960-6132-4a65-80a6-174900658eb0] Octokit::UnprocessableEntity (POST https://api.github.com/repos/gemfarmer/github_webhook/pulls/50/comments: 422 - Validation Failed
2017-03-06T11:37:43.52-0600 [APP/PROC/WEB/0]OUT Error summary:
2017-03-06T11:37:43.52-0600 [APP/PROC/WEB/0]OUT resource: PullRequestReviewComment
2017-03-06T11:37:43.52-0600 [APP/PROC/WEB/0]OUT code: invalid
2017-03-06T11:37:43.52-0600 [APP/PROC/WEB/0]OUT field: position // See: https://developer.github.com/v3/pulls/comments/#create-a-comment):
2017-03-06T11:37:43.52-0600 [APP/PROC/WEB/0]OUT F, [2017-03-06T17:37:43.525367 #8] FATAL -- : [6ed05960-6132-4a65-80a6-174900658eb0]
2017-03-06T11:37:43.52-0600 [APP/PROC/WEB/0]OUT F, [2017-03-06T17:37:43.525436 #8] FATAL -- : [6ed05960-6132-4a65-80a6-174900658eb0] app/controllers/github_webhooks_controller.rb:101:in `create_pull_request_comment'
2017-03-06T11:37:43.52-0600 [APP/PROC/WEB/0]OUT [6ed05960-6132-4a65-80a6-174900658eb0] app/controllers/github_webhooks_controller.rb:54:in `block (2 levels) in github_pull_request'
2017-03-06T11:37:43.52-0600 [APP/PROC/WEB/0]OUT [6ed05960-6132-4a65-80a6-174900658eb0] app/controllers/github_webhooks_controller.rb:48:in `each'
2017-03-06T11:37:43.52-0600 [APP/PROC/WEB/0]OUT [6ed05960-6132-4a65-80a6-174900658eb0] app/controllers/github_webhooks_controller.rb:48:in `block in github_pull_request'
2017-03-06T11:37:43.52-0600 [APP/PROC/WEB/0]OUT [6ed05960-6132-4a65-80a6-174900658eb0] app/controllers/github_webhooks_controller.rb:43:in `each'
2017-03-06T11:37:43.52-0600 [APP/PROC/WEB/0]OUT [6ed05960-6132-4a65-80a6-174900658eb0] app/controllers/github_webhooks_controller.rb:43:in `github_pull_request'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.