This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch kw-bp-gets-disabled-when-disabling-dora
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit b5ddbb9720a78dea5752a83d13e28bf6afa8540a
Author: Klesh Wong <[email protected]>
AuthorDate: Fri Mar 8 16:25:31 2024 +0800

    fix: blueprint gets disabled when disabling dora for project
---
 backend/scripts/build-plugins.sh   |  4 ++--
 backend/server/services/init.go    |  3 ---
 backend/server/services/project.go | 18 +++++++++---------
 3 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/backend/scripts/build-plugins.sh b/backend/scripts/build-plugins.sh
index 50e4876f8..565da7eaa 100755
--- a/backend/scripts/build-plugins.sh
+++ b/backend/scripts/build-plugins.sh
@@ -47,7 +47,7 @@ if [ "$DEVLAKE_PLUGINS" = "none" ]; then
 fi
 
 if [ -n "$DEVLAKE_DEBUG" ]; then
-    EXTRA="-gcflags='all=-N -l'"
+    GCFLAGS=all=-N\ -l
 fi
 
 if [ -z "$DEVLAKE_PLUGINS" ]; then
@@ -67,7 +67,7 @@ PIDS=""
 for PLUG in $PLUGINS; do
     NAME=$(basename $PLUG)
     echo "Building plugin $NAME to bin/plugins/$NAME/$NAME.so with args: $*"
-    go build -buildmode=plugin $EXTRA -o $PLUGIN_OUTPUT_DIR/$NAME/$NAME.so 
$PLUG/*.go &
+    go build -buildmode=plugin --gcflags="$GCFLAGS" -o 
$PLUGIN_OUTPUT_DIR/$NAME/$NAME.so $PLUG/*.go &
     PIDS="$PIDS $!"
     # avoid too many processes causing signal killed
     COUNT=$(echo "$PIDS" | wc -w)
diff --git a/backend/server/services/init.go b/backend/server/services/init.go
index 86558ce55..b40d99ff2 100644
--- a/backend/server/services/init.go
+++ b/backend/server/services/init.go
@@ -119,9 +119,6 @@ func ExecuteMigration() errors.Error {
        // cronjob for blueprint triggering
        location := cron.WithLocation(time.UTC)
        cronManager = cron.New(location)
-       if err != nil {
-               panic(err)
-       }
 
        // initialize pipeline server, mainly to start the pipeline consuming 
process
        pipelineServiceInit()
diff --git a/backend/server/services/project.go 
b/backend/server/services/project.go
index 9ebc1e7ae..51d773e82 100644
--- a/backend/server/services/project.go
+++ b/backend/server/services/project.go
@@ -224,14 +224,14 @@ func PatchProject(name string, body 
map[string]interface{}) (*models.ApiOutputPr
        }
 
        // Blueprint
-       err = tx.UpdateColumn(
-               &models.Blueprint{},
-               "enable", projectInput.Enable,
-               dal.Where("project_name = ?", name),
-       )
-       if err != nil {
-               return nil, err
-       }
+       // err = tx.UpdateColumn(
+       //      &models.Blueprint{},
+       //      "enable", projectInput.Enable,
+       //      dal.Where("project_name = ?", name),
+       // )
+       // if err != nil {
+       //      return nil, err
+       // }
 
        // refresh project metrics if needed
        if len(projectInput.Metrics) > 0 {
@@ -377,7 +377,7 @@ func makeProjectOutput(project *models.Project, 
withLastPipeline bool) (*models.
        }
        if withLastPipeline {
                if projectOutput.Blueprint == nil {
-                       logger.Warn(fmt.Errorf("Blueprint is nil"), "want to 
get latest pipeline, but blueprint is nil")
+                       logger.Warn(fmt.Errorf("blueprint is nil"), "want to 
get latest pipeline, but blueprint is nil")
                } else {
                        pipelines, pipelinesCount, err := 
GetPipelines(&PipelineQuery{
                                BlueprintId: projectOutput.Blueprint.ID,

Reply via email to