Skip to content

artifact: parent is a full artifact reference, not a bare version - #7963

Merged
EngHabu merged 1 commit into
mainfrom
haytham/artifact-parent-ref
Sep 2, 2026
Merged

artifact: parent is a full artifact reference, not a bare version#7963
EngHabu merged 1 commit into
mainfrom
haytham/artifact-parent-ref

Conversation

@EngHabu

@EngHabu EngHabu commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Why

Follow-up to #7955 on review feedback: a bare parent_version string can only express lineage within one artifact name. Pointing at a full artifact reference lets a version record derivation across artifacts — a model deriving from a dataset version — which a version string cannot say.

What

  • ArtifactSpec.parent_version (string) → ArtifactSpec.parent_artifact (core.ArtifactVersionId), same field number 7.
  • ProducedArtifact.parent_versionProducedArtifact.parent_artifact, same field number 6.
  • Deliberate wire break: the string fields shipped in v2.0.46 but nothing consumes them yet (the service-side implementation is still open at unionai/cloud#18093), so replacing in place beats a reserved-field graveyard. Confirmed OK by the maintainer.
  • Ergonomics preserved for the common case: empty key fields inherit the child's own org/project/domain and an empty key name inherits its name, so {version: "v1"} still means "the v1 of this same artifact". Scope is constrained to the artifact's own org/project/domain (same convention as ArtifactSource).
  • ListArtifacts children filter becomes the parent_name + parent_version EQUAL pair (always together), replacing the name-scoped parent_version filter — children may now live under any name in the project.
  • Semantics otherwise unchanged: stored as given, never resolved, dangling parents legal, immutable after creation.
  • Regenerated Go/Python/TS/Rust bindings.

Companion service rework lands in unionai/cloud#18093.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VzRDrkwWaxeTpqB4WS165m

Replaces ArtifactSpec.parent_version and ProducedArtifact.parent_version
(same field numbers — the string fields shipped in v2.0.46 but nothing
consumes them yet, so a clean break beats a reserved graveyard) with
parent_artifact, a core.ArtifactVersionId.

A bare version string could only express lineage within one artifact
name. A full reference lets a version record derivation across
artifacts — a model deriving from a dataset version — while keeping the
common same-name case as terse as before: empty key fields inherit the
child's own scope and name, so {version: "v1"} still means "the v1 of
this same artifact".

The parent must live in the artifact's own org/project/domain (same
convention as ArtifactSource provenance). Everything else is unchanged:
stored as given, never resolved, dangling parents legal, immutable
after creation. The ListArtifacts children filter becomes the
parent_name + parent_version EQUAL pair, always together, replacing the
name-scoped parent_version filter.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VzRDrkwWaxeTpqB4WS165m
Signed-off-by: Haytham Abuelfutuh <haytham@union.ai>
Copilot AI lite review requested due to automatic review settings September 2, 2026 20:49
@github-actions github-actions Bot added the flyte2 label Sep 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new parent_artifact fields remove prior max-length validation and the produced-artifact docs don’t clearly state the same-scope constraint described in the PR, which can lead to oversized identifiers and consumer confusion.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates the artifact lineage schema to reference a full parent artifact version identifier (rather than a bare version string), enabling derivation links across different artifact names while keeping field numbers stable.

Changes:

  • Replaces parent_version string fields with parent_artifact (core.ArtifactVersionId) in ArtifactSpec and ProducedArtifact (wire-breaking by design).
  • Updates ListArtifactsRequest documentation to describe the new children-filter pair (parent_name + parent_version).
  • Regenerates Go/Python/TypeScript bindings and related generated artifacts (validate code, swagger).
File summaries
File Description
flyteidl2/task/common.proto Updates ProducedArtifact to use parent_artifact instead of parent_version.
flyteidl2/artifact/artifact.proto Updates ArtifactSpec to use parent_artifact instead of parent_version.
flyteidl2/artifact/artifact_service.proto Updates ListArtifacts filter documentation to the new parent filter pair.
gen/go/flyteidl2/task/common.pb.go Regenerated Go bindings for ProducedArtifact.parent_artifact.
gen/go/flyteidl2/task/common.pb.validate.go Regenerated Go validation scaffolding for embedded parent_artifact.
gen/go/flyteidl2/artifact/artifact.pb.go Regenerated Go bindings for ArtifactSpec.parent_artifact.
gen/go/flyteidl2/artifact/artifact.pb.validate.go Regenerated Go validation scaffolding for embedded parent_artifact.
gen/go/flyteidl2/artifact/artifact_service.pb.go Regenerated Go bindings with updated request docs.
gen/go/gateway/flyteidl2/connector/service.swagger.json Regenerated swagger reflecting parent_artifact in ProducedArtifact schema.
gen/python/flyteidl2/task/common_pb2.py Regenerated Python protobuf module for ProducedArtifact.parent_artifact.
gen/python/flyteidl2/task/common_pb2.pyi Regenerated Python typing stubs for ProducedArtifact.parent_artifact.
gen/python/flyteidl2/artifact/artifact_pb2.py Regenerated Python protobuf module for ArtifactSpec.parent_artifact.
gen/python/flyteidl2/artifact/artifact_pb2.pyi Regenerated Python typing stubs for ArtifactSpec.parent_artifact.
gen/ts/flyteidl2/task/common_pb.ts Regenerated TS bindings for ProducedArtifact.parentArtifact.
gen/ts/flyteidl2/artifact/artifact_pb.ts Regenerated TS bindings for ArtifactSpec.parentArtifact.
gen/ts/flyteidl2/artifact/artifact_service_pb.ts Regenerated TS bindings with updated request docs.
Review details

Files not reviewed (7)

  • gen/go/flyteidl2/artifact/artifact.pb.go: Generated file
  • gen/go/flyteidl2/artifact/artifact.pb.validate.go: Generated file
  • gen/go/flyteidl2/artifact/artifact_service.pb.go: Generated file
  • gen/go/flyteidl2/task/common.pb.go: Generated file
  • gen/go/flyteidl2/task/common.pb.validate.go: Generated file
  • gen/python/flyteidl2/artifact/artifact_pb2.py: Generated file
  • gen/python/flyteidl2/task/common_pb2.py: Generated file
  • Files reviewed: 9/18 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

// to exist (publication order is not guaranteed), so readers walking lineage
// must tolerate a dangling parent. Immutable after creation.
string parent_version = 7 [(buf.validate.field).string.max_len = 255];
core.ArtifactVersionId parent_artifact = 7;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in the follow-up #7964 (the fix missed the #7963 merge window): max_len added to core.ArtifactKey (project/domain 64, name 255, org 63, matching artifact.ArtifactName) and ArtifactVersionId.version (255). Fields stay optional since empty-means-inherit is load-bearing for parent_artifact.

// the produced artifact's own scope and name, so a bare {version: "v1"}
// declares the previous version of this same artifact as parent; a set name
// records cross-artifact derivation.
flyteidl2.core.ArtifactVersionId parent_artifact = 6;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in the follow-up #7964 — same constraints as the sibling comment on artifact.proto; ArtifactVersionId.version is bounded at 255 like the parent_version string was. The cloud service also enforces these lengths server-side at CreateArtifact.

Comment on lines +155 to +159
// it derives a new version from one it consumed, so the resulting lineage
// branches instead of reading as a linear chain. Empty key fields inherit
// the produced artifact's own scope and name, so a bare {version: "v1"}
// declares the previous version of this same artifact as parent; a set name
// records cross-artifact derivation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in the follow-up #7964 — the ProducedArtifact.parent_artifact comment now states explicitly that only the name may differ and non-empty org/project/domain must match the produced artifact's own scope (cross-project/domain lineage is rejected at registration).

@EngHabu
EngHabu merged commit 500b99b into main Sep 2, 2026
26 checks passed
@EngHabu
EngHabu deleted the haytham/artifact-parent-ref branch September 2, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants