You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "mindlesscloud (via GitHub)" <gi...@apache.org> on 2023/06/27 11:16:10 UTC

[GitHub] [incubator-devlake] mindlesscloud opened a new pull request, #5584: fix: _raw_data_params are missing for some scope

mindlesscloud opened a new pull request, #5584:
URL: https://github.com/apache/incubator-devlake/pull/5584

   ### Summary
   Fix #5582. During the execution of the blueprint, the scopes were created/updated twice, once at creating the pipeline and once at converting the boards/repos/cicd_scopes, the column `_raw_data_params` was not populated in the previous one. In this PR, we fix the issue by only creating/updating scopes once.
   
   ### Does this close any open issues?
   Closes #5582 
   
   ### Screenshots
   ![image](https://github.com/apache/incubator-devlake/assets/8455907/2ce06d03-af0c-4504-b828-596d8e68d2d7)
   
   
   


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] klesh merged pull request #5584: fix: _raw_data_params are missing for some scope

Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh merged PR #5584:
URL: https://github.com/apache/incubator-devlake/pull/5584


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] keon94 commented on a diff in pull request #5584: fix: _raw_data_params are missing for some scope

Posted by "keon94 (via GitHub)" <gi...@apache.org>.
keon94 commented on code in PR #5584:
URL: https://github.com/apache/incubator-devlake/pull/5584#discussion_r1244693206


##########
backend/server/services/blueprint_makeplan_v200.go:
##########
@@ -35,51 +35,26 @@ func GeneratePlanJsonV200(
 	metrics map[string]json.RawMessage,
 	skipCollectors bool,
 ) (plugin.PipelinePlan, errors.Error) {
-	// generate plan and collect scopes
-	plan, scopes, err := genPlanJsonV200(projectName, syncPolicy, sources, metrics, skipCollectors)
-	if err != nil {
-		return nil, err
-	}
-	// save scopes to database
-	if len(scopes) > 0 {
-		for _, scope := range scopes {
-			err = db.CreateOrUpdate(scope)

Review Comment:
   I don't understand this. Were the scopes here missing the "_raw_data_*" fields? That's odd, since ScopeHelper should have taken care of that...
   At any rate, in #5589 I've added this back for remote plugins (only) because we don't run convertors on them. But they don't have the problem of not having the _raw_ fields, so it'll be ok.



-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] keon94 commented on a diff in pull request #5584: fix: _raw_data_params are missing for some scope

Posted by "keon94 (via GitHub)" <gi...@apache.org>.
keon94 commented on code in PR #5584:
URL: https://github.com/apache/incubator-devlake/pull/5584#discussion_r1244693206


##########
backend/server/services/blueprint_makeplan_v200.go:
##########
@@ -35,51 +35,26 @@ func GeneratePlanJsonV200(
 	metrics map[string]json.RawMessage,
 	skipCollectors bool,
 ) (plugin.PipelinePlan, errors.Error) {
-	// generate plan and collect scopes
-	plan, scopes, err := genPlanJsonV200(projectName, syncPolicy, sources, metrics, skipCollectors)
-	if err != nil {
-		return nil, err
-	}
-	// save scopes to database
-	if len(scopes) > 0 {
-		for _, scope := range scopes {
-			err = db.CreateOrUpdate(scope)

Review Comment:
   I don't understand this. Were the scopes here missing the "_raw_data_*" fields? That's odd
   At any rate, in #5589 I've added this back for remote plugins (only) because we don't run convertors on them. But they don't have the problem of not having the _raw_ fields, so it'll be ok.



-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] klesh commented on a diff in pull request #5584: fix: _raw_data_params are missing for some scope

Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh commented on code in PR #5584:
URL: https://github.com/apache/incubator-devlake/pull/5584#discussion_r1245163983


##########
backend/server/services/blueprint_makeplan_v200.go:
##########
@@ -35,51 +35,26 @@ func GeneratePlanJsonV200(
 	metrics map[string]json.RawMessage,
 	skipCollectors bool,
 ) (plugin.PipelinePlan, errors.Error) {
-	// generate plan and collect scopes
-	plan, scopes, err := genPlanJsonV200(projectName, syncPolicy, sources, metrics, skipCollectors)
-	if err != nil {
-		return nil, err
-	}
-	// save scopes to database
-	if len(scopes) > 0 {
-		for _, scope := range scopes {
-			err = db.CreateOrUpdate(scope)

Review Comment:
   Because plugins would create a set of new domain layer scopes without the `_raw_data` fields, this line ruins whatever scope helper had taken care of on each run.



-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] keon94 commented on a diff in pull request #5584: fix: _raw_data_params are missing for some scope

Posted by "keon94 (via GitHub)" <gi...@apache.org>.
keon94 commented on code in PR #5584:
URL: https://github.com/apache/incubator-devlake/pull/5584#discussion_r1244693206


##########
backend/server/services/blueprint_makeplan_v200.go:
##########
@@ -35,51 +35,26 @@ func GeneratePlanJsonV200(
 	metrics map[string]json.RawMessage,
 	skipCollectors bool,
 ) (plugin.PipelinePlan, errors.Error) {
-	// generate plan and collect scopes
-	plan, scopes, err := genPlanJsonV200(projectName, syncPolicy, sources, metrics, skipCollectors)
-	if err != nil {
-		return nil, err
-	}
-	// save scopes to database
-	if len(scopes) > 0 {
-		for _, scope := range scopes {
-			err = db.CreateOrUpdate(scope)

Review Comment:
   I don't understand this. Were the scopes here missing the "_raw_data_*" fields? That's odd



-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org