Skip to content

Commit a2da3e3

Browse files
committed
Merge branch 'main' into pfm-5407
2 parents b813f7e + a17d344 commit a2da3e3

26 files changed

Lines changed: 679 additions & 100 deletions

.chainloop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This indicates the [current version]+next
22
# to indicate that we are building a new version of the project
3-
projectVersion: v1.89.11+next
3+
projectVersion: v1.90.0+next
44

55
# Experimental feature used by Chainloop labs shared workflow https://github.com/chainloop-dev/labs
66
# It maps the material names with location in disk so they get automatically attested

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
run: |
6565
mkdir -p ~/.local/bin
6666
cd ~/.local
67-
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.19.3 sh
67+
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.19.11 sh
6868
6969
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
7070

app/cli/cmd/artifact.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright 2023-2025 The Chainloop Authors.
2+
// Copyright 2023-2026 The Chainloop Authors.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");
55
// you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@ package cmd
1717

1818
import (
1919
"context"
20+
"os"
2021

2122
pb "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1"
2223
"github.com/chainloop-dev/chainloop/pkg/grpcconn"
@@ -54,8 +55,12 @@ func wrappedArtifactConn(cpConn *grpc.ClientConn, role pb.CASCredentialsServiceG
5455
grpcconn.WithInsecure(apiInsecure()),
5556
}
5657

57-
if caFilePath := viper.GetString(confOptions.CASCA.viperKey); caFilePath != "" {
58-
opts = append(opts, grpcconn.WithCAFile(caFilePath))
58+
if caValue := viper.GetString(confOptions.CASCA.viperKey); caValue != "" {
59+
if _, err := os.Stat(caValue); err == nil {
60+
opts = append(opts, grpcconn.WithCAFile(caValue))
61+
} else {
62+
opts = append(opts, grpcconn.WithCAContent(caValue))
63+
}
5964
}
6065

6166
return grpcconn.New(viper.GetString(confOptions.CASAPI.viperKey), resp.Result.Token, opts...)

app/cli/pkg/action/workflow_contract_list.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright 2023-2025 The Chainloop Authors.
2+
// Copyright 2023-2026 The Chainloop Authors.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");
55
// you may not use this file except in compliance with the License.
@@ -38,6 +38,7 @@ type WorkflowContractItem struct {
3838
Workflows []string `json:"workflows,omitempty"` // TODO: remove this field after all clients are updated
3939
WorkflowRefs []*WorkflowRef `json:"workflowRefs,omitempty"`
4040
ScopedEntity *ScopedEntity `json:"scopedEntity,omitempty"`
41+
Scope string `json:"scope"`
4142
}
4243

4344
type ScopedEntity struct {
@@ -118,6 +119,8 @@ func pbWorkflowContractItemToAction(in *pb.WorkflowContractItem) *WorkflowContra
118119
}
119120
}
120121

122+
item.Scope = item.ScopedEntity.String()
123+
121124
return item
122125
}
123126

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
//
2+
// Copyright 2026 The Chainloop Authors.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
package action
17+
18+
import (
19+
"testing"
20+
21+
pb "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1"
22+
"github.com/stretchr/testify/assert"
23+
"google.golang.org/protobuf/types/known/timestamppb"
24+
)
25+
26+
func TestPbWorkflowContractItemToAction(t *testing.T) {
27+
now := timestamppb.Now()
28+
29+
tests := []struct {
30+
name string
31+
input *pb.WorkflowContractItem
32+
expectedScope string
33+
}{
34+
{
35+
name: "global scope when scoped entity is nil",
36+
input: &pb.WorkflowContractItem{
37+
Id: "contract-id",
38+
Name: "my-contract",
39+
LatestRevision: 3,
40+
CreatedAt: now,
41+
LatestRevisionCreatedAt: now,
42+
},
43+
expectedScope: "global",
44+
},
45+
{
46+
name: "project scope when scoped entity is set",
47+
input: &pb.WorkflowContractItem{
48+
Id: "contract-id",
49+
Name: "my-contract",
50+
LatestRevision: 1,
51+
CreatedAt: now,
52+
LatestRevisionCreatedAt: now,
53+
ScopedEntity: &pb.ScopedEntity{
54+
Type: "project",
55+
Id: "project-id",
56+
Name: "my-project",
57+
},
58+
},
59+
expectedScope: "project/my-project",
60+
},
61+
{
62+
name: "workflow refs are converted",
63+
input: &pb.WorkflowContractItem{
64+
Id: "contract-id",
65+
Name: "my-contract",
66+
CreatedAt: now,
67+
LatestRevisionCreatedAt: now,
68+
WorkflowRefs: []*pb.WorkflowRef{
69+
{Id: "wf-1", Name: "build", ProjectName: "proj-a"},
70+
{Id: "wf-2", Name: "deploy", ProjectName: "proj-b"},
71+
},
72+
},
73+
expectedScope: "global",
74+
},
75+
}
76+
77+
for _, tc := range tests {
78+
t.Run(tc.name, func(t *testing.T) {
79+
result := pbWorkflowContractItemToAction(tc.input)
80+
81+
assert.Equal(t, tc.input.GetName(), result.Name)
82+
assert.Equal(t, tc.input.GetId(), result.ID)
83+
assert.Equal(t, int(tc.input.GetLatestRevision()), result.LatestRevision)
84+
assert.Equal(t, tc.expectedScope, result.Scope)
85+
86+
if tc.input.ScopedEntity != nil {
87+
assert.NotNil(t, result.ScopedEntity)
88+
assert.Equal(t, tc.input.ScopedEntity.Type, result.ScopedEntity.Type)
89+
assert.Equal(t, tc.input.ScopedEntity.Id, result.ScopedEntity.ID)
90+
assert.Equal(t, tc.input.ScopedEntity.Name, result.ScopedEntity.Name)
91+
} else {
92+
assert.Nil(t, result.ScopedEntity)
93+
}
94+
95+
assert.Len(t, result.WorkflowRefs, len(tc.input.WorkflowRefs))
96+
})
97+
}
98+
}

dagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chainloop",
3-
"engineVersion": "v0.19.3",
3+
"engineVersion": "v0.19.11",
44
"sdk": {
55
"source": "go"
66
},

deployment/chainloop/Chart.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ description: Chainloop is an open source software supply chain control plane, a
77

88
type: application
99
# Bump the patch (not minor, not major) version on each change in the Chart Source code
10-
version: 1.362.1
10+
version: 1.364.1
1111
# Do not update appVersion, this is handled automatically by the release process
12-
appVersion: v1.89.11
12+
appVersion: v1.90.0
1313

1414
dependencies:
1515
- name: common
@@ -33,11 +33,11 @@ dependencies:
3333

3434
annotations:
3535
images: |
36-
- image: ghcr.io/chainloop-dev/chainloop/artifact-cas:v1.89.11
36+
- image: ghcr.io/chainloop-dev/chainloop/artifact-cas:v1.90.0
3737
name: artifact-cas
38-
- image: ghcr.io/chainloop-dev/chainloop/control-plane:v1.89.11
38+
- image: ghcr.io/chainloop-dev/chainloop/control-plane:v1.90.0
3939
name: control-plane
40-
- image: ghcr.io/chainloop-dev/chainloop/control-plane-migrations:v1.89.11
40+
- image: ghcr.io/chainloop-dev/chainloop/control-plane-migrations:v1.90.0
4141
name: control-plane-migrations
42-
- image: ghcr.io/chainloop-dev/chainloop/cli:v1.89.11
42+
- image: ghcr.io/chainloop-dev/chainloop/cli:v1.90.0
4343
name: cli

deployment/chainloop/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ controlplane:
138138
image:
139139
registry: ghcr.io
140140
repository: chainloop-dev/chainloop/control-plane
141-
tag: "v1.89.11"
141+
tag: "v1.90.0"
142142

143143

144144
## @param controlplane.containerPorts.http controlplane HTTP container port
@@ -229,7 +229,7 @@ controlplane:
229229
image:
230230
registry: ghcr.io
231231
repository: chainloop-dev/chainloop/control-plane-migrations
232-
tag: "v1.89.11"
232+
tag: "v1.90.0"
233233
# Run the migration job forcing SSL, required in AWS RDS for PostgreSQL 15
234234
ssl: false
235235

@@ -1026,7 +1026,7 @@ cas:
10261026
image:
10271027
registry: ghcr.io
10281028
repository: chainloop-dev/chainloop/artifact-cas
1029-
tag: "v1.89.11"
1029+
tag: "v1.90.0"
10301030

10311031
## @param cas.containerPorts.http controlplane HTTP container port
10321032
## @param cas.containerPorts.grpc controlplane gRPC container port

extras/dagger/go.mod

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ go 1.24.0
44

55
require github.com/Khan/genqlient v0.8.1
66

7-
require (
8-
github.com/vektah/gqlparser/v2 v2.5.30
9-
go.opentelemetry.io/otel/metric v1.38.0
10-
go.opentelemetry.io/proto/otlp v1.8.0
11-
)
7+
require github.com/vektah/gqlparser/v2 v2.5.30
128

139
require (
1410
github.com/go-logr/logr v1.4.3 // indirect
1511
github.com/go-logr/stdr v1.2.2 // indirect
1612
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect
1713
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0 // indirect
14+
go.opentelemetry.io/otel/metric v1.38.0 // indirect
15+
go.opentelemetry.io/proto/otlp v1.8.0 // indirect
1816
golang.org/x/net v0.44.0 // indirect
1917
golang.org/x/sys v0.36.0 // indirect
2018
golang.org/x/text v0.29.0 // indirect
@@ -24,26 +22,27 @@ require (
2422
)
2523

2624
require (
27-
github.com/99designs/gqlgen v0.17.81
25+
dagger.io/dagger v0.19.11
26+
github.com/99designs/gqlgen v0.17.81 // indirect
2827
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
2928
github.com/google/uuid v1.6.0 // indirect
3029
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
3130
github.com/sosodev/duration v1.3.1 // indirect
3231
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
3332
go.opentelemetry.io/otel v1.38.0
34-
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.14.0
35-
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.14.0
36-
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.38.0
37-
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.38.0
38-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.38.0
39-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0
40-
go.opentelemetry.io/otel/log v0.14.0
33+
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.14.0 // indirect
34+
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.14.0 // indirect
35+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.38.0 // indirect
36+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.38.0 // indirect
37+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.38.0 // indirect
38+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0 // indirect
39+
go.opentelemetry.io/otel/log v0.14.0 // indirect
4140
go.opentelemetry.io/otel/sdk v1.38.0
42-
go.opentelemetry.io/otel/sdk/log v0.14.0
43-
go.opentelemetry.io/otel/sdk/metric v1.38.0
41+
go.opentelemetry.io/otel/sdk/log v0.14.0 // indirect
42+
go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect
4443
go.opentelemetry.io/otel/trace v1.38.0
45-
golang.org/x/sync v0.17.0
46-
google.golang.org/grpc v1.76.0
44+
golang.org/x/sync v0.17.0 // indirect
45+
google.golang.org/grpc v1.76.0 // indirect
4746
)
4847

4948
replace go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc => go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.14.0

extras/dagger/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
dagger.io/dagger v0.19.11 h1:Cra3wL1oaZsqXJcnPydocx3bIDD5tM7XCuwcn2Uh+2Q=
2+
dagger.io/dagger v0.19.11/go.mod h1:BjAJWl4Lx7XRW7nooNjBi0ZAC5Ici2pkthkdBIZdbTI=
13
github.com/99designs/gqlgen v0.17.81 h1:kCkN/xVyRb5rEQpuwOHRTYq83i0IuTQg9vdIiwEerTs=
24
github.com/99designs/gqlgen v0.17.81/go.mod h1:vgNcZlLwemsUhYim4dC1pvFP5FX0pr2Y+uYUoHFb1ig=
35
github.com/Khan/genqlient v0.8.1 h1:wtOCc8N9rNynRLXN3k3CnfzheCUNKBcvXmVv5zt6WCs=

0 commit comments

Comments
 (0)