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 support for GitHub bot users #251

Merged
merged 3 commits into from
Jun 26, 2019
Merged

Conversation

JosephDuffy
Copy link
Member

I have added Dependabot to one of my projects, and Danger Swift is failing because the PR was created by a bot user: JosephDuffy/Partial#14, https://travis-ci.com/JosephDuffy/Partial/jobs/211151759.

I used the GitHub API to request the data for the above PR and then used the value of theuser key to create a test for decoding this type of user.

It looks like the documentation should be updated to reflect the new UserType case. I have run make docs, but it only updates half of the docs, eventually failing in ./Scripts/update_docs.rb with:

The operation couldn’t be completed. (SourceKittenFramework.Request.Error error 2.)
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/json/common.rb:156:in `initialize': A JSON text must at least contain two octets! (JSON::ParserError)
	from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/json/common.rb:156:in `new'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/json/common.rb:156:in `parse'
	from ./Scripts/update_docs.rb:27:in `<main>'

It would appear that SourceKitten is throwing an error, but I am unable to figure out how to debug/fix this! :(

Copy link
Member

@f-meloni f-meloni left a comment

Choose a reason for hiding this comment

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

Amazing!
Thank you very much!
Just a small comment :)

@@ -0,0 +1,23 @@

public let GitHubBotJSON = """
Copy link
Member

Choose a reason for hiding this comment

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

Can you please format this JSON

Copy link
Member Author

Choose a reason for hiding this comment

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

I have indented it and started the commit (it is running pre-commit hook tests etc.). Hopefully it will be the desired format :) If not let me know!

@f-meloni
Copy link
Member

f-meloni commented Jun 26, 2019

Documentation is automatically updated by Rocket on release, then is fine we can merge this, and figure out the doc problem later :)

@DangerCI
Copy link

DangerCI commented Jun 26, 2019

Warnings
⚠️

Sources/Danger/GitHubDSL.swift#L154 - Enum element name should be between 3 and 40 characters long: 'id' (identifier_name)

⚠️

Sources/Danger/GitHubDSL.swift#L170 - Variable name should be between 3 and 40 characters long: 'id' (identifier_name)

⚠️

Sources/Danger/GitHubDSL.swift#L184 - Variable name should be between 3 and 40 characters long: 'id' (identifier_name)

⚠️

Sources/Danger/GitHubDSL.swift#L227 - Enum element name should be between 3 and 40 characters long: 'id' (identifier_name)

⚠️

Sources/Danger/GitHubDSL.swift#L240 - Variable name should be between 3 and 40 characters long: 'id' (identifier_name)

⚠️

Sources/Danger/GitHubDSL.swift#L271 - Enum element name should be between 3 and 40 characters long: 'id' (identifier_name)

⚠️

Sources/Danger/GitHubDSL.swift#L291 - Variable name should be between 3 and 40 characters long: 'id' (identifier_name)

⚠️

Sources/Danger/GitHubDSL.swift#L331 - Enum element name should be between 3 and 40 characters long: 'id' (identifier_name)

⚠️

Sources/Danger/GitHubDSL.swift#L359 - Variable name should be between 3 and 40 characters long: 'id' (identifier_name)

⚠️

Sources/Danger/GitHubDSL.swift#L410 - Variable name should be between 3 and 40 characters long: 'id' (identifier_name)

⚠️

Sources/Danger/GitHubDSL.swift#L434 - Enum element name should be between 3 and 40 characters long: 'id' (identifier_name)

⚠️

Sources/Danger/GitHubDSL.swift#L453 - Variable name should be between 3 and 40 characters long: 'id' (identifier_name)

⚠️

Sources/Danger/GitHubDSL.swift#L487 - File should contain 400 lines or less: currently contains 487 (file_length)

Generated by 🚫 Danger Swift against 70a2818

@JosephDuffy
Copy link
Member Author

Documentation is automatically updated by Rocket on release, then is fine we can merge this and figure it out the doc problem later :)

Ah brilliant, thanks! :)

@f-meloni
Copy link
Member

Nice!
Merge on green

@peril-staging peril-staging bot merged commit 80d5f91 into master Jun 26, 2019
@JosephDuffy JosephDuffy deleted the support_github_bot_users branch October 22, 2019 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants