Skip to content

Commit

Permalink
fix: blueprint gets disabled when disabling dora for project (#7146)
Browse files Browse the repository at this point in the history
  • Loading branch information
klesh authored Mar 8, 2024
1 parent 5a0b59c commit 3ad9aaf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
4 changes: 2 additions & 2 deletions backend/scripts/build-plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions backend/server/services/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
18 changes: 9 additions & 9 deletions backend/server/services/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 3ad9aaf

Please sign in to comment.