likyh commented on code in PR #2128:
URL: https://github.com/apache/incubator-devlake/pull/2128#discussion_r894168776


##########
plugins/github/models/connection.go:
##########
@@ -17,31 +17,33 @@ limitations under the License.
 
 package models
 
-type GithubConnection struct {
-       Endpoint string `mapstructure:"endpoint" validate:"required" 
env:"GITHUB_ENDPOINT" json:"endpoint"`
-       Auth     string `mapstructure:"auth" validate:"required" 
env:"GITHUB_AUTH" json:"auth"`
-       Proxy    string `mapstructure:"proxy" env:"GITHUB_PROXY" json:"proxy"`
+import "github.com/apache/incubator-devlake/plugins/helper"
 
-       Config `mapstructure:",squash"`
+type TestConnectionRequest struct {
+       Endpoint string `json:"endpoint" validate:"required,url"`
+       Auth     string `json:"auth" validate:"required"`
+       Proxy    string `json:"proxy"`
 }
 
-type Config struct {
-       PrType               string `mapstructure:"prType" env:"GITHUB_PR_TYPE" 
json:"prType"`
-       PrComponent          string `mapstructure:"prComponent" 
env:"GITHUB_PR_COMPONENT" json:"prComponent"`
-       IssueSeverity        string `mapstructure:"issueSeverity" 
env:"GITHUB_ISSUE_SEVERITY" json:"issueSeverity"`
-       IssuePriority        string `mapstructure:"issuePriority" 
env:"GITHUB_ISSUE_PRIORITY" json:"issuePriority"`
-       IssueComponent       string `mapstructure:"issueComponent" 
env:"GITHUB_ISSUE_COMPONENT" json:"issueComponent"`
-       IssueTypeBug         string `mapstructure:"issueTypeBug" 
env:"GITHUB_ISSUE_TYPE_BUG" json:"issueTypeBug"`
-       IssueTypeIncident    string `mapstructure:"issueTypeIncident" 
env:"GITHUB_ISSUE_TYPE_INCIDENT" json:"issueTypeIncident"`
-       IssueTypeRequirement string `mapstructure:"issueTypeRequirement" 
env:"GITHUB_ISSUE_TYPE_REQUIREMENT" json:"issueTypeRequirement"`
+type GithubConnection struct {
+       helper.RestConnection `mapstructure:",squash"`
+       Auth                  string `mapstructure:"auth" validate:"required" 
json:"auth"`

Review Comment:
   Fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to