Skip to content

Search by arbitrary metadata #567

Closed

Description

@vmiklos

In case a bug is imported (e.g. from github), then git-bug knows that url, e.g.:

$ git show refs/bugs/016b3f0c56c1724c0230919ce3218b5cfa19f8ce:root|python3 -m json.tool
{
    "version": 2,
    "ops": [
        {
            "type": 1,
            "author": {
                "id": "e256bc3329691afb0ed3f7d3b9675ef8cecd1a16"
            },
            "timestamp": 1583555863,
            "metadata": {
                "github-id": "MDU6SXNzdWU1NzcyNzY4MTY=",
                "github-url": "https://github.com/author/myproject/issues/6",
                "origin": "github"
            },

It would be nice if e.g. git bug ls could search in this metadata. So let's say I'm offline and I would like to look up https://github.com/author/myproject/issues/6, then that would be possible. Perhaps something like:

git bug ls --metadata github-url=https://github.com/author/myproject/issues/6

could list all matching bugs, typically just one.

Activity

  1. vmiklos commented on Feb 12, 2021

    @vmiklos
    ContributorAuthor

    @MichaelMure what do you think? I don't mind taking a look at this myself, just wanted to do a sanity-check on the idea in general and on the syntax in particular before I invest time in coding this. Thanks.

  2. MichaelMure commented on Feb 12, 2021

    @MichaelMure
    Contributor

    I guess that make sense. The syntax is a bit problematic though (both for the query language and the CLI argument for ls): you need to specify both key and value, which is something both of them don't do yet.

    To be able to search like that you would need to:

    1. add the metadata in the index (see BugExcerpt) actually it's already there, CreateMetadata in BugExcerpt
    2. add a new keyword in the query language (/query), find a way to deal with the key/value problem
    3. implement the search (/cache/filter.go)
    4. connect all that stuff in the ls command, deal with the key/value problem
  3. changed the title [-]Search by original bug URL[/-] [+]Search by arbitrary metadata[/+] on Feb 12, 2021
  4. vmiklos commented on Feb 14, 2021

    @vmiklos
    ContributorAuthor

    Thanks! I have a PoC (without any error handling) based on the above, will submit a PR when I don't see obvious problems with it anymore.

  5. MichaelMure commented on Feb 14, 2021

    @MichaelMure
    Contributor

    You can also open a draft PR for some early feedback (if I find the time of course), as you prefer.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions