Skip to content

Commit a43290e

Browse files
committed
add docstrings for backwards compatibility api
also add more detailed descriptions to proto install action Signed-off-by: Humair Khan <[email protected]>
1 parent d7ab3af commit a43290e

File tree

9 files changed

+316
-198
lines changed

9 files changed

+316
-198
lines changed

.github/actions/protobuf/action.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
name: "Install Protoc"
1+
name: "Install Proto dependencies & Pipeline Spec"
2+
description: |
3+
This action pins various Proto generation packages to default versions and
4+
installs these dependencies in the workflow environment. It will also
5+
install the kfp-pipeline-spec. Whenever KFP project updates generation
6+
packages, the defaults here must be updated.
27
inputs:
38
protoc_version:
49
required: true
@@ -42,16 +47,13 @@ runs:
4247
- name: Install Wheel
4348
shell: bash
4449
run: pip3 install wheel==${{inputs.wheels_version}}
45-
4650
- name: Install protobuf
4751
shell: bash
4852
run: pip3 install protobuf==${{inputs.protobuf_python_version}}
49-
5053
- name: Generate API proto files
5154
working-directory: ./api
5255
shell: bash
5356
run: make clean python
54-
5557
- name: Install kfp-pipeline-spec from source
5658
shell: bash
5759
run: |

backend/src/apiserver/server/api_converter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ func toApiTriggerV1(trigger *model.Trigger) *apiv1beta1.Trigger {
773773
cronSchedule.Cron = *trigger.Cron
774774
if trigger.CronScheduleStartTimeInSec != nil {
775775
cronSchedule.StartTime = timestamppb.New(time.Unix(*trigger.CronScheduleStartTimeInSec, 0))
776-
} // timestamppb.New(time.Unix(trigger.CronScheduleStartTimeInSec, 0))
776+
}
777777
if trigger.CronScheduleEndTimeInSec != nil {
778778
cronSchedule.EndTime = timestamppb.New(time.Unix(*trigger.CronScheduleEndTimeInSec, 0))
779779
}

backend/src/apiserver/server/list_request_util.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,13 @@ func validatedListOptions(listable list.Listable, pageToken string, pageSize int
215215
return opts, nil
216216
}
217217

218+
// transformJSONForBackwardCompatibility replaces specific JSON key names to maintain
219+
// backward compatibility with older APIs. Previously, KFP deviated from the typical
220+
// snake_case naming convention for protobuf field names for Filter predicate values.
221+
// This function replaces specific JSON key names to maintain backward compatibility
222+
// with older APIs.
223+
// See Predicate.value in backend/api/v2beta1/filter.proto for these values.
224+
// Previously
218225
func transformJSONForBackwardCompatibility(jsonStr string) (string, error) {
219226
replacer := strings.NewReplacer(
220227
`"intValue":`, `"int_value":`,

backend/src/common/util/workflow.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,12 @@ func collectNodeMetricsOrNil(runID string, nodeStatus *workflowapi.NodeStatus, r
547547
return reportMetricsRequest.GetMetrics(), nil
548548
}
549549

550+
// Previously number_value for RunMetrics in backend/api/v1beta1/run.proto
551+
// allowed camelCase field values in JSON, to be consistent with the
552+
// rest of the API (as well as with KFP api docs); this value was switched
553+
// to support snake case. This function will convert old values to the
554+
// newer snakecase so we can continue to support camelcase Metric Values for
555+
// backwards compatibility for the end user.
550556
func transformJSONForBackwardCompatibility(jsonStr string) (string, error) {
551557
replacer := strings.NewReplacer(
552558
`"numberValue":`, `"number_value":`,

go.mod

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ require (
6969

7070
require (
7171
cel.dev/expr v0.23.1 // indirect
72-
cloud.google.com/go v0.115.0 // indirect
73-
cloud.google.com/go/auth v0.8.1 // indirect
74-
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
75-
cloud.google.com/go/compute/metadata v0.6.0 // indirect
76-
cloud.google.com/go/iam v1.1.13 // indirect
77-
cloud.google.com/go/storage v1.43.0 // indirect
7872
cloud.google.com/go v0.119.0 // indirect
7973
cloud.google.com/go/auth v0.15.0 // indirect
8074
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
@@ -84,7 +78,7 @@ require (
8478
cloud.google.com/go/storage v1.50.0 // indirect
8579
dario.cat/mergo v1.0.1 // indirect
8680
filippo.io/edwards25519 v1.1.0 // indirect
87-
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 // indirect
81+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0 // indirect
8882
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.50.0 // indirect
8983
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.50.0 // indirect
9084
github.com/Masterminds/goutils v1.1.1 // indirect
@@ -115,7 +109,7 @@ require (
115109
github.com/beorn7/perks v1.0.1 // indirect
116110
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
117111
github.com/cespare/xxhash/v2 v2.3.0 // indirect
118-
github.com/cncf/xds/go v0.0.0-20250121191232-2f005788dc42 // indirect
112+
github.com/cncf/xds/go v0.0.0-20250326154945-ae57f3c0d45f // indirect
119113
github.com/colinmarc/hdfs/v2 v2.4.0 // indirect
120114
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
121115
github.com/denisenkom/go-mssqldb v0.12.3 // indirect
@@ -131,6 +125,7 @@ require (
131125
github.com/felixge/httpsnoop v1.0.4 // indirect
132126
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
133127
github.com/go-ini/ini v1.67.0 // indirect
128+
github.com/go-jose/go-jose/v4 v4.0.5 // indirect
134129
github.com/go-logr/logr v1.4.2 // indirect
135130
github.com/go-logr/stdr v1.2.2 // indirect
136131
github.com/go-logr/zapr v1.3.0 // indirect
@@ -143,9 +138,9 @@ require (
143138
github.com/go-viper/mapstructure/v2 v2.3.0 // indirect
144139
github.com/goccy/go-json v0.10.5 // indirect
145140
github.com/gogo/protobuf v1.3.2 // indirect
146-
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
141+
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
147142
github.com/golang/protobuf v1.5.4 // indirect
148-
github.com/google/gnostic-models v0.6.8 // indirect
143+
github.com/google/gnostic-models v0.6.9 // indirect
149144
github.com/google/gofuzz v1.2.0 // indirect
150145
github.com/google/s2a-go v0.1.9 // indirect
151146
github.com/google/wire v0.6.0 // indirect
@@ -201,20 +196,29 @@ require (
201196
github.com/spf13/afero v1.12.0 // indirect
202197
github.com/spf13/cast v1.7.1 // indirect
203198
github.com/spf13/pflag v1.0.6 // indirect
199+
github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect
204200
github.com/stoewer/go-strcase v1.3.0 // indirect
205201
github.com/subosito/gotenv v1.6.0 // indirect
206202
github.com/tinylib/msgp v1.3.0 // indirect
207203
github.com/valyala/bytebufferpool v1.0.0 // indirect
208204
github.com/valyala/fasttemplate v1.2.2 // indirect
209205
github.com/x448/float16 v0.8.4 // indirect
206+
github.com/zeebo/errs v1.4.0 // indirect
210207
go.mongodb.org/mongo-driver v1.7.5 // indirect
211208
go.opencensus.io v0.24.0 // indirect
212209
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
213-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect
214-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
210+
go.opentelemetry.io/contrib/detectors/gcp v1.35.0 // indirect
211+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect
212+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
213+
go.opentelemetry.io/contrib/instrumentation/runtime v0.48.0 // indirect
215214
go.opentelemetry.io/otel v1.35.0 // indirect
215+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.23.0 // indirect
216+
go.opentelemetry.io/otel/exporters/prometheus v0.45.1 // indirect
216217
go.opentelemetry.io/otel/metric v1.35.0 // indirect
218+
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
219+
go.opentelemetry.io/otel/sdk/metric v1.35.0 // indirect
217220
go.opentelemetry.io/otel/trace v1.35.0 // indirect
221+
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
218222
go.uber.org/multierr v1.11.0 // indirect
219223
golang.org/x/crypto v0.38.0 // indirect
220224
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
@@ -223,7 +227,7 @@ require (
223227
golang.org/x/sys v0.33.0 // indirect
224228
golang.org/x/term v0.32.0 // indirect
225229
golang.org/x/text v0.26.0 // indirect
226-
golang.org/x/time v0.6.0 // indirect
230+
golang.org/x/time v0.11.0 // indirect
227231
golang.org/x/tools v0.33.0 // indirect
228232
golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect
229233
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect

0 commit comments

Comments
 (0)