Closed Bug 1224001 Opened 9 years ago Closed 9 years ago

Add push connector for Aha.io

Categories

(bugzilla.mozilla.org :: Extensions, defect)

Production
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dylan, Assigned: dylan)

References

Details

Attachments

(1 file, 1 obsolete file)

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?
Blocks: 1216643
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".
Push connector worked! Resolved a bug to fixed and it set my DEMO feature to Ready to Ship. Patch soon.
Attached patch 1224001_1.patch (obsolete) — Splinter Review
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-
Attached patch 1224001_3.patchSplinter Review
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+
To ssh://gitolite3@git.mozilla.org/webtools/bmo/bugzilla.git efe494e..ead96ae master -> master
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Blocks: 1371464
Component: Extensions: Push → Extensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: