From 394b9adf91cd975caeb7ae64363371cb681f8683 Mon Sep 17 00:00:00 2001 From: Mike Drakos Date: Tue, 12 Sep 2023 15:32:00 -0700 Subject: [PATCH 1/2] Recognize docker/installer changes --- internal/locale/locales/en-us.yaml | 2 ++ pkg/cmdlets/commit/commit.go | 7 +++++++ pkg/platform/model/vcs.go | 3 +++ 3 files changed, 12 insertions(+) diff --git a/internal/locale/locales/en-us.yaml b/internal/locale/locales/en-us.yaml index 3bdcb21aad..c289b7eff8 100644 --- a/internal/locale/locales/en-us.yaml +++ b/internal/locale/locales/en-us.yaml @@ -1344,6 +1344,8 @@ namespace_label_platform: other: "Platform" namespace_label_preplatform: other: "Bits" +namespace_label_packager: + other: "Docker/Installer packagers" print_commit: other: "[NOTICE]commit {{.V0}}[/RESET]" print_commit_author: diff --git a/pkg/cmdlets/commit/commit.go b/pkg/cmdlets/commit/commit.go index 6512a0ca5d..8e5d3676ee 100644 --- a/pkg/cmdlets/commit/commit.go +++ b/pkg/cmdlets/commit/commit.go @@ -105,6 +105,13 @@ func FormatChanges(commit *mono_models.Commit) ([]string, []*requirementChange) versionConstraints = "" } + // This is a temporary fix until we start getting history in the form of build expressions + if model.NamespaceMatch(change.Namespace, model.NamespaceBuildFlagsMatch) && + (strings.Contains(change.Requirement, "docker") || strings.Contains(change.Requirement, "installer")) { + requirement = locale.T("namespace_label_packager") + versionConstraints = "" + } + var result, oldConstraints, newConstraints string switch change.Operation { case string(model.OperationAdded): diff --git a/pkg/platform/model/vcs.go b/pkg/platform/model/vcs.go index c82b7e160f..f42acd88de 100644 --- a/pkg/platform/model/vcs.go +++ b/pkg/platform/model/vcs.go @@ -85,6 +85,9 @@ const ( // NamespaceSharedMatch is the namespace used for shared requirements (usually runtime libraries) NamespaceSharedMatch = `^shared$` + + // NamespaceBuildFlagsMatch is the namespace used for passing build flags + NamespaceBuildFlagsMatch = `^build-flags$` ) type TrackingType string From 2422dd1437b603e45bc491a2444077a7c8feb37e Mon Sep 17 00:00:00 2001 From: mdrakos Date: Wed, 13 Sep 2023 12:46:16 -0700 Subject: [PATCH 2/2] Add link to follow-up story --- pkg/cmdlets/commit/commit.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/cmdlets/commit/commit.go b/pkg/cmdlets/commit/commit.go index 8e5d3676ee..678387c107 100644 --- a/pkg/cmdlets/commit/commit.go +++ b/pkg/cmdlets/commit/commit.go @@ -106,6 +106,7 @@ func FormatChanges(commit *mono_models.Commit) ([]string, []*requirementChange) } // This is a temporary fix until we start getting history in the form of build expressions + // https://activestatef.atlassian.net/browse/DX-2197 if model.NamespaceMatch(change.Namespace, model.NamespaceBuildFlagsMatch) && (strings.Contains(change.Requirement, "docker") || strings.Contains(change.Requirement, "installer")) { requirement = locale.T("namespace_label_packager")