-
Notifications
You must be signed in to change notification settings - Fork 204
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
Added Dangerfile to root directory of mapknitter #306
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b30e816
Iss # 303 - Added Dangerfile
b1633b7
Update Dangerfile - Changed source_path from "plots2" to "mapknitter"
grvsachdeva 029be05
Update Dangerfile
grvsachdeva 78fb85e
Update .travis.yml
jywarren d5322ce
Update .travis.yml
jywarren fcfff90
Update .travis.yml
jywarren 3c9702f
Update test_helper.rb
jywarren 5052f90
Update Gemfile
jywarren ca178b5
Update .travis.yml
jywarren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
message "@#{github.pr_author} Thank you for your pull request! I'm here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And **don't be discouraged if you see errors** -- we're here to help." | ||
|
||
message "Your pull request is on the `master` branch. Please [make a separate feature branch](https://publiclab.org/wiki/contributing-to-public-lab-software#A+sample+git+workflow)) with a descriptive name like `new-blog-design` while making PRs in the future." if github.branch_for_head == 'master' | ||
|
||
unless git.commits.any? { |c| c.message =~ /#[\d]+/ } || github.pr_body =~ /#[\d]+/ | ||
message "This pull request doesn't link to a issue number. Please refer to the issue it fixes (if any) in the body of your PR, in the format: `Fixes #123`." | ||
end | ||
|
||
if git.added_files.include?("Gemfile.lock") && !git.added_files.include?("Gemfile") | ||
warn "You have added your `Gemfile.lock` file -- which is most likely not necessary, since you have not changed the Gemfile. Please [remove your changes to this file](https://stackoverflow.com/questions/215718/reset-or-revert-a-specific-file-to-a-specific-revision-using-git) to leave it as it was, thank you! If you really do mean to add Gemfile.lock, just leave a note explaining why. Thanks!" | ||
end | ||
|
||
if git.added_files.any? { |files| files.start_with? "db/migrate/" } && !git.added_files.include?("schema.rb.example") | ||
warn "New migrations added. Please update `schema.rb.example` by overwriting it with a copy of the up-to-date `db/schema.rb`. Also, be aware to preserve the MySQL-specific conditions for full-text indices." | ||
end | ||
|
||
if git.commits.any? { |c| c.message =~ /^Merge branch 'master'/ } | ||
warn "It looks like you merged from master in this pull request. Please [rebase](https://help.github.com/articles/about-git-rebase/) to get rid of the merge commits -- you may want to [rewind the master branch and rebase](https://publiclab.org/wiki/contributing-to-public-lab-software#Rewinding+the+master+branch) instead of merging in from master, which can cause problems when accepting new code!" | ||
end | ||
|
||
can_merge = github.pr_json["mergeable"] | ||
warn("This pull request cannot be merged yet due to merge conflicts. Please resolve them -- probably by [rebasing](https://help.github.com/articles/about-git-rebase/) -- and ask for help (in the comments, or [in the chatroom](https://gitter.im/publiclab/publiclab) if you get into trouble!.", sticky: false) unless can_merge | ||
|
||
if github.pr_body.include?("* [ ]") && !github.pr_title.include?("[WIP]") | ||
message "It looks like you haven't marked all the checkboxes. Help us review and accept your suggested changes by going through the steps one by one. If it is still a 'Work in progress', please include '[WIP]' in the title." | ||
end | ||
|
||
message "Pull Request is marked as Work in Progress" if github.pr_title.include? "[WIP]" | ||
|
||
begin | ||
|
||
junit.parse "output.xml" | ||
junit.failures.collect(&:nodes).flatten.each do |failure| | ||
failure.nodes.each do |f| | ||
f.match(/(test[a-z_\/]+.rb):([0-9]+)/) do |match| | ||
source_path = match[1] | ||
line = match[2] | ||
if !source_path.nil? && !line.nil? | ||
f = f.gsub(source_path + ':' + line, "<a href='https://github.com/#{github.pr_author}/mapknitter/tree/#{github.branch_for_head}/#{source_path}#L#{line}'>#{source_path}:#{line}</a>") | ||
end | ||
fail("There was a test failure at: #{f}") | ||
end | ||
end | ||
end | ||
|
||
junit.errors.collect(&:nodes).flatten.each do |error| | ||
error.nodes.each do |f| | ||
f.match(/(test[a-z_\/]+.rb):([0-9]+)/) do |match| | ||
source_path = match[1] | ||
line = match[2] | ||
if !source_path.nil? && !line.nil? | ||
f = f.gsub(source_path + ':' + line, "<a href='https://github.com/#{github.pr_author}/mapknitter/tree/#{github.branch_for_head}/#{source_path}#L#{line}'>#{source_path}:#{line}</a>") | ||
.gsub('`', "'") # remove ` as these cause Markdown formatting | ||
end | ||
fail("There was a test error at: #{f}") | ||
end | ||
end | ||
end | ||
|
||
rescue => ex | ||
fail "There was an error with Danger bot's Junit parsing: #{ex.message}" | ||
message ex.inspect # view the entire error output in the log | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in a
group :test
doesn't it? 🤔