n0v1c3 / vira

Create and update your Jira issues while inside Vim!
MIT License
94 stars 12 forks source link

Default filters assigned in vira_projects are not applied #44

Closed uberbrodt closed 3 years ago

uberbrodt commented 3 years ago

I've configured ~/.config/vira/vira_projects.json like so:

{
    "/path/to/repo": {
        "server": "https://myproject.atlassian.net",
        "filter": {
            "project": "CB",
            "assignee": "Chris Brodt",
            "component": "Development"
        }
    }
}

but when I run :ViraIssues or :ViraReport I get an unfiltered list of issues. Applying the filters with the ex commands in does work.

n0v1c3 commented 3 years ago

I will start a double check on my filters.

Is the main missing part of the filter the assignee? It looks like you are using an atlassian service and I have an issue so you can use your name like you have it and not the crazy accountID

n0v1c3 commented 3 years ago

You should see your account ID in the filter assignee/reporter menus.

n0v1c3 commented 3 years ago

You should be able to use your name and not a ridicules account ID.

I assume you are using a full path and not just the dir name? is /path/to/dir vs dir apparently we do not take a full path and makes me laugh a bit. Should not be the Linux user in me.

uberbrodt commented 3 years ago

So "component" wasn't working for me either, so I assumed it wasn't working entirely. I'll update the account id, thanks for the tip.

So what's the standard on the project name? Should it just be the directory of the repo, no the path?

For example, if my repo is at /home/cbrodt/some_project, is the correct name in the vira_projects.json some_project?

On Fri, Sep 18, 2020 at 2:47 PM Travis Gall notifications@github.com wrote:

You should be able to use your name and not a rediculuse account ID.

I assume you are using a full path and not just the dir name? is /path/to/dir vs dir apparently we do not take a full path and makes me laugh a bit. Should not be the Linux user in me.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/n0v1c3/vira/issues/44#issuecomment-695053677, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHO3I2XPG5WSB5PXEW3IO3SGO2NPANCNFSM4RSKOIFQ .

n0v1c3 commented 3 years ago

NOT the path right now. :( JUST the repo some_prject

I quickly added that one to the list as I care about my paths normally.

The accountID should not be an issue I did do a double check on my Atlassian and not my Private and it should not care that you used your name.

n0v1c3 commented 3 years ago

Also, without the vira_projects file at all I assume you are not having issues applying the filters on the go?

uberbrodt commented 3 years ago

Yep, the :ViraFilter* methods work perfectly.

So I updated the project name to match the name of the project directory, but still seems like the filter defined in the projects json are not being applied.

On Fri, Sep 18, 2020 at 01:47:51PM -0700, Travis Gall wrote:

Also, without the vira_projects file at all I assume you are not having issues applying the filters on the go?

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/n0v1c3/vira/issues/44#issuecomment-695078717

n0v1c3 commented 3 years ago

I restarted on very simple this worked for me. It is important to not that you currently must be in that directory I haven't double checked but I am guessing cd in vim will be a fail for me. ie I cd $n0v1c3/vira; vim

We can also start simple as this must work:

 {
      "vira": {
        "server": "https://you.atlassian.net",
        "filter": {
          "project": "VIRA"
        }
      }
 }

If it was the directory we have talked about this a bit and do not currently want to change your filters as directories are changed inside vim. This is only to load it preemptively. Future is save and load filters as well.

n0v1c3 commented 3 years ago

I might also suggest to use "__default__" as this will apply everywhere and you can make more specific ones for the folder you are in at the moment.

n0v1c3 commented 3 years ago

@uberbrodt I have created issue VIRA-225 and moved it high in priorities. Our current check for git will auto send you to __default__ if you are not in a git repo.

n0v1c3 commented 3 years ago

I have checked the first step of the solution in on the VIRA-220 (different issue) branch it should cover the basics from my notes but I need some cleanup to get dev ready for a master push.

n0v1c3 commented 3 years ago

@uberbrodt I have made the push to master VIRA 0.4.0 please let me know if I have made this work for non-git dirs for yourself.

It should accept full paths, just dir name, git root dir full/dir name. Git is the first to be looked at otherwise you will need to be in the same folder on load of vira.

@mikeboiko has also added a nice feature ViraLoadServer that can be used for quick filter switches within vim and stop worrying about the dir you are in.

Here is an example to switch my "branch" to vira at any time. This will then take the vira settings from the vira_project file and apply them. It will also help to quick switch if you are working on multiple jira servers.

nnoremap <silent> <leader>vbv :ViraLoadProject vira<cr>

n0v1c3 commented 3 years ago

Calling this one closed. Let me know if we missed anything.