Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: blueprint gets disabled when disabling dora for project #7146

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading