Coder Social home page Coder Social logo

coddingtonbear / jirafs Goto Github PK

View Code? Open in Web Editor NEW
133.0 6.0 18.0 612 KB

Edit your Jira tickets using locally-stored text files in a git/hg-inspired way

License: MIT License

Python 97.72% Gherkin 0.46% HTML 1.82%
jira jira-client python3 python git

jirafs's Introduction

Jirafs

https://travis-ci.org/coddingtonbear/jirafs.svg?branch=master https://badge.fury.io/py/jirafs.png

Pronounced like 'giraffes', but totally unrelated to wildlife, this library lets you stay out of Jira as much as possible by letting you edit your Jira issues as a collection of text files using an interface inspired by git and hg.

http://coddingtonbear-public.s3.amazonaws.com/github/jirafs/readme_demo_2.1_v7.gif

Read more details in the docs.

Plugins and Macros Too

Jirafs provides a Plugin API allowing you to simplify your workflow in Jira; several plugins already exist, including the following tools:

  • For including programmatically-generated images in your Jira issues without ever leaving your editor:
    • jirafs-graphviz: Embed Graphviz (e.g. dot or neato) graphs using Graphviz's ubiquitous graph description language.
    • jirafs-matplotlib: Embed graphs generated with the common Python charting library Matplotlib by writing simple python scripts.
    • jirafs-plantuml: Embed UML (e.g. timing, sequence, or activity) diagrams generated via PlantUML's easy-to-use text format.
    • jirafs-mermaid: Embed beautiful diagrams (e.g. pie, gantt, or class) using Mermaid's markdown-ish diagram description language.
  • For making tables more easily:

Requirements

  • git >= 1.8
  • python3 >= 3.6

jirafs's People

Contributors

coddingtonbear avatar commonquail avatar durka avatar mcepl avatar mriehl avatar pts-kevinqiu avatar shaunduncan 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jirafs's Issues

Option to never ask to save password

If I don't want to save my password, the overhead of being asked every time I interact with JIRA gets irritating. Please allow some way of disabling this question.

Relevant line:

save = get_user_input("Save JIRA Password (Y/N)?", boolean=True)

Is it possible to clone all issues assigned to me (and/or that I'm watching)?

The title says it all. I haven't been able to find anything in the documentation. I just want to be able to do something like jirafs clone --mine or something, and then it pulls down all issues assigned to me.

It might also be nice to have something like jirafs --prune that would remove directories from issues I'm no longer assigned to.

Separate concepts of "ignore" from "local only".

Currently, the only way to prevent a document from being uploaded is to make sure that its path matches a glob stored in a file named .jirafs_ignore. When files match said globs, they will not be uploaded, but will continue to be tracked by the underlying git repository.

This becomes a little inconvenient (or, at best, strange) when things like, say, virtual environments, exist per-project, or runnable python files (which write, at runtime, a corresponding .pyc file) slightly pollute a ticket folder. In those cases, it might be best to not track the file at all -- not even in the underlying git repository.

This issue will change things such that:

  1. .jirafs_ignore will list globs of files that should not be tracked at all (rather than files that should only be tracked locally).
  2. A new file, .jirafs_local will list globs of files that should only be tracked locally (and not uploaded to JIRA).

Add 'assign' command

Allowing one to assign an issue to themselves. Maybe consider replicating assignments between tasks and subtasks.

Cloning issue without using full issue URL may be constructing the incorrect URL

I encountered a problem earlier this morning when attempting to clone an issue without specifying the full URL; I haven't yet had a chance to investigate it, but:

  1. I was asked to re-save authentication credentials, but those credentials are already saved for the relevant domain.
  2. I received an error from Jira indicating that the relevant project did not exist immediately after providing credentials.

My guess is that we're possibly misgenerating the URL.

Upload local assets if they've changed

Currently, JiraFS will only download/upload assets that are unrecognized, but it would be nice if it could keep track of the most recent file version downloaded from jira, and utilize the local per-issue git repository to identify when local files were changed.

Cloning an issue using an inappropriate URL raises exception

(jirafs)acoddington@DATLADAMC-3 [08:00:00] [~/Desktop/Tickets]
-> % jirafs clone https://jira.cmgdigital.com/CMSIMPG-472
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/Users/acoddington/.virtualenvs/jirafs/bin/jirafs in <module>()
      7 if __name__ == '__main__':
      8     sys.exit(
----> 9         load_entry_point('jirafs==0.9.5', 'console_scripts', 'jirafs')()
     10     )

/Users/acoddington/.virtualenvs/jirafs/lib/python3.3/site-packages/jirafs/cmdline.py in main()
    509     jira = utils.lazy_get_jira()
    510     try:
--> 511         fn(extra, jira=jira, path=os.getcwd())
    512     except GitCommandError as e:
    513         print(

/Users/acoddington/.virtualenvs/jirafs/lib/python3.3/site-packages/jirafs/cmdline.py in clone(args, jira, path, **kwargs)
    370         path=path,
    371         ticket_url=ticket_url,
--> 372         jira=jira,
    373     )
    374

/Users/acoddington/.virtualenvs/jirafs/lib/python3.3/site-packages/jirafs/ticketfolder.py in clone(cls, ticket_url, jira, path)
    410     def clone(cls, ticket_url, jira, path=None):
    411         if not path:
--> 412             path = re.match('.*\/browse\/(\w+-\d+)\/?', ticket_url).group(1)
    413         path = os.path.realpath(path)
    414         os.mkdir(path)

AttributeError: 'NoneType' object has no attribute 'group'

Does not gracefully handle addition or removal of Jira issue fields

When comparing an earlier and later version of an issue and fields have been added or removed from the instance, a KeyError will be raised.

Traceback (most recent call last):
  File "/home/acoddington/.local/bin/jirafs", line 11, in <module>
    load_entry_point('jirafs', 'console_scripts', 'jirafs')()
  File "/home/acoddington/Documents/Projects/jirafs/jirafs/cmdline.py", line 133, in main
    extra, jira=jira, path=args.folder, command_name=command_name
  File "/home/acoddington/Documents/Projects/jirafs/jirafs/plugin.py", line 317, in execute_command
    result = cls.get_command_result(cmd.handle(**kwargs))
  File "/home/acoddington/Documents/Projects/jirafs/jirafs/plugin.py", line 343, in handle
    self.cmd(*args, **kwargs)
  File "/home/acoddington/Documents/Projects/jirafs/jirafs/plugin.py", line 347, in cmd
    self.main(*args, **kwargs)
  File "/home/acoddington/Documents/Projects/jirafs/jirafs/commands/pull.py", line 15, in main
    merge_result = run_command_method_with_kwargs("merge", folder=folder)
  File "/home/acoddington/Documents/Projects/jirafs/jirafs/utils.py", line 80, in run_command_method_with_kwargs
    return getattr(installed_commands[command](), method)(**kwargs)
  File "/home/acoddington/Documents/Projects/jirafs/jirafs/commands/merge.py", line 38, in main
    for field, values in (jira_fields - master_fields).items():
  File "/home/acoddington/Documents/Projects/jirafs/jirafs/jirafieldmanager.py", line 28, in __sub__
    if (self.get_transformed(k) or v) and self.get_transformed(k) != v:
  File "/home/acoddington/Documents/Projects/jirafs/jirafs/jirafieldmanager.py", line 56, in get_transformed
    return self[field_name]
KeyError: 'customfield_10058'

Another `UnicodeEncodeError` when pulling!

[INFO GAG-379] Updated 'jira' to 30eef6c56cbbd1822d391cad7a73beefe9b30a33
Traceback (most recent call last):
  File "/usr/local/bin/jirafs", line 9, in <module>
    load_entry_point('jirafs==1.10.5', 'console_scripts', 'jirafs')()
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/cmdline.py", line 79, in main
    extra, jira=jira, path=os.getcwd(), command_name=command_name
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/plugin.py", line 171, in execute_command
    result = cmd.handle(**kwargs)
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/commands/pull.py", line 13, in handle
    return self.pull(folder)
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/commands/pull.py", line 17, in pull
    merge_result = run_command_method_with_kwargs('merge', folder=folder)
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/utils.py", line 90, in run_command_method_with_kwargs
    return getattr(installed_commands[command](), method)(**kwargs)
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/commands/merge.py", line 48, in merge
    to=self.truncate_field_value(values[1])
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/ticketfolder.py", line 928, in log
    message % args
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 78: ordinal not in range(128)  

jirafs crashes when Jira access is not available

While trying to setup jirafs, I noticed that it crashes when the API is not accessible.

% jirafs clone https://my.jira.domain/browse/COM-551
JIRA Password (https://my.jira.domain):
Save JIRA Password (Y/N)? n
WARNING:root:('Connection aborted.', TimeoutError(110, 'Connection timed out')) while doing GET https://my.jira.domain/rest/api/2/serverInfo [{'params': No
ne, 'headers': {'Accept': '*/*', 'Cache-Control': 'no-cache', 'X-Atlassian-Token': 'no-check', 'Connection': 'keep-alive', 'User-Agent': 'python-requests/2.7.0 CPython/3.
4.3 Linux/4.0.5-1-ARCH', 'Content-Type': 'application/json', 'Accept-Encoding': 'gzip, deflate'}}]
WARNING:root:Got ConnectionError [('Connection aborted.', TimeoutError(110, 'Connection timed out'))] errno:None on GET https://my.jira.domain/rest/api/2/s
erverInfo
{'request': <PreparedRequest [GET]>, 'response': None}\{'request': <PreparedRequest [GET]>, 'response': None}
WARNING:root:Got recoverable error from GET https://my.jira.domain/rest/api/2/serverInfo, will retry [1/3] in 10s. Err: ('Connection aborted.', TimeoutErro
r(110, 'Connection timed out'))
WARNING:root:('Connection aborted.', TimeoutError(110, 'Connection timed out')) while doing GET https://my.jira.domain/rest/api/2/serverInfo [{'params': No
ne, 'headers': {'Accept': '*/*', 'Cache-Control': 'no-cache', 'X-Atlassian-Token': 'no-check', 'Connection': 'keep-alive', 'User-Agent': 'python-requests/2.7.0 CPython/3.
4.3 Linux/4.0.5-1-ARCH', 'Content-Type': 'application/json', 'Accept-Encoding': 'gzip, deflate'}}]
WARNING:root:Got ConnectionError [('Connection aborted.', TimeoutError(110, 'Connection timed out'))] errno:None on GET https://my.jira.domain/rest/api/2/s
erverInfo
{'request': <PreparedRequest [GET]>, 'response': None}\{'request': <PreparedRequest [GET]>, 'response': None}
WARNING:root:Got recoverable error from GET https://my.jira.domain/rest/api/2/serverInfo, will retry [2/3] in 20s. Err: ('Connection aborted.', TimeoutErro
r(110, 'Connection timed out'))
WARNING:root:('Connection aborted.', TimeoutError(110, 'Connection timed out')) while doing GET https://my.jira.domain/rest/api/2/serverInfo [{'params': No
ne, 'headers': {'Accept': '*/*', 'Cache-Control': 'no-cache', 'X-Atlassian-Token': 'no-check', 'Connection': 'keep-alive', 'User-Agent': 'python-requests/2.7.0 CPython/3.
4.3 Linux/4.0.5-1-ARCH', 'Content-Type': 'application/json', 'Accept-Encoding': 'gzip, deflate'}}]
WARNING:root:Got ConnectionError [('Connection aborted.', TimeoutError(110, 'Connection timed out'))] errno:None on GET https://my.jira.domain/rest/api/2/s
erverInfo
{'request': <PreparedRequest [GET]>, 'response': None}\{'request': <PreparedRequest [GET]>, 'response': None}
WARNING:root:Got recoverable error from GET https://my.jira.domain/rest/api/2/serverInfo, will retry [3/3] in 30s. Err: ('Connection aborted.', TimeoutErro
r(110, 'Connection timed out'))
Traceback (most recent call last):
  File "/usr/bin/jirafs", line 9, in <module>
    load_entry_point('jirafs==1.12.0', 'console_scripts', 'jirafs')()
  File "/usr/lib/python3.4/site-packages/jirafs/cmdline.py", line 85, in main
    extra, jira=jira, path=os.getcwd(), command_name=command_name
  File "/usr/lib/python3.4/site-packages/jirafs/plugin.py", line 172, in execute_command
    result = cmd.handle(**kwargs)
  File "/usr/lib/python3.4/site-packages/jirafs/commands/clone.py", line 37, in handle
    return self.clone(path, ticket_url, jira)
  File "/usr/lib/python3.4/site-packages/jirafs/commands/clone.py", line 175, in clone
    jira,
  File "/usr/lib/python3.4/site-packages/jirafs/commands/clone.py", line 44, in clone_from_issue
    folder = TicketFolder.initialize_ticket_folder(ticket_url, path, jira)
  File "/usr/lib/python3.4/site-packages/jirafs/ticketfolder.py", line 443, in initialize_ticket_folder
    (instance.ticket_number, instance.path, )
  File "/usr/lib/python3.4/site-packages/jirafs/ticketfolder.py", line 925, in log
    self.issue,
  File "/usr/lib/python3.4/site-packages/jirafs/ticketfolder.py", line 232, in issue
    self._issue = self.jira.issue(self.ticket_number)
  File "/usr/lib/python3.4/site-packages/jirafs/ticketfolder.py", line 225, in jira
    config=self.get_config()
  File "/usr/lib/python3.4/site-packages/jirafs/utils.py", line 250, in <lambda>
    return lambda domain, config=None: get_jira(domain, config)
  File "/usr/lib/python3.4/site-packages/jirafs/utils.py", line 230, in get_jira
    jira = JIRA(login_data, basic_auth=basic_auth)
  File "/usr/lib/python3.4/site-packages/jira/client.py", line 219, in __init__
    si = self.server_info()
  File "/usr/lib/python3.4/site-packages/jira/client.py", line 1504, in server_info
    return self._get_json('serverInfo')
  File "/usr/lib/python3.4/site-packages/jira/client.py", line 1896, in _get_json
    r_json = json_loads(r)
  File "/usr/lib/python3.4/site-packages/jira/utils.py", line 78, in json_loads
    raise_on_error(r)
  File "/usr/lib/python3.4/site-packages/jira/utils.py", line 91, in raise_on_error
    raise JIRAError(None, **kwargs)
jira.utils.JIRAError: JiraError HTTP None

Add (simpler) link editing/adding functionality

Currently you can add/edit links by mucking around in the JSON blob in fields.jira, but it might be neat to be able to add/edit links without having to know what the proper JSON structure looks like.

Unicode Support

Trying to clone an issue with unicode causes issues:

jbriggs@jbriggs-x1 jira jirafs clone https://jirapd.corp-apps.com/browse/PWS-1445
[INFO PWS-1445] Ticket folder for issue PWS-1445 created at /home/jbriggs/tmp/jira/PWS-1445
Traceback (most recent call last):
File "/usr/local/bin/jirafs", line 9, in
load_entry_point('jirafs==1.4.1', 'console_scripts', 'jirafs')()
File "/usr/local/lib/python2.7/dist-packages/jirafs/cmdline.py", line 63, in main
extra, jira=jira, path=os.getcwd(), command_name=command_name
File "/usr/local/lib/python2.7/dist-packages/jirafs/plugin.py", line 149, in execute_command
result = cmd.handle(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/jirafs/commands/clone.py", line 37, in handle
return self.clone(path, ticket_url, jira)
File "/usr/local/lib/python2.7/dist-packages/jirafs/commands/clone.py", line 175, in clone
jira,
File "/usr/local/lib/python2.7/dist-packages/jirafs/commands/clone.py", line 46, in clone_from_issue
utils.run_command_method_with_kwargs('pull', folder=folder)
File "/usr/local/lib/python2.7/dist-packages/jirafs/utils.py", line 74, in run_command_method_with_kwargs
return getattr(installed_commandscommand, method)(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/jirafs/commands/pull.py", line 15, in pull
fetch_result = run_command_method_with_kwargs('fetch', folder=folder)
File "/usr/local/lib/python2.7/dist-packages/jirafs/utils.py", line 74, in run_command_method_with_kwargs
return getattr(installed_commandscommand, method)(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/jirafs/commands/fetch.py", line 101, in fetch
field
UnicodeEncodeError: 'ascii' codec can't encode character u'\u03a3' in position 2: ordinal not in range(128)

It looks like field is ascii but should be in unicode.

Cannot use non-standard URL

jirafs expects a URL like http://my.jira.server/browse/.... However our JIRA server is set up to use http://my.jira.server/jira/browse/... and jirfs barfs on that (below)

I put in a quick fix, changing line 213 of ticketfolder.py to

        match = re.match('\/.*\/browse\/(\w+-\d+)\/?.*', parts.path)

However this was insufficient as later on the code does not know to use the /jira part in constructing URLs

Traceback:

$ jirafs clone https://server.com/jira/browse/STUFF-999
Traceback (most recent call last):
  File "/home/jalanb/bin/jirafs", line 11, in <module>
    sys.exit(main())
  File "/home/jalanb/lib/python2.7/site-packages/jirafs/cmdline.py", line 86, in main
    extra, jira=jira, path=os.getcwd(), command_name=command_name
  File "/home/jalanb/lib/python2.7/site-packages/jirafs/plugin.py", line 172, in execute_command
    result = cmd.handle(**kwargs)
  File "/home/jalanb/lib/python2.7/site-packages/jirafs/commands/clone.py", line 37, in handle
    return self.clone(path, ticket_url, jira)
  File "/home/jalanb/lib/python2.7/site-packages/jirafs/commands/clone.py", line 175, in clone
    jira,
  File "/home/jalanb/lib/python2.7/site-packages/jirafs/commands/clone.py", line 44, in clone_from_issue
    folder = TicketFolder.initialize_ticket_folder(ticket_url, path, jira)
  File "/home/jalanb/lib/python2.7/site-packages/jirafs/ticketfolder.py", line 443, in initialize_ticket_folder
    (instance.ticket_number, instance.path, )
  File "/home/jalanb/lib/python2.7/site-packages/jirafs/ticketfolder.py", line 216, in ticket_number
    "Could not infer ticket number from URL %s" % self.issue_url
ValueError: Could not infer ticket number from URL https://server.com/jira/browse/STUFF-999

Configuration parser does interpolation on username and password

This makes it impossible to use a username or password containing a %. There are two errors included at the end, the first from attempting to save a password and the second from pulling after manually configuring the password.

By escaping the % with another %, jirafs proceeds to authentication but instead submits a now invalid password.

There is something called RawConfigParser that avoids interpolation, which is probably really what is wanted here, but I can't tell if that's from the same package jirafs uses.

JIRA Password (https://jira.dsg.dk): 
Save JIRA Password (Y/N)? y
Traceback (most recent call last):
  File "/usr/local/bin/jirafs", line 9, in <module>
    load_entry_point('jirafs==1.16', 'console_scripts', 'jirafs')()
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/cmdline.py", line 102, in main
    extra, jira=jira, path=args.folder, command_name=command_name
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/plugin.py", line 266, in execute_command
    cmd.handle(**kwargs)
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/plugin.py", line 303, in handle
    return self.cmd(*args, **kwargs)
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/plugin.py", line 307, in cmd
    self.main(*args, **kwargs)
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/commands/pull.py", line 13, in main
    fetch_result = run_command_method_with_kwargs('fetch', folder=folder)
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/utils.py", line 90, in run_command_method_with_kwargs
    return getattr(installed_commands[command](), method)(**kwargs)
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/commands/fetch.py", line 75, in main
    for filename in folder.get_remotely_changed():
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/ticketfolder.py", line 684, in get_remotely_changed
    getattr(self.issue.fields, 'attachment', []),
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/ticketfolder.py", line 236, in issue
    self._issue = self.jira.issue(self.ticket_number)
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/ticketfolder.py", line 229, in jira
    config=self.get_config()
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/utils.py", line 253, in <lambda>
    return lambda domain, config=None: get_jira(domain, config)
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/utils.py", line 211, in get_jira
    config.set(section, 'password', value)
  File "/usr/lib/python3.4/configparser.py", line 1167, in set
    super().set(section, option, value)
  File "/usr/lib/python3.4/configparser.py", line 872, in set
    value)
  File "/usr/lib/python3.4/configparser.py", line 382, in before_set
    "position %d" % (value, tmp_value.find('%')))
ValueError: invalid interpolation syntax in 'some%password' at position 18
$ jirafs pull
Traceback (most recent call last):
  File "/usr/local/bin/jirafs", line 9, in <module>
    load_entry_point('jirafs==1.16', 'console_scripts', 'jirafs')()
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/cmdline.py", line 102, in main
    extra, jira=jira, path=args.folder, command_name=command_name
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/plugin.py", line 266, in execute_command
    cmd.handle(**kwargs)
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/plugin.py", line 303, in handle
    return self.cmd(*args, **kwargs)
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/plugin.py", line 307, in cmd
    self.main(*args, **kwargs)
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/commands/pull.py", line 13, in main
    fetch_result = run_command_method_with_kwargs('fetch', folder=folder)
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/utils.py", line 90, in run_command_method_with_kwargs
    return getattr(installed_commands[command](), method)(**kwargs)
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/commands/fetch.py", line 75, in main
    for filename in folder.get_remotely_changed():
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/ticketfolder.py", line 684, in get_remotely_changed
    getattr(self.issue.fields, 'attachment', []),
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/ticketfolder.py", line 236, in issue
    self._issue = self.jira.issue(self.ticket_number)
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/ticketfolder.py", line 229, in jira
    config=self.get_config()
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/utils.py", line 253, in <lambda>
    return lambda domain, config=None: get_jira(domain, config)
  File "/home/quail/.local/lib/python3.4/site-packages/jirafs/utils.py", line 213, in get_jira
    login_data['password'] = config.get(section, 'password')
  File "/usr/lib/python3.4/configparser.py", line 773, in get
    d)
  File "/usr/lib/python3.4/configparser.py", line 374, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "/usr/lib/python3.4/configparser.py", line 423, in _interpolate_some
    "found: %r" % (rest,))
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: "%p'"

Disambiguate macro markers from Jira's native markup syntax

When I wrote this, I stupidly decided to mimic Jira's native markup syntax for macro markers. This was a terrible idea because it made it impossible to identify which markup should be handled by jirafs and which shouldn't, so I can't give any sort of error response when the user, for example, attempts to use a macro I'm not aware of.

What I'm currently planning to do is switch macro markers ton namespaced XML tags:

<jirafs:my_macro>
Macro content
</jirafs:my_macro>

instead of what they'd be currently:

{my_macro}
Macro content
{my_macro}

Add "match" feature

Feature name still tentative

Allows one to determine whether a field matches an expected value; currently I'm thinking it'll be modeled after grep's functionality such that differing status codes will be returned such that:

  • 0 indicates that the field matched.
  • 1 indicates that the field did not match.
  • 2 indicates that an error occurred.

Will include probably options:

  • --negate: Return a 0 if the field did not match, and a 1 if the field did match.
  • --json: Indicates that the user-supplied value should be decoded as JSON.

Weird formatting in migration warning message

(jirafs)acoddington@DATLADAMC-3 [07:18:26] [~/Desktop/Tickets/CMSIMPG-427]
-> % jirafs status
Your ticket folder is out-of-date and must be updated.  Migrations are not necessarily lossless; please record your current changes before proceeding with migrations.
Proceed? (N/y)y

Non-string values that have changed will cause an error to be raised on-pull.

Traceback (most recent call last):
  File "/usr/local/bin/jirafs", line 9, in <module>
    load_entry_point('jirafs==1.10.2', 'console_scripts', 'jirafs')()
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/cmdline.py", line 71, in main
    extra, jira=jira, path=os.getcwd(), command_name=command_name
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/plugin.py", line 166, in execute_command
    result = cmd.handle(**kwargs)
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/commands/submit.py", line 16, in handle
    return self.submit(folder, args.message)
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/commands/submit.py", line 23, in submit
    'push', folder=folder
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/utils.py", line 90, in run_command_method_with_kwargs
    return getattr(installed_commands[command](), method)(**kwargs)
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/commands/push.py", line 207, in push
    pull_result = run_command_method_with_kwargs('pull', folder=folder)
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/utils.py", line 90, in run_command_method_with_kwargs
    return getattr(installed_commands[command](), method)(**kwargs)
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/commands/pull.py", line 17, in pull
    merge_result = run_command_method_with_kwargs('merge', folder=folder)
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/utils.py", line 90, in run_command_method_with_kwargs
    return getattr(installed_commands[command](), method)(**kwargs)
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/commands/merge.py", line 47, in merge
    fr=self.truncate_field_value(values[0]),
  File "/Users/adamcoddington/Documents/Projects/jirafs/jirafs/plugin.py", line 97, in truncate_field_value
    value = original_value.strip()
AttributeError: 'list' object has no attribute 'strip' 

Macros using `src` will fail if referenced file is deleted.

This will be slightly tricky, because sometimes we do want the failure to propagate, and other times we do not. Specifically: in the case of rendered comments.read_only.jira we should handle the failure without propagating an exception.

Deal with git version incompatibilities; be more tolerant of old git versions.

In at least one occasion, I'm using a command option that requires a modern version of git -- specifically the --is-ancestor flag when calculating merge-base.

There are two feasible forward options:

  1. Rewrite features such as the above such that they are more tolerant of older versions of git.
  2. Warn the user when he or she is using an older version of git that this may behave unpredictably.

At the moment, unless using a version of git modern enough to support --is-ancestor, the app will always warn that there are unmerged changes, and you'll never be able to push! This is obviously undesirable.

How to register new command?

Hi, I try to write a command plugin as a reaction to #33, but I stumbled even on the first step. When I create this https://gitlab.com/mcepl/jirafs_mine/ and install on my system via python3 setup.py develop --user, and then run:

$ jirafs help

my new command (list_tickets) is not displayed. jirafs has been installed from the openSUSE package so the binary is in /usr/bin/jirafs and its libraries in /usr/lib/python3.7/site-packages/jirafs/. My plugin is registered in /home/matej/.local/lib/python3.7/site-packages/jirafs-mine.egg-link (with content a directory containing whole plugin project).

What I am missing?

Migrating up from a < v9 repository through migration #10 errors

(jirafs)acoddington@DATLADAMC-3 [07:18:26] [~/Desktop/Tickets/CMSIMPG-427]
-> % jirafs status
Your ticket folder is out-of-date and must be updated.  Migrations are not necessarily lossless; please record your current changes before proceeding with migrations.
Proceed? (N/y)y
[INFO CMSIMPG-427] migration_0009: Migration started
[INFO CMSIMPG-427] migration_0009: Migration finished
[INFO CMSIMPG-427] migration_0010: Migration started
Error (code: 128) while running git command.

Command:
    git --work-tree=/Users/acoddington/Desktop/Tickets/CMSIMPG-427 --git-dir=/Users/acoddington/Desktop/Tickets/CMSIMPG-427/.jirafs/git add -f /Users/acoddington/Desktop/Tickets/CMSIMPG-427/.jirafs/plugin_meta/.empty

Output:
    fatal: pathspec '/Users/acoddington/Desktop/Tickets/CMSIMPG-427/.jirafs/plugin_meta/.empty' did not match any files

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.