From 875af132dd92ade7fb8ef0ca756b49576f6d1442 Mon Sep 17 00:00:00 2001 From: William Perreault Date: Wed, 4 Sep 2024 17:38:31 -0400 Subject: [PATCH] Fix logging issue when failure to load spec source (#20) --- pkg/specter/common.go | 14 ++++++++++++++ pkg/specter/pipeline.go | 2 +- pkg/specter/specter_test.go | 14 ++++++++++++++ pkg/specterutils/genericspec.go | 14 ++++++++++++++ pkg/specterutils/specterutils_test.go | 14 ++++++++++++++ 5 files changed, 57 insertions(+), 1 deletion(-) diff --git a/pkg/specter/common.go b/pkg/specter/common.go index 11a31b3..5f093e4 100644 --- a/pkg/specter/common.go +++ b/pkg/specter/common.go @@ -1,3 +1,17 @@ +// Copyright 2024 Morébec +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package specter type ArtifactID string diff --git a/pkg/specter/pipeline.go b/pkg/specter/pipeline.go index 1cf87b1..6916ae3 100644 --- a/pkg/specter/pipeline.go +++ b/pkg/specter/pipeline.go @@ -208,7 +208,7 @@ func (p Pipeline) loadSpecifications(ctx context.Context, sources []Source) ([]S if len(sourcesNotLoaded) > 0 { for _, src := range sourcesNotLoaded { - p.Logger.Warning(fmt.Sprintf("%q could not be loaded.", src)) + p.Logger.Warning(fmt.Sprintf("%q could not be loaded.", src.Location)) } p.Logger.Warning("%d specifications were not loaded.") diff --git a/pkg/specter/specter_test.go b/pkg/specter/specter_test.go index 728a50e..7f23b34 100644 --- a/pkg/specter/specter_test.go +++ b/pkg/specter/specter_test.go @@ -1,3 +1,17 @@ +// Copyright 2024 Morébec +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package specter_test import ( diff --git a/pkg/specterutils/genericspec.go b/pkg/specterutils/genericspec.go index 41a294e..652d0d5 100644 --- a/pkg/specterutils/genericspec.go +++ b/pkg/specterutils/genericspec.go @@ -1,3 +1,17 @@ +// Copyright 2024 Morébec +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package specterutils import ( diff --git a/pkg/specterutils/specterutils_test.go b/pkg/specterutils/specterutils_test.go index 192aadf..0850cac 100644 --- a/pkg/specterutils/specterutils_test.go +++ b/pkg/specterutils/specterutils_test.go @@ -1,3 +1,17 @@ +// Copyright 2024 Morébec +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package specterutils import (