This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch release-v0.21
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/release-v0.21 by this push:
new fccdf6463 fix: blueprint gets disabled when disabling dora for project
(#7146) (#7147)
fccdf6463 is described below
commit fccdf6463d89814ce37400436355b7b272c3a72c
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Mar 8 16:42:55 2024 +0800
fix: blueprint gets disabled when disabling dora for project (#7146) (#7147)
Co-authored-by: Klesh Wong <[email protected]>
---
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 da3be3d45..b2bf71751 100755
--- a/backend/scripts/build-plugins.sh
+++ b/backend/scripts/build-plugins.sh
@@ -46,7 +46,7 @@ PLUGIN_SRC_DIR=$ROOT_DIR/plugins
PLUGIN_OUTPUT_DIR=${PLUGIN_DIR:-$ROOT_DIR/bin/plugins}
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,