Skip to content

artifact: simpler columns and shorter links for workspace artifacts - #15177

Merged
tiborvass merged 41 commits into
mainfrom
artifact-dimension-views
Nov 25, 2026
Merged

tiborvass merged 41 commits into
mainfrom
artifact-dimension-views

Conversation

@shykes

@shykes shykes commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Dagger can list a workspace's artifacts (checks, generators, services) as a table. This PR redefines the columns of that table and puts the rules in one package, core/artifact/flattening, which runs without an engine.

There are three kinds of column:

  • module: the module name.
  • One column per collection type. The value is the item's key: golang-test=TestInstallK3S.
  • name: the field path from the nearest collection item, or from the module root if there is none: test, generate.stale, python310.unit. An item listed by itself has name=..

Collection columns use the item type name in kebab case. If two collection types share that label, both use their collection type names instead. Labels are assigned from the complete schema and stay the same when the list is filtered.

Before, a collection column was identified by its field path (/golang/modules/packages/tests), and each artifact type had its own column (type:Check, type:Service).

The first two table examples use saved fields from core/artifact/flattening/testdata/canonical-dagger.json, which come from dagger/dagger. hack/artifact-preview can replay saved fields through the CLI's table and link code without a live engine. The later examples are illustrative.

dagger check -la:

GOLANG-MODULE  GOLANG-PACKAGE            GOLANG-TEST       MODULE         NAME              LINK
.              cmd/codegen                                 golang         generate.stale    dag+check://?golang-package=cmd/codegen
.              cmd/codegen/generator/go                    golang         generate.stale    dag+check://?golang-package=cmd/codegen/generator/go
e2e/helm       e2e/helm                  TestCustomProbes  golang         test              dag+check://?golang-test=TestCustomProbes
e2e/helm       e2e/helm                  TestInstallK3S    golang         test              dag+check://?golang-test=TestInstallK3S
                                                           docs           check             dag+check://?name=check
                                                           python-client  python310.slow    dag+check://?name=python310.slow
                                                           python-client  python310.unit    dag+check://?name=python310.unit
                                                           docs           references.stale  dag+check://?name=references.stale

A link keeps only the selectors needed to pick one artifact in the whole workspace. The name for a check on a test item is test; the enclosing module, package, and test keys have their own columns.

A table hides every column that has the same value in all listed rows. dagger check -la --golang-module=e2e/helm:

GOLANG-TEST       LINK
TestCustomProbes  dag+check://?golang-test=TestCustomProbes
TestInstallK3S    dag+check://?golang-test=TestInstallK3S

Collection routes

Keys are exactly what the module author defined, with one exception. If a module root or collection item reaches the same collection type through two or more field routes, the key gets that route in front. The complete schema decides which routes need prefixes.

Here module app reaches Tests through python310.tests and python311.tests, and module lib reaches it only through tests. dagger check -la --name=check:

TEST                     MODULE  LINK
TestBar                  lib     dag+check://?test=TestBar
python310.tests.TestBar  app     dag+check://?test=python310.tests.TestBar&name=check
python310.tests.TestFoo  app     dag+check://?test=python310.tests.TestFoo
python311.tests.TestBar  app     dag+check://?test=python311.tests.TestBar

Without --all, collection item keys are collapsed to *. The route stays visible, so two routes with the same collection type do not become identical rows. For example, two test collections at before and after produce these cells in dagger check -l:

TEST
after.*
before.*

With --all and an item key smoke, those cells become after.smoke and before.smoke.

Filtered collections

Collection-key filters also control the keys passed to module code. Route prefixes are selector coordinates; module code still receives the author's raw keys.

For example, local and ci expose different subsets of one task collection, whose base keys are [format, lint, test]. Selecting local.lint and ci.test gives:

       ORIGINAL KEYS   KEYS PASSED TO MODULE CODE
local  [format, lint]  [lint]
ci     [lint, test]    [test]

The key selected through local must not also reach ci. Distinct subsets keep separate selections even when they share a base. Within one dimension, aliases of the same value combine the keys selected through their routes. Alias representatives are chosen by recipe order so concurrent discovery does not change the view's cache key.

API

  • Artifacts.dimensions returns the columns that vary across the selection. With all: true, it returns all workspace schema dimensions without runtime discovery.
  • Artifact.dimensionKeys uses its source selection's visible columns. With all: true, or without a source selection, it returns all of the artifact's coordinates.
  • filterDimensions(exclude: true) and the link selector ?!test select artifacts that have no value in the given column.
  • The new columns start at API version v1.0.0-beta.29. Earlier API views retain their released schema, including field order and descriptions.
  • Generated GraphQL documentation and the affected PHP and Rust clients are updated.

Validation

TestArtifacts/TestFilteredViewCollectionOrigins passed after the alias fix. The later subset-isolation and deterministic-alias changes have been compiled, including their regression tests, but those tests have not been run.

Supersedes #15136. Part of #15125.

@shykes
shykes force-pushed the artifact-dimension-views branch 2 times, most recently from 39c08dd to 3651e75 Compare November 17, 2026 16:33
@shykes
shykes marked this pull request as ready for review November 17, 2026 18:59
@shykes
shykes requested review from a team as code owners November 17, 2026 18:59
@shykes
shykes force-pushed the artifact-dimension-views branch from 8e91eed to 522c299 Compare November 17, 2026 19:11
@shykes
shykes requested a review from a team as a code owner November 17, 2026 19:11
@shykes
shykes force-pushed the artifact-dimension-views branch 3 times, most recently from 653ab47 to 53fd5e6 Compare November 18, 2026 18:07
@shykes
shykes requested a review from a team as a code owner November 18, 2026 18:07
@shykes
shykes force-pushed the artifact-dimension-views branch from 53fd5e6 to f0e9225 Compare November 19, 2026 18:03
@shykes shykes changed the title artifact: flatten workspace values with stable columns artifact: simpler columns and shorter links for workspace artifacts Nov 19, 2026
@shykes
shykes force-pushed the artifact-dimension-views branch 3 times, most recently from 8804c82 to 7b18787 Compare November 23, 2026 17:12
@shykes
shykes force-pushed the artifact-dimension-views branch from 14c0c44 to 90c5a7d Compare November 24, 2026 01:12
@shykes
shykes force-pushed the artifact-dimension-views branch from 90c5a7d to dcff960 Compare November 24, 2026 06:32

@kpenfound kpenfound 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.

Looks good, doesn't seem to break anything! The output is quite a bit wider than before, at least in the cases I tested. This is mainly because the check/name column went from test to modules.packages.tests.test. The Before/After table in the PR body shows the "before" as golang/modules/packages/tests/test but doesn't seem to be the case.

Including links all the time feels better so we can get people to expect the dag link format.

Confirmed with pretty good certainty that this wont break anything in cloud

@shykes

shykes commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

This is mainly because the check/name column went from test to modules.packages.tests.test.

Wat. That's not intentional... 🤦‍♂️

The name coordinate is the field path from the nearest parent that is
a collection item or a module root. It does not include the fields that
lead to enclosing collections. The API, the CLI table, --name, and the
name= link selector use this one value.

Keep the collection label fallback for item type name conflicts.

Signed-off-by: Solomon Hykes <[email protected]>
When one scope reaches a collection type by two or more field routes,
each key coordinate of that type in that scope is the route, a dot, and
the key. A scope is a module root or a collection item. The complete
schema decides this, as it does for column labels.

The rule is in the flattening schema. The engine stores the route on
each collection node and makes coordinates, key filters, and view rules
from it. Authors still receive their own keys.

Signed-off-by: Solomon Hykes <[email protected]>
shykes and others added 7 commits November 24, 2026 14:22
A view filter compared a collection key with its coordinate on every
route of the collection type. With a filter on one route, module code
also received that key in a collection on another route.

Compare the key on the route of the collection that holds it. A value
on several routes keeps the keys that any of its routes selects.

Signed-off-by: Solomon Hykes <[email protected]>
Keep the released field order and descriptions. Apply the new description
from beta.29.

Signed-off-by: Tibor Vass <[email protected]>
Fix a bug introduced by e0e0a59. Selecting an item through a collection
alias could empty the underlying collection and make the query fail.

TestFilteredViewCollectionOrigins passes with this fix.

Signed-off-by: Tibor Vass <[email protected]>
Keep collection routes visible when item keys are collapsed. Add tests
for collapsed and expanded lists.

Example: a collection of Test items has two routes, unit and integration.
The TEST column represents that collection. An asterisk marks collapsed
item keys. The links below stand for the full artifact links.

Old output from dagger check -l:

    LINK
    <integration link>
    <unit link>

New output:

    TEST           LINK
    integration.*  <integration link>
    unit.*         <unit link>

With --all and an item key smoke, the cells show integration.smoke and
unit.smoke.

Signed-off-by: Tibor Vass <[email protected]>
Use route prefixes where the schema requires them. Keep bare keys for
single-route collections.

Signed-off-by: Tibor Vass <[email protected]>
@tiborvass
tiborvass force-pushed the artifact-dimension-views branch from 0a99485 to 0a27d37 Compare November 24, 2026 23:35
Fix a bug that combined selected keys from different subsets of one base.

Example: local and ci are different subsets of one task collection:

    base:  [format, lint, test]
    local: [format, lint]
    ci:    [lint, test]

When selecting local.lint and ci.test, module code should receive:

    local: [lint]
    ci:    [test]

Previously, ci received [lint, test]. The lint key selected through local
also reached ci.

Keep each distinct value's selection separate. Share base keys only to
construct derived values. Preserve bindings when scoped calls change
result IDs, and invalidate cached views that used the old bindings.

Add coverage for overlapping subsets, aliases, and changed object state.

Signed-off-by: Tibor Vass <[email protected]>
Concurrent discovery could choose a different alias for the same value
and change the view cache key. Keep the alias with the smallest recipe
encoding.

Check that forward and reverse discovery produce the same view key.

Signed-off-by: Tibor Vass <[email protected]>
@tiborvass
tiborvass merged commit 84ab48a into main Nov 25, 2026
77 checks passed
@tiborvass
tiborvass deleted the artifact-dimension-views branch November 25, 2026 01:18
eunomie added a commit to dagger/ruby-sdk that referenced this pull request Nov 26, 2026
Since v1.0.0-beta.29 (dagger/dagger#15177), a check's link holds the
fewest selectors that select exactly that check.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/python-sdk that referenced this pull request Nov 26, 2026
Since dagger/dagger#15177 (v1.0.0-beta.29), a collection column is named
after its item type, so kinds-items-item names no column and selects
no generator.

Signed-off-by: Yves Brissaud <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants