![Page 2: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/2.jpg)
Who’s Looking?
![Page 3: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/3.jpg)
Overview / Stack
Who’s Looking?
× many!
× many!
![Page 4: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/4.jpg)
Overview / Interactions
User
JIRA OnDemand
AC add-on
1. User requests view issue page, gets signed URL to add-on for that user.
GET view issue page
signed URL to add-on
Handled by Connect
![Page 5: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/5.jpg)
Overview / Interactions
User
JIRA OnDemand
AC add-on
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.
GET iframe content (with signature)
!XHR
poller
OAuth validation handled by ac-play
Remember to key any persisted data by tenant!
![Page 6: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/6.jpg)
Overview / Interactions
User
JIRA OnDemand
AC add-on
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. 3. Client issues XHR heartbeat requests. Add-on validates
requests and maintains viewer list.
PUT heartbeat (XHR)
Viewer list
Don’t use cookies to authenticate XHR requests.
Use @CheckValidToken instead!
![Page 7: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/7.jpg)
Overview / Interactions
https://bitbucket.org/atlassian/whoslooking-connect
![Page 8: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/8.jpg)
Hosting
![Page 9: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/9.jpg)
Hosting on Heroku
Heroku facilitates scalability
![Page 10: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/10.jpg)
Hosting on Heroku
Deploying to Heroku is a git push.
> git push heroku master
![Page 11: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/11.jpg)
Hosting on Heroku
Rich add-on ecosystem
![Page 12: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/12.jpg)
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
![Page 13: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/13.jpg)
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
![Page 14: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/14.jpg)
Monitoring
http://whoslooking.herokuapp.com/healthcheck
• Implement a Health Check • REST resource that runs sanity-checks & reports results
• Monitor it (Pingdom, New Relic…)
• Example:
(Checks Postgres & Redis connections, reports config settings, resource usage…)
![Page 15: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/15.jpg)
Monitoring
![Page 16: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/16.jpg)
Deployment
![Page 17: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/17.jpg)
Automated Staged Deployments
whoslooking-dev. herokuapp.com
dev
run PDV tests
deploy
![Page 18: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/18.jpg)
Automated Staged Deployments
whoslooking-stg. herokuapp.com
stg
run PDV tests
promote from dev to stg
Green dev deployment?
+ soak time
![Page 19: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/19.jpg)
Automated Staged Deployments
whoslooking. herokuapp.com
run PDV tests
promote from dev to stg
All good on stg?
![Page 20: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/20.jpg)
Automated Staged Deployments
![Page 21: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/21.jpg)
Creating the MPAC listing
![Page 22: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/22.jpg)
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
![Page 23: Building a Production Ready Atlassian Connect Add-On](https://reader033.vdocuments.site/reader033/viewer/2022051515/554a128bb4c90507558b4e55/html5/thumbnails/23.jpg)
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