Closed nathanaelcunningham closed 3 years ago
vira tries a couple of different methods in this order.
git rev-parse --show-toplevel
pwd
See code snippet from load_project_config()
in vira/python/Vira/vira_api.py
:
repo = run_command('git rev-parse --show-toplevel')['stdout'].strip()
if not self.vira_projects.get(repo):
repo = repo.split('/')[-1]
if not self.vira_projects.get(repo):
repo = run_command('pwd')['stdout'].strip()
if not self.vira_projects.get(repo):
repo = repo.split('/')[-1]
if not self.vira_projects.get(repo):
repo = '__default__'
if not self.vira_projects.get('__default__'):
return
Hello @nathanaelcunningham the main goal was put in by @mikeboiko. When you are inside a folder and run vira
ie connect
to the server it will check that list that @mikeboiko mentioned above to see if there is a best fit otherwise fall to the __default__
settings or NO filter if there is no file at all. (Here simply the vira_servers.json/yaml
file will be needed.
If you are inside vim
once vira
is already running a filter basically already exists this is where the commands like ViraFiterEdit
and ViraFilterProjects
will be useful. You can use these commands to edit the filters "on the fly" while using the "ViraFilterReset" to get back to NO filters other than the server you are connected to.
It looks like I may need to do a patch for the highlighting in the ViraFilterProjects
menu but here are the key mappings and still appear to work:
D
remove all selections, confirm and close menus
select a single item for the listS
add all items to the listu
unselect a single item from the listU
unselect all items from the list<cr>
confirm selection and close menuThere is also a bit better breakdown of the json format in #41 I will probable just update that at the same time and just call this one a bit easier for others.
As I am reading to begin cleanup I can see som confusion is possible. I will try to make a simple as can be for here is json
and here is yaml
with a list bellow for what is each row. This way we can have simply ONE section for "here is a file and how you can make a copy for what you need it to do for you"
I personally use the "ViraFilterEdit" command a lot as I can simply take what I make from there and put it inside my vira_projects
file if I want to attach it to a directory.
@nathanaelcunningham hopefully to help you out, this is working for me. You should not need to put the filters
into arrays
if there is only one however it will just be easier to show them this way from the get go. It is also important that the filters are list inside of a list. This was mostly because there is another list for new issues
. I know it is sloppy but that was to help break it down for you.
{
"__default__": {
"server": "https://jira.testing.ca"
},
"__n0v1c3__": {
"server": "https://n0v1c3.atlassian.net"
},
"__testing__": {
"server": "https://jira.testing.ca"
},
"vira": {
"template": "__testing__",
"filter": {
"project": ["VIRA"],
"assignee": ["travis"],
"fixVersion": ["0.5.0"]
}
},
"vim": {
"server": "https://jira.testing.ca",
"filter": {
"project": "VIM"
}
},
"workProject": {
"server": "https://jira.work.net",
"filter": {
"project": ["HARD", "EASY", "MONEY"],
"fixVersion": ["0.0.3", "0.0.4", "0.0.5"]
}
}
}
@nathanaelcunningham give a test on the VIRA-213
branch if you have a chance. I think that you had only one server and that was a bug in my code.
Plug 'n0v1c3/vira', {'branch': 'VIRA-213'}
@n0v1c3 That branch is working. I tested the projects file with just the default server and that worked. Ill try project specific server setup in a bit.
I have a feeling this one has floated past me for a little while now as my test were all done with multiple servers setup. One more test on a list that is being created. Thanks!
I did start with a README
cleanup so I will probably do a quick wrapup of that and push it to master for the rest of the people. It appears to work fine on vim
and nvim
. Multiple servers still appears to work and should just open that menu if a __default__
is not defined.
I am sure some deeper testing will find something wrong and I know I took a sloppy way out but I am not worried with were my code is going for VIRA 0.5.0
. The menus are going to completely change how they load and this will be affected.
@nathanaelcunningham and @mikeboiko I daringly moved it to the master
branch so lets see how that goes for everyone out there. It did not seem to break anythiny I had set up and only made it better so I cannot see to many complaints coming.
Thanks @nathanaelcunningham, I know that I started with the README
and your config but I am sure there are other ways to keep making it better as I don't think I will ever get to finish VIRA-213. (It is a README
based issue and here we are changing the login process).
@nathanaelcunningham I assume not much new has come up for yourself on this? It is on the master
branch and haven't heard much so far.
I will call it closed and new ones can be opened as needed.
How exactly does
When you're in a git repo, vira will auto-load your pre-defined settings by matching the local repo name from file path.
work? I have a vira_projects.json added to the default path following the readme, but whenever i try to look at issues i have to select the server first.