Skip to content

api: search: deprecate is_automated field, and is-automated filter#45925

Merged
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:deprecate_is_automated
Aug 1, 2023
Merged

api: search: deprecate is_automated field, and is-automated filter#45925
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:deprecate_is_automated

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah commented Jul 10, 2023

api: search: deprecate is_automated field, and is-automated filter

The is-automated field is being deprecated by Docker Hub's search API, and will always be set to "false" in future.

This patch deprecates the field and related filter for the Engine's API. In future, the is-automated filter will not yield any results when searching for is-automated=true, and will be ignored when searching for is-automated=false.

Given that this field is deprecated by an external API, the deprecation will not be versioned, and will apply to any API version.

- What I did

- How I did it

- How to verify it

- Description for the changelog

api: search: deprecate "is_automated" field, and "is-automated" filter

- A picture of a cute animal (not mandatory but encouraged)

Copy link
Copy Markdown
Contributor

@corhere corhere left a comment

Choose a reason for hiding this comment

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

"An external service will no longer be setting this field to true" is not a valid excuse to make unversioned schema-breaking changes to API responses.

Comment thread api/types/registry/registry.go Outdated
@thaJeztah thaJeztah force-pushed the deprecate_is_automated branch from ee24950 to a641a0d Compare July 11, 2023 12:03
Comment thread api/server/router/image/image_routes.go Outdated
}
}

// TODO(thaJeztah): reset the "is-automated" filter on API v1.45 and up (once released).
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Let me update this comment, as we can't realistically version this change, so we should just ignore the filter, and reset the field

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.

Couldn't we version this change by e.g. making it an invalid request to search using an is-automated filter condition on API v1.45+?

so we should just ignore the filter, and reset the field

We can ignore is-automated=false as that will match all images, but we can't just ignore is-automated=true. It would be more surprising for a client searching with an is-automated=true filter to get results where "is_automated": false than to get no results at all.

@thaJeztah thaJeztah force-pushed the deprecate_is_automated branch from a641a0d to 96b2e6f Compare July 11, 2023 12:08
Comment thread docs/api/version-history.md Outdated
@thaJeztah thaJeztah force-pushed the deprecate_is_automated branch from 96b2e6f to 31281f2 Compare July 20, 2023 17:55
@thaJeztah
Copy link
Copy Markdown
Member Author

@corhere updated; removed the part about "no longer be returned" in future; PTAL

@thaJeztah thaJeztah force-pushed the deprecate_is_automated branch from 31281f2 to ba1e1a1 Compare July 20, 2023 20:15
Comment thread docs/api/version-history.md Outdated
Comment on lines +30 to +31
in the next release. Given that this field is deprecated by an external API,
the deprecation will not be versioned, and will apply to any API version.
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.

@thaJeztah thaJeztah force-pushed the deprecate_is_automated branch 3 times, most recently from 02d6d11 to 99a814a Compare July 29, 2023 10:39
@thaJeztah
Copy link
Copy Markdown
Member Author

@corhere I updated the descriptions with (I think) we came to during the maintainers call

  • In future, the field will always be "false"
  • Because of that, searching for is-automated=true will not yield any results.
  • And searching for is-automated=false will have no effect (so effectively "ignored")

Let me know if that looks good to you.

Copy link
Copy Markdown
Contributor

@corhere corhere left a comment

Choose a reason for hiding this comment

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

I don't see any mention of the deprecation in https://docs.docker.com/docker-hub/release-notes/

I'm still not entirely happy with the version history entries, but my remaining nitpicks aren't serious enough to continue blocking this PR.

Comment thread docs/api/version-history.md Outdated
The is-automated field is being deprecated by Docker Hub's search API,
and will always be set to "false" in future.

This patch deprecates the field and related filter for the Engine's API.

In future, the `is-automated` filter will no longer yield any results
when searching for `is-automated=true`, and will be ignored when
searching for `is-automated=false`.

Given that this field is deprecated by an external API, the deprecation
will not be versioned, and will apply to any API version.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the deprecate_is_automated branch from 99a814a to 971083d Compare August 1, 2023 11:46
Copy link
Copy Markdown
Member

@laurazard laurazard left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit 69c9adb into moby:master Aug 1, 2023
@thaJeztah thaJeztah deleted the deprecate_is_automated branch August 1, 2023 14:27
* Deprecated: The `is_automated` field in the `GET /images/search` response has
been deprecated and will always be set to false in the future because Docker
Hub is deprecating the `is_automated` field in its search API. The deprecation
is_ not versioned, and applies to all API versions.
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.

A rogue underscore snuck in. Hope it doesn't mess up the markdown rendering too much

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ah, derp! ❤️ 😂

Looks like GitHub is fine showing it as-is s_, but now I can't un-see; I'll fix it in post 😂

Screenshot 2023-08-02 at 09 08 42

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants