Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Building a
Production-Ready
Connect Add-On
Robin Fernandes
@rewbs / robin@atlassian.com
Who’s Looking?
Overview / Stack

Who’s Looking?

× many!

× many!
Overview / Interactions
1. User requests view issue page, gets signed URL to addon for that user.
Handled by Connect

GET ...
Overview / Interactions
1.

User requests view issue page, gets signed URL to add-on for that user.

2. User requests add-...
Overview / Interactions
1.
2.

User requests view issue page, gets signed URL to add-on for that user.
User requests add-o...
Overview / Interactions

https://bitbucket.org/atlassian/whoslooking-connect
Hosting
Hosting on Heroku
Heroku facilitates scalability
Hosting on Heroku

Deploying to Heroku is a git push.

> git push heroku master
Hosting on Heroku
Rich add-on ecosystem
Testing

•
•

Unit testing: business as usual
Browser integration tests: similar to P2

•
•

Run add-on and host app local...
Load Testing

•
•
•

Load test on a single dyno, and extrapolate
Methodology similar to any web app:
Identify usage patter...
Monitoring

•
•
•

Implement a Health Check

•

REST resource that runs sanity-checks & reports results

Monitor it (Pingd...
Monitoring
Deployment
Automated Staged Deployments

whoslooking-dev.
herokuapp.com
deploy

run PDV tests

dev
Automated Staged Deployments

Green dev
deployment?
whoslooking-stg.
herokuapp.com
promote from
dev to stg

run PDV tests
...
Automated Staged Deployments

All good on stg?
whoslooking.
herokuapp.com
promote from
dev to stg

run PDV tests
Automated Staged Deployments
Creating the MPAC listing
To build a production-ready Connect add-on...

•
•
•
•
•
•
•

Design for multi-tenancy and horizontal scalability
Ensure d...
Who’s Looking Stats

2 Dynos
5 Add-ons (4 free, 1 paid)
432 active instances last week
7655 active users last week
2500 av...
Upcoming SlideShare
Loading in …5
×

Building a Production Ready Atlassian Connect Add-On

2,692 views

Published on

There's a more recent version of this presentation here: http://www.slideshare.net/rewbs/atlascamp-2014-building-a-production-ready-connect-addon

Describes how to take an Atlassian Connect app all the way to production, including all the software as a service concerns that may be new to P2 plugin developers. Uses the "Who's Looking for OnDemand" add-on as an example. Presented at Sydney Connect Lab Week, 3rd Dec 2013.

Published in: Technology, Design
  • Be the first to comment

Building a Production Ready Atlassian Connect Add-On

  1. 1. Building a Production-Ready Connect Add-On Robin Fernandes @rewbs / robin@atlassian.com
  2. 2. Who’s Looking?
  3. 3. Overview / Stack Who’s Looking? × many! × many!
  4. 4. Overview / Interactions 1. User requests view issue page, gets signed URL to addon for that user. Handled by Connect GET view issue page User AC add-on signed URL to add-on JIRA OnDemand
  5. 5. Overview / Interactions 1. User requests view issue page, gets signed URL to add-on for that user. 2. User requests add-on iframe content. Add-on validates signature and processes request. OAuth validation handled by ac-play Remember to key any persisted data by tenant! GET iframe content (with signature) ! XHR poller User AC add-on JIRA OnDemand
  6. 6. Overview / Interactions 1. 2. User requests view issue page, gets signed URL to add-on for that user. User requests add-on iframe content. Add-on validates signature and processes request. 3. Client issues XHR heartbeat requests. Add-on validates requests and maintains viewer list. Don’t use cookies to authenticate XHR requests. Use @CheckValidToken instead! PUT heartbeat (XHR) Viewer list User AC add-on JIRA OnDemand
  7. 7. Overview / Interactions https://bitbucket.org/atlassian/whoslooking-connect
  8. 8. Hosting
  9. 9. Hosting on Heroku Heroku facilitates scalability
  10. 10. Hosting on Heroku Deploying to Heroku is a git push. > git push heroku master
  11. 11. Hosting on Heroku Rich add-on ecosystem
  12. 12. Testing • • Unit testing: business as usual Browser integration tests: similar to P2 • • Run add-on and host app locally Use Atlassian SDK, WebDriver, Atlassian Page Objects… • Run tests against a deployed add-on • Add post-deployment verification tests • • • Reliable sanity tests Must be runnable against a prod instance Run after every deployment
  13. 13. Load Testing • • • Load test on a single dyno, and extrapolate Methodology similar to any web app: Identify usage patterns Use tool to generate load (e.g. Gatling) Use e.g. New Relic to monitor dyno under load • •
  14. 14. Monitoring • • • Implement a Health Check • REST resource that runs sanity-checks & reports results Monitor it (Pingdom, New Relic…) Example: http://whoslooking.herokuapp.com/healthcheck (Checks Postgres & Redis connections, reports config settings, resource usage…)
  15. 15. Monitoring
  16. 16. Deployment
  17. 17. Automated Staged Deployments whoslooking-dev. herokuapp.com deploy run PDV tests dev
  18. 18. Automated Staged Deployments Green dev deployment? whoslooking-stg. herokuapp.com promote from dev to stg run PDV tests + soak time stg
  19. 19. Automated Staged Deployments All good on stg? whoslooking. herokuapp.com promote from dev to stg run PDV tests
  20. 20. Automated Staged Deployments
  21. 21. Creating the MPAC listing
  22. 22. To build a production-ready Connect add-on... • • • • • • • Design for multi-tenancy and horizontal scalability Ensure deploying is easy Make the most of 3rd party services • Hosting, data stores, log analysis, backups, monitoring… Load test to help estimate running cost Implement a health check resource & monitor it Run post-deployment verification tests Start simple
  23. 23. Who’s Looking Stats 2 Dynos 5 Add-ons (4 free, 1 paid) 432 active instances last week 7655 active users last week 2500 average rpm (~4500 peak) 160 ms average response time ! $44.50 / month

×