Giter Site home page Giter Site logo

n0v1c3 / vira Goto Github PK

View Code? Open in Web Editor NEW
93.0 5.0 12.0 584 KB

Create and update your Jira issues while inside Vim!

License: MIT License

Python 42.71% Vim Script 57.23% Shell 0.06%
vim jira atlassian python git github jira-servers jira-issue vira vim-jira-atlassian

vira's Introduction

VIRA 0.4.14

Vim JIRA Atlassian: Create, Update and Follow Along Jira Issues Actively Without Leaving Vim!

If you have made it this far there is a good chance that you already enjoy staying inside of vim as much as you can. vira will help you stay on top of your Jira development process without leaving your favorite environment.

Table of Contents

VIRA 0.4.14 UPDATES:
VIRA-213: q is going to be replaced by gq both will only work until VIRA 0.5.0.
VIRA-213: Added proper message inside vim and nvim for q removal.
VIRA-283: Added GV syntax to {code} sections.
VIRA-282: READ-ONLY for report and menu windows.
VIRA-282: Track cursor position.
Recent Previous Releases:
0.4.13 - remove manual login and README update (Travis Gall)
0.4.12 - Don't append Null in non-empty server list (Krzysztof Konopko)
0.4.11 - README remove old workarounds (Travis Gall)
0.4.10 - Handle missing assignee and guess current user correctly (Travis Gall)
0.4.9 - No Assignee "whatsoever", Missing default, and Default Sort (Krzysztof Konopko)

Example of vim-plug post-update hook to automatically install python dependencies along with vira:

Plug 'n0v1c3/vira', { 'do': './install.sh' }

Alternatively, manually install the python3 dependencies:

pip3 install --user jira

If you would like to be on board with the active development the dev branch can be used:

Plug 'n0v1c3/vira', { 'do': './install.sh', 'branch': 'dev' }

There are currently two separate files that are used in configuration. The ~/.config/vira/vira_servers.json file will be the required file for your connections and ~/.config/vira/vira_projects.json will map projects to folders while linking them to servers inside vira_servers.json.

NOTE: Both of these files can be moved to other locations and set in your .vimrc:

let g:vira_config_file_servers = $HOME . '/.config/vira/vira_servers.json'
let g:vira_config_file_projects = $HOME . '/.config/vira/vira_projects.json'

We also support trying the yaml configuration however, it will require one more library for python. The default file-type is json, this is because it comes "out of the box" inside of python. Run the following from the terminal if you require PyYAML to enjoy yaml:

pip3 install --user pyyaml

NOTE: When using yaml a link is REQUIRED in your .vimrc settings.

For each Jira server, the following configuration variables are available, only one of the options password or password_cmd will be set depending on a raw password vs a password command:

  • username - Jira server username.
  • password_cmd - Run a CLI password manager such as pass or lpass to retrieve the Jira server password.
  • password - Enter Jira server password in plain text. This is not recommended for security reasons, but we're not going to tell you how to live your life.
  • skip_cert_verify - This option can be set in order to connect to a sever that is using self-signed TLS certificates.

The following is an example of a typical vira_servers.json configuration:

{
  "https://n0v1c3.atlassian.net": {
    "username": "travis",
    "password_cmd": "lpass show --password account"
  },
  "https://jira.career.com": {
    "username": "mike",
    "password": "SuperSecretPassword",
    "skip_cert_verify": true
  }
}

Here is an example of the vira_servers.yaml configuration:

https://n0v1c3.atlassian.net:
  username: user1
  password_cmd: lpass show --password account
  skip_cert_verify: true
https://jira.career.com:
  username: user2
  password: SuperSecretPassword

IMPORTANT: If only ONE the connection is automatic otherwise, a menu will open to select a server. This can be avoided with the __default__ mapping, see Jira Projects.

IMPORTANT: If NO configuration is found you will be asked for a manual URL, username, and password entry.

Atlassian Cloud Jira Key may be required if you are using the Atlassian Cloud service. Create an API token. This API token is now the password set in your vira_servers.json file.

  • Configure ~/.config/vira/vira_servers.json as per Jira servers configuration.
  • Run :ViraServers and select a server with <cr>.
  • Run :ViraIssues and select an issue with <cr>.
  • Run :ViraReport to view report.
  • Press <cr> to edit any field.
  • Rejoice because you have one less reason to leave vim!

Check out Menus and Reports after that for a list of commands and tools that can be mapped to your .vimrc like the ones above.

As mentioned in Configuration a separate file vira_projects.json/yaml can be created in the vira configuration directory. __default__ is also set up here to define the default server to use in the other directories when there is more than one server mapped.

NOTE: When you're in a git repo, vira will auto-load your pre-defined settings by matching the local repo name from file path.

NOTE: vira will only load the vira_projects.json/yaml configuration automatically once per vim session. You can, however, manually switch servers and filters as many times as you want after that.

For each Jira project, set:

  • server - The Jira server to connect to (using authentication details from vira_servers.json/yaml).

The following is an example of a typical vira_projects.json configuration:

{
  "__default__": {
    "server": "https://n0v1c3.atlassian.net"
  },
  "vira": {
    "server": "https://n0v1c3.atlassian.net"
  },
  "OtherProject": {
    "server": "https://jira.career.com"
  }
}

The following is an example of the same configuration in yaml:

__default__:
  server: https://n0v1c3.atlassian.net
vira:
  server: https://n0v1c3.atlassian.net
OtherProject:
  server: https://jira.career.com

Default repo filters can be defined under a filter key as such:

{
  "vira": {
    "server": "https://n0v1c3.atlassian.net",
    "filter": {
      "project": ["VIRA"],
      "assignee": ["Travis Gall"],
      "priority": ["High", "Highest"],
      "fixVersion": ["0.4.13"]
    }
  },
  "OtherProject": {
    "server": "https://jira.career.com",
    "filter": {
      "project": ["VQL"],
      "assignee": ["Travis Gall", "Mike Boiko"],
      "priority": ["low", "lowest"],
      "fixVersion": ["2.2.18"]
  }
}
vira:
  server: https://n0v1c3.atlassian.net
  filter:
    project: [VIRA]
    assignee: [Mike Boiko]
    priority: [High, Highest]
    fixVersion: [1.1.1, 1.1.2]
OtherProject:
  server: https://jira.career.com
  filter:
    project: [MAIN]
    assignee: [Travis Gall]
    status: [In-Progress]

The acceptable values for the filter key are:

  • project - Filter these projects. Can be a single item or list.
  • assignee - Filter these assignees by display name. Can be a single item or list.
  • component - Filter these components. Can be a single item or list.
  • epic - Filter these epics. Can be a single item or list.
  • fixVersion - Filter these versions. Can be a single item or list.
  • issuetype - Filter the types of issues. Can be a single item or list.
  • priority - Filter these priorities. Can be a single item or list.
  • reporter - Filter these reporters. Can be a single item or list.
  • status - Filter these statuses. Can be a single item or list.

NOTE: currentUser is also connected to the active account and can be used for all user related tasks.

IMPORTANT: use the display name in assignee and reporter, as account names will be unknown. You only know your own account number on Cloud services.

Similar to the filter key, you can define a newissue key to set repo-based. Default configuration for the new-issue fields, for example in:

{
  "vira": {
    "server": "https://n0v1c3.atlassian.net",
    "filter": {
      "project": ["VIRA"],
      "assignee": ["Travis Gall"],
      "priority": ["High", "Highest"],
      "fixVersion": ["0.4.13"]
    },
    "newissue": {
      "issuetype": "Task"
    }
  },
  "OtherProject": {
    "server": "https://jira.career.com",
    "filter": {
      "project": ["VIM", "TEST"],
      "assignee": ["Mike Boiko"],
      "priority": ["low", "lowest"],
    "newissue": {
      "assignee": "Travis Gall"
    }
  }
}
vira:
  server: https://n0v1c3.atlassian.net
  filter:
    project: [VIRA]
    assignee: [Travis Gall]
    priority: [High, Hihest]
    fixVersion: [0.4.13]
  newissue:
    issuetype: [Task]
OtherProject:
  server: https://jira.career.com
  filter:
    assignee: [Travis Gall]
    status: [In-Progress]
  newissue:
    assignee: Travis Gall

The acceptable values for filter keys are:

  • assignee - Define assignee.
  • component - Define component. Note - these are project specific.
  • epic - Define epic. Current project filters apply to list.
  • fixVersion - Define fixVersion. Note - these are project specific.
  • issuetype - Define issue type. The default is Bug.
  • priority - Define priority.
  • status - Define status. Vira will transition issue to this status.

Optionally, it is possible to define a custom sort order for the issues displayed in vira_menu. This sort order is project based - meaning you can define different sort orders for your projects.

Define the sort order using the issuesort key as follows:

{
  "vira": {
    "server": "https:n0v1c3.atlasian.net",
    "issuesort": "status DESC"
  },
  "OtherProject": {
    "server": "https://jira.career.com",
    "filter": {
      "assignee": ["Travis Gall", "Mike Boiko"],
      "priority": ["Low", "Lowest"],
    "issuesort": {
      "status": "ASC",
      "updated": "DESC"
    }
  }
}
vira:
  server: https://n0v1c3.atlassian.net
  issuesort: status
OtherProject:
  server: https://jira.career.com
  filter:
    assignee: Mike Boiko
    status: In-Progress
  issuesort:
    - status ASC
    - updated DESC

The value of issuesort can either be a string or a list. If no issuesort key is provided, the default sort order used is updated DESC.

NOTE: that it is possible to define a custom status order in Jira-web in Administration > Issues > Statuses. This can be used to achieve a similar functionality to Kanban boards.

Templates can be defined in the same way that projects are defined. These templates can be referenced for multiple projects, by using the template key. Any name can be used for a template, but it is recommended to use the pythonic syntax of __name__ in order to make a distinction from a project. Refer to the yaml example below, note that the priority in repo2 will override the __maintemplate__ priority:

{
  "__WORK__": {
    "server": "https:n0v1c3.atlasian.net",
    "filter": {
      "project": "VIRA",
      "assignee": ["Travis Gall"],
      "priority": ["High", "Highest"]
    }
  },
  "repo1": {
    "template": "__WORK__"
  },
  "repo2": {
    "template": "__WORK__",
    "filter": {
      "priority": "High"
    }
  }
}
__WORK__:
  server: https://n0v1c3.atlassian.net
  filter:
    project: VIRA
    assignee: Travis Gall
    priority: [High, Highest]
repo1:
  template: __maintemplate__
repo2:
  template: __maintemplate__
  filter:
    priority: High

If you would like to have a catch-all project configuration template, define a __default__ key in your vira_projects.json/yaml file. Refer to the yaml example below:

{
  "__default__": {
    "server": "https:n0v1c3.atlasian.net",
    "filter": {
      "assignee": ["Travis Gall"],
      "priority": ["High", "Highest"]
    },
    "newissue": {
      "issuetype": "Story"
    }
  }
}
__default__:
  server: https://n0v1c3.atlassian.net
  filter:
    assignee: Mike Boiko
  newissue:
    issuetype: Task

By default, the open or xdg-open command will be used by :ViraBrowse to open the current issue in the default browser. If either command is missing or you wish to override the default browser, you may set the g:vira_browser variable or provide the BROWSER environment variable.

Example setting custom default browser using g:vira_browser:

let g:vira_browser = 'chromium'

A list of the important commands, functions and global variables for menus and reports to be used to help configure Vira to work for you. There is also a good example of .vimrc mapping and report layout.

  • ViraBrowse - View Jira issue in web-browser.
  • ViraComment - Insert a comment for active issue.
  • ViraEditComment - Update the comment relative to position in report.
  • ViraEditDescription - Update the description of the current issue.
  • ViraEditSummary - Update the summary of the current issue.
  • ViraFilterAssignees - Add and remove assignees to filter.
  • ViraFilterComponents - Add and remove components to filter.
  • ViraFilterEdit - Display/Edit all active filter in a vim buffer.
  • ViraFilterEpics - Add and remove epics to current filter.
  • ViraFilterPriorities - Add and remove priorities to filter.
  • ViraFilterProjects - Add and remove projects to filter.
  • ViraFilterReset - Reset and remove filter to default.
  • ViraFilterStatuses - Add and remove statuses to filter.
  • ViraFilterText - Add and remove flexible issue text to filter.
  • ViraFilterTypes - Add and remove issuetypes to filter.
  • ViraFilterVersions - Add and remove versions to filter.
  • ViraIssue - Create a new issue. The required fields are indicated by *.
  • ViraIssues - Get and Set the active issue.
  • ViraLoadProject - Load project from vira_projects.json/yaml. The default is based on cwd. Optionally pass repo name in argument. Ex. :ViraLoadProject My Repo
  • ViraReport - Get report for active issue.
  • ViraServers - Get and Set active Jira server.
  • ViraSetAssignee - Select user to assign the current issue.
  • ViraSetComponent - Select component to append the current issue.
  • ViraSetEpic - Select epic of the current issue.
  • ViraSetPriority - Select priority of the current issue.
  • ViraSetStatus - Select the status of the current issue.
  • ViraSetType - Select the issuetype of the current issue.
  • ViraSetVersion - Select the version to append the current issue.
  • ViraTodo - Make a TODO note for current issue.
  • ViraTodos- Get a list of the remaining TODOs.

Menus (keys pre-mapped only to menu windows):

  • D - Unselect and Apply "Delete" all lines within menu.
  • H - Toggle special hidden menu items.
  • s - Select current line within menu.
  • S - Select all lines within menu.
  • u - Unselect current line within menu.
  • U - Unselect all lines within menu.
  • q - Quit the current menu with no apply.
  • <cr> - Apply selections along with current line.

NOTE: It is possible to select multiple items from all menus, if nothing is selected prior to the item will be selected from the current column.

Reports (keys pre-mapped only to report windows):

  • <cr> - Edit current field cursor is within.
  • s - Select issue or website under cursor.

NOTE: currentUser is also connected to the active account and can be used for all user related tasks. This can make it easier to create scripts with different accounts.

This is an example of a typical Jira issue report (except the report looks colorized and fancy in vim):

+---------------------------------+
|            VIRA-134             |
+--------------+------------------+
|      Created | 2020-04-06 12:06 |
|      Updated | 2020-06-23 01:43 |
|         Type | Task             |
|       Status | In Progress      |
| Story Points | None             |
|     Priority | Highest          |
|    Epic Link | VIRA-32          |
|    Component | Software         |
|      Version | 1.0.0            |
|     Assignee | Mike Boiko       |
|     Reporter | Mike Boiko       |
+--------------+------------------+
+--------------+
|    Summary   |
+--------------+
Edit any Jira field

+--------------+
|  Description |
+--------------+
A user should be able to edit any field that
is shown on a vira issue report.

I would suggest to use a default key of <cr>
for editing a report field and allow the user
to customize this mapping.

The edit command would bring up the vira_prompt
buffer, in the same manner as creating new
issues/comments.

+--------------+
|   Comments   |
+--------------+
...

Most issue fields can be edited by pressing <cr>.

For the text entry fields (Summary, Description, Comments), if the text entry is left blank, the write action will be aborted.

" Basics
nnoremap <silent> <leader>vI :ViraIssue<cr>
nnoremap <silent> <leader>vS :ViraServers<cr>
nnoremap <silent> <leader>vT :ViraTodo<cr>
nnoremap <silent> <leader>vb :ViraBrowse<cr>
nnoremap <silent> <leader>vc :ViraComment<cr>
nnoremap <silent> <leader>vi :ViraIssues<cr>
nnoremap <silent> <leader>vr :ViraReport<cr>
nnoremap <silent> <leader>vt :ViraTodos<cr>

" Sets
nnoremap <silent> <leader>vsa :ViraSetAssignee<cr>
nnoremap <silent> <leader>vsp :ViraSetPriority<cr>
nnoremap <silent> <leader>vss :ViraSetStatus<cr>
nnoremap <silent> <leader>vse :ViraSetEpic<cr>
nnoremap <silent> <leader>vsv :ViraSetVersion<cr>

" Edits
nnoremap <silent> <leader>ved :ViraEditDescription<cr>
nnoremap <silent> <leader>ves :ViraEditSummary<cr>

" Filter search
nnoremap <silent> <leader>vfR :ViraFilterReset<cr>

nnoremap <silent> <leader>v/ :ViraFilterText<cr>

nnoremap <silent> <leader>vfP :ViraFilterPriorities<cr>
nnoremap <silent> <leader>vfa :ViraFilterAssignees<cr>
nnoremap <silent> <leader>vfe :ViraFilterEpics<cr>
nnoremap <silent> <leader>vfp :ViraFilterProjects<cr>
nnoremap <silent> <leader>vfr :ViraFilterReporter<cr>
nnoremap <silent> <leader>vfs :ViraFilterStatuses<cr>
nnoremap <silent> <leader>vft :ViraFilterTypes<cr>

" Projects/Boards
nnoremap <silent> <leader>vbm :ViraLoadProject __default__<cr>

" Functions
function! Enter_ViraActiveIssue()
    let g:vira_active_issue = input("Enter issue.key: ")
    ViraReport
endfunction
nnoremap <silent> <leader>vei :call Enter_ViraActiveIssue()<cr>

" Status
statusline+=%{ViraStatusline()}
  • ViraGetActiveIssue() - Get the currently selected active issue.
  • ViraStatusline() - Quick statusline drop-in.
  • g:vira_active_issue - Set and get the active issue.
  • g:vira_async_timer - Normal time between vim async updates. (10000ms)
  • g:vira_async_timer_init - Faster initial time between async updates. (2000ms)
    • Lower the number to increase the rate of the initial versions listing.
    • WARNING: A lower number makes it "jumpy" but gets it over and onto g:vira_async_timer much faster.
  • g:vira_highlight - Text used when there is no issue.
  • g:vira_issue_limit - Set the maximum issue limit for query (default 50).
  • g:vira_menu_height - Set the height of the menu (default 7).
    • Height - g:vira_menu_height > 0 (may also equal 'J')
    • Tab - g:vira_menu_height = 0 (may also equal 'T')
  • g:vira_null_issue - Text used when there is no issue.
  • g:vira_report_width - Set the width of the report (default 0).
    • Left - g:vira_report_width > 0 (may also equal 'L')
    • Right - g:vira_report_width < 0 (may also equal 'R')
    • Tab - g:vira_report_width = 0 (may also equal 'T')
  • g:vira_version_hide - Toggle the display of complete versions.

We currently support Private Jira servers version 8 and up. We have not seen issues with the lower versions we had access to but we no longer do have a test platform.

The Cloud feature now available from Atlassian is currently also available. The API token key referenced above is required to use as your password.

Plugins may be used and supported. This list will build as required from other requests. Support will be focused on providing functions that provide information along with the related Jira commands for easy usage.

Below are a few common examples. Please recommend any other tools that could use some good features to make your development easier.

A simple example is below but recommended that it can be expanded on for your personal needs.

function! s:Vira_GitActiveIssue()
    let g:vira_active_issue = execute("Git branch --show-current > echo")
    ViraReport
endfunction

function! s:Vira_GitCommit()
  " Commit current `git` status
  silent! execute 'Git commit'

  " Call prompt
  call s:Vira_GitPrompt()
endfunction

function! s:Vira_GitPrompt()
  if g:vira_active_issue != 'None'
    " Write current version
    redir @x>
      silent! echo g:vira_active_issue . ': '
    redir END
    put x

    " Delete blank lines
    goto 1
    join!
    join!
  endif
endfunction

nnoremap <silent> <leader>vgc :call Vira_GitCommit()<cr>
nnoremap <silent> <leader>vgi :call Vira_GitActiveIssue()<cr>

Most of us that have made it this far to use vim all day while using git to merge our work together and Jira to track what we have done and needs to be done coming up, GV is very helpful in nearly needing to leave our vim world. vira has added in some syntax so that we will be able to see some useful copy/paste in our {code} sections.

NOTE: Wrap with code and place {code:none}```GV``` as the header.

{code:none}
```GV```
*   2021-03-06 8a97263 VIRA 0.4.7 - temporary version filter bypass (Travis Gall)
|\
| * 2021-03-06 fd073bd VIRA-253: version update (Travis Gall)
| * 2021-03-06 0180e52 VIRA-253: temportaty `_async()` removed (Travis Gall)
|/
*   2021-03-05 e5ce063 VIRA 0.4.6 - `issuetype` menu typo (Travis Gall)
|\
| *   2021-03-05 daf502f VIRA-18: `issuetype` type patch (Travis Gall)
| |\
| | * 2021-03-05 43e33c0 VIRA-18: prepare version increase (Travis Gall)
| | * 2021-03-05 360cd97 VIRA-253: `issuetype` typo fix (Travis Gall)
| |/
| * 2021-03-04 85093b1 VIRA-245: Fixed summary/description line edit bug (Mike Boiko)
|/
*   2021-03-03 f9996e3 VIRA 0.4.5 - `report` reload bug patch (Travis Gall)
{code}

I have seen that users still make their way to issue #43 once in a while. You may need to update python3_host_prog that is stuck in version 0.4.1.

FROM: @uberbrodt

Ok, so I finally got back around to looking at this. I tested with removing the python3_host_prog and it worked after I upgraded to pynvim 0.4.2 (previous was at 0.4.1).

Setting the python3_host_prog again and then manually install the Jira package works as well. My suspicion is that the automatic install via vim-plug was not working with virtualenv for some reason, so might be something to note in the README. Thanks to everyone for debugging and offering advice!

A big thank you to @mikeboiko for his active development on vira.

With growing support from: @chinwobble, @jamesl33, @kkonopko, @mattalexander-pantheon, and @maricn

All user feedback and contributions are welcome!

vira's People

Contributors

chinwobble avatar dependabot[bot] avatar jamesl33 avatar mattalexander-pantheon avatar mikeboiko avatar n0v1c3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vira's Issues

readme: overhaul

"Borrow" all the best templates for a readme that can be found and update all the sections properly.

  • Requirements
  • Table of Contents
  • Screenshots
  • Description

Feature request - Add function or command for setting the selected issue

There's a function for getting the selected issue, but not one for setting it. This would be helpful for writing commands and scripts that automatically select the issue based on other criteria. For example, my current team has the policy of naming our git feature branches the Jira issue number. It would be very useful to set the issue based on my git branch name every time I open my editor.

Works in neovim but not in vim.

This plugin works perfectly in neovim, but complained the following errors in vim:

Error detected while processing function vira#_menu:
line   39:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'Vira' is not defined

Vim has +python3 enabled.

VIRA-83: GitHub and Jira usage

As a user I would like the ability to use this Vim plugin with either Jira or from GitHub to help make it unrequited to even change the software I am using to track my work on different servers. All function Vim level should look the same (unless simply something is only available from one of them) then the functions can do the server type confirmation and changes as required.

  • Add any one Jira issue to GitHub manually
    • Once added will be controlled by GitHub
  • Add all GitHub issues to Jira and keep then up to date

vim: statusline

The statusline is going to be a very important feature requirement to make this a usable plug-in. Some extra planning should go into the design to ensure that the user always knows which Project, issue they are currently looking at.

Also we need to ensure that it will be fully compatible with tools like airline to help show off how great it can be.

Use pipenv for dependancy management

Let's decide on which version of python we're using first of all. How about we stick with the latest stable release of 3.7?
After this, I can create a Pipfile to specify all required packages.

VIRA-248: EPIC issues cannot be created with vira

As a developer I have broken the ability to not create, along with never having never having the good was for code testing As this is now moving up in usefulness for more than myself priority is moving up with it.

Video Support from Outside!

Show us a great recording that we can post on our other account. I am truly a back end programmer and have just got this far in the front end as needed.

If you are curious about the other account that is simply so our active vim users do not have any activity with the videos. No point in downloading viravid when just using vira...

@mikeboiko did throw us a small script to get started but my end goal as a back end programmer will to be able to run it anywhere with a few vars and we should have a new video or comment...

vim: clean-up the current variables

There are old variables left over that should not be used any more. I was using global paths to make it easy at first and there are better proper ways to do this for a proper plugin set-up.

Also some variables that are global could be changed to plugin (g -> s).

There should be as few global variables, functions and key mappings as possible to ensure less problems with other Vim configurations.

VIRA-10: issue time tracking

As a user I would like to be able to track the time I spend coding as required on some projects. I would however, like this tracking to be as close to accurate as possible to my actual work and not my walking away and leaving vim running.

Config not being read

I am running the dev branch of the plugin.
I have created the files and populated them with the required credentials.

Yet, running :ViraServers fails. Any idea why?

image

cygwin: no dropdown

There is currently no dropdown menu being displayed. The command :anoremenu &Vira shows that it is being properly created just not displayed.

Basic authentication with passwords is deprecated

It has been reported that some have been receiving the below error when attempting to login to an Atlassian Cloud server.

Basic authentication with passwords is deprecated

Currently the common solution is to go to https://id.atlassian.com/manage-profile/security/api-tokens and generate a key that can then be used directly as the password. This was modified by Atlassian for security.

This issue will remain open until an automated method or fall to readme update is complete.

Cannot select with ViraServers

Hey this looks like a really cool plugin.

I've read the entire readme.md but I cannot find how to browse jira issues.

I've created the two json files and tested my username and token are working properly.

I've created the following files according to
#41

~/.config/vira/vira_project.json
~/.config/vira/vira_servers.json

I have installed the python dependencies and I have python3 and python in my enviornment paht.
I'm using ubuntu 20.04 in WSL

Here's what I have tried:

  1. open vim
  2. :ViraServers
  3. hover over https://bob.atlassian.net/ and press ` (backtick)
  4. I get the error E20 mark not set
  5. I try press enter but vim hangs for a long time and I end up closing the terminal after several minutes

Developer Issues Saved on Personal JIRA

I am currently storing the development related issues on a private JIRA server!

You are free to post your personal issues here (hopefully the ones related to the Vira software but I will help where I can) and they will be seen. I will keep users up to date with important tasks as required.

`ViraSetAssignee` not working

An error has been seen and reported regarding the ViraSetAssignee command.

My current VIRA-177 branch has patched the private API 2 servers and I am currently looking at the Cloud public API 3 servers.

Filter was also not working however it appears to be working for both Privat API2 and Cloud API3 now with my first attempt.

Enable integration of CLI password managers

I like the current prompting feature of g:vira_pass
However, I use the lastpass password manager CLI for all my password needs. It would be good if we had the option of running a script for the username/password instead of setting static strings.

For example, the vim config for me could like something like this:

let g:vira_user_script = "lpass show --username boiko.online"
let g:vira_pass_script = "lpass show --password boiko.online"

VIRA-253: ViraFilterVersions `H`idden mapping broken

As a developer I have broken the H key mapping while changing the OoO for #45 the if statment used to determine when they should be displayed will need to be adjusted. At least that is where it will begin.

if fixed != total or total == 0 or not int(self.versions_hide) == 1: line 855 in python/Vira/vira_api.py

Epic Number is not working

Hii, first of all thanks for this wonderful plugin

I have a question, i dont know why Epic Links are displaying None all the time, any ideas?

I wanted to know the identifier of the epic, in this case it would be NM-4233

VIRA-282: Make the vira_report and vira_menu readonly

The vira_report and vira_menu are readonly.

Based on my usage, you have created vira_prompt so that you can edit each section of a jira individually.

Like in fugitive in the git status screen you aren't allowed to edit text.

make open ViraReport configurable

I have very limited screen space.

When I open a VIRA report I would ideally like to open in full width rather than split.

I see the in the autoload file you hard code it to open in botright.

Would you be open to making that customisable?

vira: add functions

Start a list of useful functions that vira should have.

  • Create issue
  • Search all issues
  • Assign issue
  • Active project
  • Multiple servers

VIRA-253: slow performance

As a user, I don't want an open VIRA report to be slow and I don't want each report to take a long time to load.

I suspect something is wrong with the async code.

I'm going to put a few examples of how to profile the python and vim code.

  • Override timeout for async updates
  • Error after message and issue create (VIRA-247) [d846711]
    • c03487c was the last good one?!?
      • leads to menu layout again...
    • OoO demands tabs win...
    • I got "lucky" and had seen a flash that a second .vira_prompt is open on the fly and we need strings and numbers to work properly
    • One more test
    • I will need to go through the list again. This appears to fix the menus but I lost the fix for it.
  • Fold lost (VIRA-221) [31c6fec]
  • Refresh report goes blank (VIRA-213) [627b6c4]

profile python code

function! vira#_print_report(list) " {{{2
  " Write report output into buffer
  python3 << EOF
import vim
import cProfile
with cProfile.Profile() as pr:
  report = Vira.api.get_report().splitlines()
  vim.current.buffer.append(report)
pr.dump_stats('/tmp/vira_print_report.dmp')

EOF
endfunction

Then i use snakeviz to check the results.
image

vira: create an issue buffer

This buffer will be used to open the active issue and display the current status, description and comments. It should try to represent how JIRA is currently laying out the display for the website.

vira: add timing

Should not be impossible. Whenever you activate an issue end the last timer and submit to JIRA, start a new timer for the NEW issue, start program with the g:vira_null_issue issue selected and no timer running, stop any active issue timers and submit and stop all timers if g:vira_null_issue is selected again.

Rinse and repeat.

Feature request - functions or commands for setting default filters

This tool would be a lot more useful if I could set up default filters, rather than have to manually select them each time I enter my editor. For example, my company hosts about 100 projects in a shared Jira server, and only one or two of those are all I'll ever care about. Right now, I have to select these each time I open my editor, but it would be nice to write this into my .vimrc file instead.

VIRA-230: story points

As a user I would like to be able to adjust the story points on any issues I have permission to.

How to create custom filters?

I know how to set the default filter, but there are times when I want to filter issues on other conditions, for now, I have to reset the current filter and set them one by one, it's ineffective and stupid.

Is it possible to preset some groups of filters and switch to one of them with a single hotkey?

Use linter/auto-formatter for python files

I propose to use flake8 as a linter
I propose using yapf as an auto-formatter

I have good settings configured for these 2 and can add them to the repository.

flake8/yapf should ideally be used within vim using the ALE (asynchronous linting package)

VIRA-161: Setting task sprint?

I search the doc and repo and found no way of setting the Sprint of the task.

Is it possible or is it not yet implemented?

Thank you!

:ViraFilterProjects -> IndexOutOfBounds

branch dev:

projectDesc = self.jira.createmeta(
projectKeys=project, expand='projects')['projects'][0]

branch VIRA-247:

projectDesc = self.jira.createmeta(
projectKeys=project, expand='projects')['projects'][0]

In response from:

            projectDesc = self.jira.createmeta(
                projectKeys=project, expand='projects')

I get several:

{"expand": "projects", "projects": []}

It seems JIRA API returns empty "projects" response for archived projects. Python plugin jira uses issues/createmeta which probably suffers from the same limitation mentioned here - archived projects have empty permission scheme so our user doesn't have the privilege to query it. (Maybe.)

Anyways, trying to access [0] will cause IndexOutOfBounds exception.

Nothing happens on `:ViraServers`

Hello! πŸ‘‹

I have python3 package jira and I've tried putting my credentials to ~/.netrc and using jira from python console and it works well, I can connect and browse projects and everything.

However, using vira vim plugin nothing happens. I have created ~/.config/vira/vira_servers.json with content:

{
  "https://company.atlassian.net": {
    "username": "[email protected]",
    "password": "my freshly generated api key"
  }
}

When I issue :ViraServers command, a new buffer opens in a bottom split and it has a single empty line. When i press <cr> nothing happens - the buffer closes and that's it.

The same credentials (diff syntax) I use in ~/.netrc for jira python package which works fine.

I'm on arch

Linux work-x1c-arch 5.10.14-arch1-1 #1 SMP PREEMPT Sun, 07 Feb 2021 22:42:17 +0000 x86_64 GNU/Linux

and neovim:

NVIM v0.4.4                                                                                                                                                                                                                                                     
Build type: Release                                                                                                                                                                                                                                             
LuaJIT 2.0.5                                                                                                                                                                                                                                                    
Compilation: /usr/bin/cc -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconver
sion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/b
uild/neovim/src/neovim-0.4.4/src -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include                                                                                                                                       
Compiled by builduser                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                                
Features: +acl +iconv +tui                                                                                                                                                                                                                                      
See ":help feature-compile"                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                
   system vimrc file: "$VIM/sysinit.vim"                                                                                                                                                                                                                        
  fall-back for $VIM: "/usr/share/nvim"                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                
Run :checkhealth for more info

I've tried using normal and dev version of the vira plugin - same behavior.

vim: create a menu

I have looked at a lot of the plugins but I am pretty sure we will need a full custom menu created from a temp buffer to pull of what I am dreaming.

Unite is pretty easy plugin to work with but I really want to "re-create" what is in the browser. I will break it down further what I think can be done but I have a feeling it is going to be a lot of Vim script.

I can almost create a "useful" popdown menu while in normal or insert mode using the "complete" and outdated "popup" vim commands and they seem pretty good for commenting and time tracking (select an issue to comment/start tracking)

NameError: name 'Vira' is not defined

Followed README, but getting this when running :ViraServers:

Error detected while processing function vira#_menu[42]..provider#python3#Call:                                                                                                                                                                                                                                                                             
line   18:                                                                                                                                                                                                                                                                                                                                                  
Error invoking 'python_execute' on channel 4 (python3-script-host):                                                                                                                                                                                                                                                                                         
Traceback (most recent call last):                                                                                                                                                                                                                                                                                                                          
  File "<string>", line 1, in <module>                                                                                                                                                                                                                                                                                                                      
NameError: name 'Vira' is not defined        

output of :version

:version                                                                                                                                                                                                                                                                                                                                                    NVIM v0.4.4                                                                                                                                                                                                                                                                                                                                                 Build type: RelWithDebInfo                                                                                                                                                                                                                                                                                                                                  
LuaJIT 2.1.0-beta3                                                                                                                                                                                                                                                                                                                                          
Compilation: /usr/bin/cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fc
f-protection -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=1 -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE
 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/builddir/build/BUILD/neovim-0.4.4/build/config -I/builddir/build/BUILD/neovim-0.4.4/src -I/usr/include -I/usr/include/lua-5.1 -I/builddir/build/BUILD/neovim-0.4.4/build/src/nvim/auto -I/builddir/build/BUILD/neovim-0.4.4/build/include                                                          
Compiled by mockbuild                                                                                                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                                                                                                            
Features: +acl +iconv +tui                                                                                                                                                                                                                                                                                                                                  
See ":help feature-compile"                                                                                                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                                                                                            
   system vimrc file: "$VIM/sysinit.vim"                                                                                                                                                                                                                                                                                                                    
  fall-back for $VIM: "/usr/share/nvim"                                                                                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                                                            
Run :checkhealth for more info                                                                                                                                                                                                                                                                                                                              
Press ENTER or type command to continue              

python3 output from healthcheck

## Python 3 provider (optional)
  - INFO: pyenv: Path: /home/cbrodt/lib/pyenv/libexec/pyenv
  - INFO: pyenv: Root: /home/cbrodt/lib/pyenv
  - INFO: Using: g:python3_host_prog = "/home/cbrodt/lib/pyenv/versions/python_neovim3/bin/python"
  - INFO: Executable: /home/cbrodt/lib/pyenv/versions/python_neovim3/bin/python
  - INFO: Python version: 3.8.3
  - INFO: pynvim version: 0.4.1
  - OK: Latest pynvim is installed.

Invalid expression type()

I have just installed vira and configured some servers in ~/.config/vira/vira_servers.json but when I run any vira command, I have an issue:

Erreur dΓ©tectΓ©e en traitant function vira#_menu[63]..vira#_print_menu :
ligne    3 :
E15: Expression invalide : >type() == type([]))
E15: Expression invalide : (a:list->type() == type([]))

VIRA-250: menu reports `modifiable` toggle

 β”Œ---------------------------------┐                                                                                                   
  β”‚            VIRA-250             β”‚                                                                                                   
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€                                                                                                   
  β”‚      Created β”‚ 2021-02-24 02:15 β”‚                                                                                                   
  β”‚      Updated β”‚ 2021-02-24 02:15 β”‚                                                                                                   
  β”‚         Type β”‚ Task             β”‚                                                                                                   
  β”‚       Status β”‚ To Do            β”‚                                                                                                   
  β”‚ Story Points β”‚ None             β”‚                                                                                                   
  β”‚     Priority β”‚ Medium           β”‚                                                                                                   
  β”‚    Epic Link β”‚ None             β”‚                                                                                                   
  β”‚ Component(s) β”‚                  β”‚                                                                                                   
  β”‚   Version(s) β”‚                  β”‚                                                                                                   
  β”‚     Assignee β”‚ Unassigned       β”‚                                                                                                   
  β”‚     Reporter β”‚ Travis Gall      β”‚                                                                                                   
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                                                                                   
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                                                                                                      
  β”‚    Summary   β”‚                                                                                                                      
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                                                                                                      
  menu reports `modifiable` toggle                                                                                                      
                                                                                                                                        
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                                                                                                      
  β”‚  Description β”‚                                                                                                                      
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                                                                                                      
  As a user all of our menus, reports and even this prompt should only be modifiable when approved by VIRA standards.                   
                                                                                                                                        
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                                                                                                      
  β”‚   Comments   β”‚                                                                                                                      
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ 

Default filters assigned in vira_projects are not applied

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.

VIRA-213: Autoload of Vira Server/Project

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.