Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Azure Devops #745

Closed

Conversation

cam-barts
Copy link
Contributor

Azure Devops Integration

This integrates Azure Devops workitems into Bugwarrior.

So far the service is functional, but there's still some ironing out to do.

The general workflow:

  • Get workitem ID's from a wiql query -> list(int)
  • For workitem in query, create a taskwarrior issue

The default query:

SELECT [System.Id] FROM workitems WHERE [System.AssignedTo] = @me

There is a config item where you can add filters to the query.
For Example:

 ado.wiql_filter = [System.State] not in ('Done', 'Complete') AND [System.WorkItemType] in ('Task', 'Bug')

Framework mods:

  • ADO gives options for many work item types that aren't in the standard cls_markup
  • I use pipenv, so I ignored the Pipfile and Pipfile.lock

Known Issues:

  • With the default query, at least with my actual work, is terribly slow, as it get all previous closed tickets every pull
    • Pulling 185 items takes around a minute to a minute 15 seconds
  • It has no logic to get multiple projects/orgs with the same key, so each project/org pair would need a new config target

Work Still to Be Done

  • Tests
    • I need to learn nose
  • Documentation
    • I've not written any docs in restructured text, so I'll have to figure that out too

@@ -18,3 +18,4 @@ man/*
*.idea
.tox/*
*.bak
Pipfile*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, there's been discussion in #743 of adding Pipfile to the git repository as a tracked file.

@@ -368,6 +368,8 @@ def build_default_description(
'release': 'Release',
'chore': 'Chore',
}
if cls not in cls_markup.keys():
cls_markup[cls] = cls.lower()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me why this is necessary since task and bug are both keys in cls_markup.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Task and Bug aren't the only workitem types that can be assigned to users in Azure Devops. It supports different methodologies, which call tracked tasks different things that aren't included in the dict, like product backlog item and impediment for scrum process and change request and risk for CMMI.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the past we've added items to cls_markup for each individual type, even if it's only used by a single service. (See #666 in which we added 5 items for one service.) It would probably be better to move this logic down into the individual services but I don't think we'll want to accept open-ended types like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps I don't understand this portion of code like I thought I did. I was under the impression that all this provides is a work item type in the default description, and gives it some shorthand or removed it in special cases. I'd be fine doing it either way, and even trying to abstract this into the config somehow, but I don't understand why open ended types would be an issue.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. In general we prefer that bugwarrior breaks when our API assumptions are violated but in this case there don't appear to be consequences for arbitrary classes.

However, for consistency could we make this cls.title()? You could then remove the last 5 items in cls_markup which would be effectively no-op.

Also, I think it would be more straightforward to do cls_markup.get(cls, cls.title()) in the returned string below than to add it to the dict like this.

Fongshway and others added 26 commits September 17, 2020 12:07
This patch enables using a vault or `@oracle` to retrieve a Bugzilla api
key.

Example:

```toml
bugzilla.api_key = @oracle:eval:pass bugzilla/bugwarrior
```
We no longer support any version of python for which this backport is
necessary.
Conform to the dominant pattern of deserializing dates in
Issue.to_taskwarrior. Resolve GothenburgBitFactory#740.
* Update .travis.yml

* Update .travis.yml

Added power architecture...

* Update .travis.yml

given permissions for cache/pip/wheels on ppc64le
For backward compatibility the old parsing method is still in place.
This should fix the build on power architecture with a newer version of
openssl.
* Adding replace_tags options, allowing user to delete the local tags
before adding the remotes one.

As static_fields, static_tags allow the user to specify some tags to
keep from the local ones.

* Add documentation
i haven't read the docs, but from reading the code it seems that `None` is the right thing to pass.  `-1` seems to
get 100 results, while omitting the parameter returns the default of `100`.

Fixes: GothenburgBitFactory#764
This adds support for the common configuration options
`only_if_assigned` and `also_unassigned`, which should be supported by
all services.

Resolve GothenburgBitFactory#243.
This controls the maximum length of the githubbody UDA, and can be used
to avoid syncing the body at all (by setting it to 0).
In Python 3, ConfigParser is more exacting about the syntax it allows,
and in particular it disallows bare `%` characters.  This causes an
error for URLs containing such characters, but the bare `except` just
treated this error as a missing configuration and did not show it to the
user.
This tests the behavior described in GothenburgBitFactory#769 and implemented in GothenburgBitFactory#779.
This implementation aims to be a more performant alternative to GothenburgBitFactory#796 by
avoiding an extra taskwarrior query on each loop.
The service works without an account.
nblock and others added 4 commits February 1, 2021 17:07
…othenburgBitFactory#794)

* Add support for Kanboard service (fixes: GothenburgBitFactory#223)

* Add kanboard service and tests
* Add documentation and update README

* Add kanboard to travis

* Mention the use of API tokens instead of a password

* Fix UDA types

* Also use my_api_token in the example configuration
@silvio
Copy link
Contributor

silvio commented Mar 16, 2021

Can I ask what the status of this PR is? This looks like I could make good use of this? Is it still being worked on, @cam-barts ?

@cam-barts
Copy link
Contributor Author

Hiya @silvio, I had to put this down for awhile to work on other things, but I can put some effort into it by next week. I need to learn nose to get the cov back up to snuff and I need to address some of the stuff @ryneeverett mentioned, but the functionality is there on my fork and I've been using it for months. Let me know if that works for you.

@ryneeverett
Copy link
Collaborator

I need to learn nose to get the cov back up to snuff

FYI we switched from nose to pytest since you originally posted this PR.

@cam-barts
Copy link
Contributor Author

It seems I've screwed up my git stuff. Working on cleaning up and then getting some tests in.

@cam-barts cam-barts closed this Mar 28, 2021
@cam-barts cam-barts deleted the azure_devops_service branch March 28, 2021 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.