Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidating tags #310

Open
khoroshevskyi opened this issue May 29, 2024 · 6 comments
Open

Consolidating tags #310

khoroshevskyi opened this issue May 29, 2024 · 6 comments
Milestone

Comments

@khoroshevskyi
Copy link
Member

Right now, we treat namespace/name:tag as completely different projects.

What if we consolidate all name:tag entries to name, and from the project level, we retrieve the desired tag of the project?

e.g.
image

This 2 project in namespace page would be just ONE project.

Also, if user doesn't know tag of the project, then user can access project, even if there is only one existing tag.

@nleroy917
Copy link
Member

nleroy917 commented May 29, 2024

Yeah this makes the most sense to me. This is actually how dockerhub does it. Check out the pephub docker image

image

It has a tags tab:

image

So maybe we add a dropdown on a project page and just let the user pick a tag

@nleroy917
Copy link
Member

An idea is a dropdown where a user can select the tag (defaults to default) unless query param is specified:

image

@nleroy917
Copy link
Member

While I'm looking at it, I propose getting rid of the blue schema tag it doesn't seem to add anything and bloats it a bit

@khoroshevskyi
Copy link
Member Author

khoroshevskyi commented May 29, 2024

and instead of tag, annotation return model will have tags, with available tags

class AnnotationModel(BaseModel):
    """
    Project Annotation model. All meta metadata
    """

    namespace: Optional[str]
    name: Optional[str]
    **tags: Optional[str]**
    is_private: Optional[bool]
    number_of_samples: Optional[int]
    description: Optional[str]
    last_update_date: Optional[str]
    submission_date: Optional[str]
    digest: Optional[str]
    pep_schema: Optional[str]
    pop: Optional[bool] = False
    stars_number: Optional[int] = 0
    forked_from: Optional[Union[str, None]] = None

@nleroy917
Copy link
Member

nleroy917 commented May 29, 2024

yeah I like this idea -- this makes a lot of sense. Can we leverage this to get rid of these query params too?

image

Here is an example route:

@project.get(
    "/views",
    summary="get list of views for a project",
    tags=["views"],
    response_model=ProjectViews,
)
def get_views(
    namespace: str,
    project: str,
    tag: str = DEFAULT_TAG,
    agent: PEPDatabaseAgent = Depends(get_db),
):
    return agent.view.get_views_annotation(namespace, project, tag=tag)

@nleroy917
Copy link
Member

@khoroshevskyi What do you think about this one? Any progress made to the backend?

@nleroy917 nleroy917 added this to PEP Jun 26, 2024
@nleroy917 nleroy917 added this to the v0.12.x milestone Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants