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(azuredevops): fix environment field in cicd_tasks and cicd_pipelines #7060

Merged
merged 2 commits into from
Feb 29, 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
6 changes: 3 additions & 3 deletions backend/impls/logruslog/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ func init() {

var formatter logrus.Formatter

format := os.Getenv("LOGGING_FORMAT")
format := os.Getenv("LOGGING_FORMAT")

switch format {
case "json":
formatter = &logrus.JSONFormatter{
Expand All @@ -63,7 +63,7 @@ func init() {
FullTimestamp: true,
}
}

inner.SetFormatter(formatter)

basePath := cfg.GetString("LOGGING_DIR")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def convert(self, b: Build, ctx: Context):
environment = devops.CICDEnvironment.PRODUCTION
if ctx.scope_config.production_pattern is not None and ctx.scope_config.production_pattern.search(
b.name) is None:
environment = ""
environment = devops.CICDEnvironment.EMPTY

if b.finish_time:
duration_sec = abs(b.finish_time.timestamp() - b.start_time.timestamp())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def convert(self, j: Job, ctx: Context) -> Iterable[devops.CICDPipeline]:
environment = devops.CICDEnvironment.PRODUCTION
if ctx.scope_config.production_pattern is not None and ctx.scope_config.production_pattern.search(
j.name) is None:
environment = ""
environment = devops.CICDEnvironment.EMPTY

if j.finish_time:
duration_sec = abs(j.finish_time.timestamp() - j.start_time.timestamp())
Expand Down
5 changes: 3 additions & 2 deletions backend/python/pydevlake/pydevlake/domain_layer/devops.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class CICDEnvironment(Enum):
PRODUCTION = "PRODUCTION"
STAGING = "STAGING"
TESTING = "TESTING"
EMPTY = ""


class CICDPipeline(DomainModel, table=True):
Expand All @@ -66,7 +67,7 @@ class CICDPipeline(DomainModel, table=True):
queued_duration_sec: Optional[float]

type: Optional[CICDType]
environment: Optional[str]
environment: Optional[CICDEnvironment]


class CiCDPipelineCommit(NoPKModel, table=True):
Expand Down Expand Up @@ -100,7 +101,7 @@ class CICDTask(DomainModel, table=True):
original_result: Optional[str]

type: Optional[CICDType]
environment: Optional[str]
environment: Optional[CICDEnvironment]

created_date: Optional[datetime]
queued_date: Optional[datetime]
Expand Down
Loading