Sorting for repository tags in GraphQL
⛲ What does this MR do and why?
This adds the ability to:
- sort container_repository tags by name using GraphQL
- filter container_repository tags by name using GraphQL
📸 Screenshots or screen recordings
Sort by name_asc
|
sort by name_desc
|
with filter on name
|
---|---|---|
How to set up and validate locally
- Ensure your container registry is working with your GDK.
- In a separate folder, create a Docker file:
FROM scratch copy foo /etc/var/foo
- From a project in your local instance, navigate to
Packages & Registries => Container Registry
- Copy the
docker build
command. - Build a Docker image, adding a tag to the end of it (
aaa
in this example):docker build -t gdk.test:5000/my-proj:aaa .
- Repeat, building a variety of tags with different names.
- Push the tags:
docker push gdk.test:5000/my-proj:aaa
- Visit the graphql explorer page: http://gdk.test:3001/-/graphql-explorer
- Query the tags with the queries from the above screenshots (your repository ID may be different if you already have other existing container repositories):
{ containerRepository(id:"gid://gitlab/ContainerRepository/1") { tags(sort: NAME_DESC) { nodes { name } } } }
📓 MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #336497 (closed)
Edited by Steve Abrams