-
Notifications
You must be signed in to change notification settings - Fork 86
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
first shot to plugins (and GitHub PR as test case) #268
Changes from 12 commits
57755da
4e7ad56
1c89263
0e09a28
d6b192d
331d2bc
4d4f178
327c2ba
65ead08
a921b00
df745d2
483dd14
237aa21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
{ | ||
"separateMethodMetaAndSource" : false, | ||
"noMethodMetaData" : true, | ||
"useCypressPropertiesFile" : true | ||
} | ||
"separateMethodMetaAndSource" : false, | ||
"useCypressPropertiesFile" : true } | ||
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
{ | ||
"commentStamp" : "", | ||
"super" : "BaselineOf", | ||
"category" : "BaselineOfIceberg", | ||
"classinstvars" : [ ], | ||
"pools" : [ ], | ||
"classvars" : [ ], | ||
"instvars" : [ ], | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"name" : "BaselineOfIceberg", | ||
"type" : "normal" | ||
} | ||
"pools" : [ | ||
], | ||
"super" : "BaselineOf", | ||
"type" : "normal" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, the exporter produce a lot of noise for nothing :( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The files are exported from FileTree right? So If I open an issue it is on FileTree? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ty, I opened an issue (dalehenrich/filetree#214) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
{ } | ||
{ | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"noMethodMetaData" : true, | ||
"separateMethodMetaAndSource" : false, | ||
"useCypressPropertiesFile" : true } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
I represent an access point to the GitHub API. | ||
I provide different high level abstractions to interact with GitHub, following the speciphications you can find here: https://developer.github.com/v3/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
credentials: anObject | ||
credentials := anObject |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
credentials | ||
^ credentials |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
private requesting | ||
get: aString | ||
^ self withResponseValidationDo: [ | ||
(self newRequestTo: aString) | ||
get; | ||
response ] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
private factory | ||
newRequestTo: aString | ||
^ ZnClient new | ||
username: self credentials username password: self credentials password; | ||
headerAt: 'Accept' put: 'application/vnd.github.v3+json'; | ||
url: 'https://api.github.com/', aString; | ||
yourself |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
private requesting | ||
post: aString with: aBlock | ||
^ self withResponseValidationDo: [ | ||
(self newRequestTo: aString) | ||
in: aBlock; | ||
post; | ||
response ] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
requesting | ||
postPullRequestTo: owner project: projectName data: aDictionary | ||
^ self | ||
post: 'repos/', owner, '/', projectName, '/pulls' | ||
with: [ :client | | ||
client | ||
entity: (ZnEntity text: (STON toJsonString: aDictionary)); | ||
contentType: ZnMimeType applicationJson ] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
requesting | ||
requestBranchesFrom: owner project: projectName | ||
^ self get: 'repos/', owner,'/', projectName, '/branches' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
requesting | ||
requestRepositoryFrom: owner project: projectName | ||
^ self get: 'repos/', owner,'/', projectName |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
private requesting | ||
withResponseValidationDo: aBlock | ||
| response | | ||
|
||
response := aBlock value. | ||
response isSuccess | ||
ifFalse: [ IceGitHubError signalFor: response ]. | ||
^ response contents |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "Iceberg-Plugin-GitHub", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "<historical>", | ||
"instvars" : [ | ||
"credentials" ], | ||
"name" : "IceGitHubAPI", | ||
"pools" : [ | ||
], | ||
"super" : "Object", | ||
"type" : "normal" } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I'm an error that happens when credentials are bad. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
testing | ||
isAppropriateFor: aResponse | ||
^ aResponse status = 401 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
messageBody | ||
^ 'Credentials provided are wrong' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "Iceberg-Plugin-GitHub", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "<historical>", | ||
"instvars" : [ | ||
], | ||
"name" : "IceGitHubBadCredentialsError", | ||
"pools" : [ | ||
], | ||
"super" : "IceGitHubError", | ||
"type" : "normal" } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I'm an error that happens when something fails when performing a GitHub action. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
private | ||
errorClassFor: aResponse | ||
^ self allSubclasses | ||
detect: [ :each | each isAppropriateFor: aResponse ] | ||
ifNone: [ self ] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
instance creation | ||
for: aResponse | ||
^ (self errorClassFor: aResponse) new | ||
response: aResponse; | ||
yourself |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
testing | ||
isAppropriateFor: aResponse | ||
^ false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
instance creation | ||
signalFor: aResponse | ||
^ (self for: aResponse) signal |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
code | ||
^ self response status |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
contents | ||
^ self response contents |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
private | ||
customError: aDictionary | ||
^ aDictionary at: #message | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
private | ||
errorToString: aDictionary | ||
(aDictionary at: #code) = 'custom' ifTrue: [ ^ self customError: aDictionary ]. | ||
(aDictionary at: #code) = 'invalid' ifTrue: [ ^ self invalidError: aDictionary ]. | ||
|
||
^ self unknownError: aDictionary |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
private | ||
invalidError: aDictionary | ||
^ 'Invalid field: ', (aDictionary at: #field) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
jsonContents | ||
^ jsonContents ifNil: [ jsonContents := STON fromString: self contents ] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
accessing | ||
messageBody | ||
| errors | | ||
errors := self jsonContents at: #errors ifAbsent: [ ^ '' ]. | ||
^ String streamContents: [ :stream | | ||
errors | ||
do: [ :each | stream << (self errorToString: each) ] | ||
separatedBy: [ stream cr ] ]. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
messageText | ||
^ self jsonContents at: #message |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
response: anObject | ||
response := anObject |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
response | ||
^ response |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
private | ||
unknownError: aDictionary | ||
^ String streamContents: [ :stream | | ||
(aDictionary associations sorted: [ :a :b | a key < b key ]) | ||
do: [ :each | stream << each key << ': ' << each value ] | ||
separatedBy: [ stream << ', ' ] ] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"category" : "Iceberg-Plugin-GitHub", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "EstebanLorenzano 2/1/2017 17:15", | ||
"instvars" : [ | ||
"response", | ||
"jsonContents" ], | ||
"name" : "IceGitHubError", | ||
"pools" : [ | ||
], | ||
"super" : "Error", | ||
"type" : "normal" } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I'm an error that happens when something went wrong on GitHub API operations. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
testing | ||
isAppropriateFor: aResponse | ||
^ aResponse status = 422 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "Iceberg-Plugin-GitHub", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "<historical>", | ||
"instvars" : [ | ||
], | ||
"name" : "IceGitHubGenericError", | ||
"pools" : [ | ||
], | ||
"super" : "IceGitHubError", | ||
"type" : "normal" } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
I am a pull request. | ||
I can be sent using ==#sendWithCredentials:== protocol. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
baseBranchName: anObject | ||
baseBranchName := anObject |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
baseBranchName | ||
^ baseBranchName |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
baseRemote: anObject | ||
baseRemote := anObject |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
baseRemote | ||
^ baseRemote |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
body: anObject | ||
body := anObject |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
body | ||
^ body |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
credentials: anObject | ||
credentials := anObject |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
credentials | ||
^ credentials |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
headBranchName: anObject | ||
headBranchName := anObject |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
headBranchName | ||
^ headBranchName |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
headRemote: anObject | ||
headRemote := anObject |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
headRemote | ||
^ headRemote |
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.
It could be cool if:
I am the only one to be bothered by this?