Add push connector for Aha.io

RESOLVED FIXED

Status

()

bugzilla.mozilla.org
Extensions: Push
RESOLVED FIXED
2 years ago
2 months ago

People

(Reporter: dylan, Assigned: dylan)

Tracking

Production
Dependency tree / graph

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

2 years ago
For bugs with a see-also on an aha.io feature, ship the feature when the bug is resolved.

Open question: Do we unship if a bug is re-opened?
(Assignee)

Updated

2 years ago
Blocks: 1216643
(Assignee)

Comment 1

2 years ago
I had a meeting with Romain and Karen today, and we're not going to "Ship" features when bugs are closed, but rather mark them as "ready to ship".
(Assignee)

Comment 2

2 years ago
Push connector worked! Resolved a bug to fixed and it set my DEMO feature to Ready to Ship. Patch soon.
(Assignee)

Comment 3

2 years ago
Created attachment 8694216 [details] [diff] [review]
1224001_1.patch

Finally works. 

To test this you'll need to set up an aha! account.
Go to http://www.aha.io/ to start a free trial. When asked if you want a default set of features (or a "demo" something) say yes. 

For example, I setup bugzilla.aha.io and then added
https://bugzilla.aha.io/features/DEMO-1 to the see also of a bug. When I resolve the bug as fixed it will connect (via the push connector, so the daemon must be running) to aha and mark it as "Ready To Ship". I also added a check to prevent it from taking a Shipped feature and puting it back to "Ready to ship".
Otherwise I've cut down the code to do the bare minimum.
Attachment #8694216 - Flags: review?(dkl)
Comment on attachment 8694216 [details] [diff] [review]
1224001_1.patch

Review of attachment 8694216 [details] [diff] [review]:
-----------------------------------------------------------------

Functions as expected. Just a few minor changes needed.

::: extensions/Push/lib/Connector/Aha.pm
@@ +21,5 @@
> +
> +use DateTime;
> +use JSON 'decode_json', 'encode_json';
> +use LWP::UserAgent;
> +use List::MoreUtils 'any';

'any' not used

@@ +22,5 @@
> +use DateTime;
> +use JSON 'decode_json', 'encode_json';
> +use LWP::UserAgent;
> +use List::MoreUtils 'any';
> +use Scalar::Util 'blessed';

'blessed' not used

@@ +116,5 @@
> +}
> +
> +sub _aha_feature_uri {
> +    my ($self, $feature_id) = @_;
> +    my $uri  = $self->_aha_uri("api/v1/features/$feature_id");

nit: extraneous white space

@@ +124,5 @@
> +
> +sub _aha_update_feature {
> +    my ($self, $feature_id, $workflow_status) = @_;
> +    my $feature_uri = $self->_aha_feature_uri($feature_id);
> +    my $ua  = $self->_user_agent;

ditto

@@ +126,5 @@
> +    my ($self, $feature_id, $workflow_status) = @_;
> +    my $feature_uri = $self->_aha_feature_uri($feature_id);
> +    my $ua  = $self->_user_agent;
> +
> +    $ua->put($feature_uri, 'Content-Type' => 'application/json', Content => encode_json({workflow_status => $workflow_status}));

nit: add whitespace after { and before } for readability

@@ +139,5 @@
> +}
> +
> +sub send {
> +    my ($self, $message) = @_;
> +    my $logger = Bugzilla->push_ext->logger;

$logger not used

@@ +150,5 @@
> +        foreach my $see_also (@{ $bug->see_also }) {
> +            if ($see_also->isa('Bugzilla::BugUrl::Aha')) {
> +                my $feature_id = $see_also->get_feature_id;
> +                my $feature = $self->_aha_get_feature($feature_id);
> +                unless (lc($feature->{feature}{workflow_status}{name}) eq 'shipped') {

we should also check to see if the feature exists as well before trying to update it. the bugzilla user may have entered a bogus feature id.
Attachment #8694216 - Flags: review?(dkl) → review-
(Assignee)

Comment 5

2 years ago
Created attachment 8703206 [details] [diff] [review]
1224001_3.patch

This should happily ignore invalid features
Attachment #8694216 - Attachment is obsolete: true
Attachment #8703206 - Flags: review?(dkl)
Comment on attachment 8703206 [details] [diff] [review]
1224001_3.patch

Review of attachment 8703206 [details] [diff] [review]:
-----------------------------------------------------------------

r=dkl
Attachment #8703206 - Flags: review?(dkl) → review+
(Assignee)

Comment 7

2 years ago
To ssh://gitolite3@git.mozilla.org/webtools/bmo/bugzilla.git
   efe494e..ead96ae  master -> master
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
(Assignee)

Updated

2 months ago
Blocks: 1371464
You need to log in before you can comment on or make changes to this bug.