Skip to content

Commit

Permalink
chore: remove withFocus (dagger#8647)
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Chadwell <[email protected]>
  • Loading branch information
jedevc authored Nov 7, 2024
1 parent af4b66f commit 1eb3270
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 170 deletions.
7 changes: 7 additions & 0 deletions .changes/unreleased/Breaking-20241008-181543.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: Breaking
body: |
Remove deprecated `Container.withFocus` and `Container.withoutFocus`
time: 2024-10-08T18:15:43.775091231+01:00
custom:
Author: jedevc
PR: "8647"
4 changes: 0 additions & 4 deletions core/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ type Container struct {
// Services to start before running the container.
Services ServiceBindings `json:"services,omitempty"`

// Focused indicates whether subsequent operations will be
// focused, i.e. shown more prominently in the UI.
Focused bool `json:"focused"`

// The args to invoke when using the terminal api on this container.
DefaultTerminalCmd DefaultTerminalCmdOpts `json:"defaultTerminalCmd,omitempty"`

Expand Down
25 changes: 25 additions & 0 deletions core/integration/legacy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,3 +709,28 @@ func (m *Test) NewProto(proto dagger.NetworkProtocol) dagger.NetworkProtocol {
require.NoError(t, err)
require.Contains(t, out, "UDP")
}

func (LegacySuite) TestContainerWithFocus(ctx context.Context, t *testctx.T) {
// Changed in dagger/dagger#8647
//
// Ensure that the old schemas still have withFocus/withoutFocus.

var res any
err := testutil.Query(t,
`{
container {
from(address: "alpine") {
withFocus {
withoutFocus {
withExec(args: ["echo", "hello world"]) {
sync
}
}
}
}
}
}`, &res, &testutil.QueryOptions{
Version: "v0.13.3",
})
require.NoError(t, err)
}
10 changes: 4 additions & 6 deletions core/schema/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,11 @@ func (s *containerSchema) Install() {
ArgDoc("service", `Identifier of the service container`),

dagql.Func("withFocus", s.withFocus).
View(BeforeVersion("v0.13.4")).
Doc(`Indicate that subsequent operations should be featured more prominently in the UI.`),

dagql.Func("withoutFocus", s.withoutFocus).
View(BeforeVersion("v0.13.4")).
Doc(`Indicate that subsequent operations should not be featured more prominently in the UI.`,
`This is the initial state of all containers.`),

Expand Down Expand Up @@ -1952,15 +1954,11 @@ func (s *containerSchema) exposedPorts(ctx context.Context, parent *core.Contain
}

func (s *containerSchema) withFocus(ctx context.Context, parent *core.Container, args struct{}) (*core.Container, error) {
child := parent.Clone()
child.Focused = true
return child, nil
return parent, nil
}

func (s *containerSchema) withoutFocus(ctx context.Context, parent *core.Container, args struct{}) (*core.Container, error) {
child := parent.Clone()
child.Focused = false
return child, nil
return parent, nil
}

type containerWithDefaultTerminalCmdArgs struct {
Expand Down
12 changes: 0 additions & 12 deletions docs/docs-graphql/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -645,11 +645,6 @@ type Container {
sources: [FileID!]!
): Container!

"""
Indicate that subsequent operations should be featured more prominently in the UI.
"""
withFocus: Container!

"""Retrieves this container plus the given label."""
withLabel(
"""The name of the label (e.g., "org.opencontainers.artifact.created")."""
Expand Down Expand Up @@ -890,13 +885,6 @@ type Container {
paths: [String!]!
): Container!

"""
Indicate that subsequent operations should not be featured more prominently in the UI.
This is the initial state of all containers.
"""
withoutFocus: Container!

"""Retrieves this container minus the given environment label."""
withoutLabel(
"""
Expand Down
11 changes: 0 additions & 11 deletions docs/static/api/reference/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4453,10 +4453,6 @@ <h6 class="field-argument-name"><span class="property-name"><code>sources</code>
</div>
</td>
</tr>
<tr>
<td data-property-name=""><a class="property-name" id="Container-withFocus" href="#Container-withFocus"><code>withFocus</code></a> - <span class="property-type"><a href="#definition-Container"><code>Container!</code></a></span> </td>
<td> Indicate that subsequent operations should be featured more prominently in the UI. </td>
</tr>
<tr class="row-has-field-arguments">
<td data-property-name=""><a class="property-name" id="Container-withLabel" href="#Container-withLabel"><code>withLabel</code></a> - <span class="property-type"><a href="#definition-Container"><code>Container!</code></a></span> </td>
<td> Retrieves this container plus the given label. </td>
Expand Down Expand Up @@ -4815,13 +4811,6 @@ <h6 class="field-argument-name"><span class="property-name"><code>paths</code></
</div>
</td>
</tr>
<tr>
<td data-property-name=""><a class="property-name" id="Container-withoutFocus" href="#Container-withoutFocus"><code>withoutFocus</code></a> - <span class="property-type"><a href="#definition-Container"><code>Container!</code></a></span> </td>
<td>
<p>Indicate that subsequent operations should not be featured more prominently in the UI.</p>
<p>This is the initial state of all containers.</p>
</td>
</tr>
<tr class="row-has-field-arguments">
<td data-property-name=""><a class="property-name" id="Container-withoutLabel" href="#Container-withoutLabel"><code>withoutLabel</code></a> - <span class="property-type"><a href="#definition-Container"><code>Container!</code></a></span> </td>
<td> Retrieves this container minus the given environment label. </td>
Expand Down
28 changes: 0 additions & 28 deletions sdk/elixir/lib/dagger/gen/container.ex

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 0 additions & 20 deletions sdk/go/dagger.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 0 additions & 20 deletions sdk/php/generated/Container.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions sdk/python/src/dagger/client/gen.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 0 additions & 19 deletions sdk/rust/crates/dagger-sdk/src/gen.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 0 additions & 32 deletions sdk/typescript/api/client.gen.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1eb3270

Please sign in to comment.