-
Notifications
You must be signed in to change notification settings - Fork 2
generic trigger #10
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
base: master
Are you sure you want to change the base?
generic trigger #10
Conversation
| var queryParams = System.Web.HttpUtility.ParseQueryString(req.RequestUri.Query); | ||
| string repo_name = queryParams.Get("repoName"); | ||
|
|
||
| if(repo_name!="") |
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.
use IsNullOrEmpty()
| if(repo_name!="") | ||
| { | ||
| log.LogInformation("fetching repo name from query parameters."+repo_name); | ||
| } |
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.
needs else condition
| // var repo_name = Environment.GetEnvironmentVariable("REPO_NAME", EnvironmentVariableTarget.Process); | ||
| var repo_name = ""; | ||
|
|
||
| if(requestObject[0]["data"]["runTags"]==null || requestObject[0]["data"]["runTags"]["githuB_REPOSITORY"]==null) |
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.
now you don't need it from runTags I guess
| event_source = event_data[1]; | ||
|
|
||
| if(event_source == "MachineLearningServices"){ | ||
| ParseMachineLearningEvent(requestObject); |
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 returns something.. let's use it
|
|
||
| var payload = Newtonsoft.Json.JsonConvert.SerializeObject(new Newtonsoft.Json.Linq.JObject { ["event_type"] = event_types, ["client_payload"] = client_payload }); | ||
| var client_payload = new Newtonsoft.Json.Linq.JObject { ["unit "] = false, ["integration"] = true, | ||
| ["data"] = requestObject[0]["data"], ["event_source"] = event_source}; |
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.
use the Parsed value from Parser function
| return requestObject[0]["data"]; | ||
| } | ||
|
|
||
| [FunctionName("generic_triggers")] |
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 change will also require a change in the ARM templates... we might want to think about that
No description provided.