Bonfire... How'd You Do That?! - AtlasCamp 2011

GoAtlassian 1,226 views 76 slides Dec 29, 2011
Slide 1
Slide 1 of 76
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76

About This Presentation

How do you write a JIRA plugin that works across 4.2, 4.3 and 4.4? How can you find the metadata for the JIRA issue creation form? How can you create the issue itself, and attach the screenshot? And how is this going to change in JIRA 5.0 and beyond? This talk will cover all this, and more!


Slide Content

Saturday, 1 October 2011

Howʼd you do that?
Ian Grunert
Developer, Atlassian
Bonfire
2
Saturday, 1 October 2011

Agenda
3
Saturday, 1 October 2011

•What is Bonfire?
Agenda
3
Saturday, 1 October 2011

•What is Bonfire?
•Building plugins for
multiple JIRA
versions
Agenda
3
Saturday, 1 October 2011

•What is Bonfire?
•Building plugins for
multiple JIRA
versions
•JIRA integration in
Bonfire - problems
and solutions
Agenda
3
Saturday, 1 October 2011

What is Bonfire?
4
Saturday, 1 October 2011

•Exploratory
testing tool
What is Bonfire?
4
Saturday, 1 October 2011

•Exploratory
testing tool
•JIRA plugin
targeting multiple
JIRA versions
What is Bonfire?
4
Saturday, 1 October 2011

•Exploratory
testing tool
•JIRA plugin
targeting multiple
JIRA versions
•Browser
extension for
major browsers
What is Bonfire?
4
Saturday, 1 October 2011

•Browser extension -
JIRA client
•Submit bug reports
directly from your
browser
Bonfire -> JIRA Integration
5
Saturday, 1 October 2011

•JIRA Plugin - track and
manage testing activities
•Test Sessions
•Session Notes
•http://
www.atlassian.com/
bonfire
Bonfire -> JIRA Integration
6
Saturday, 1 October 2011

Building multiple JIRA version
supported plugins"
7
Saturday, 1 October 2011

•Why?
Building multiple JIRA version
supported plugins"
7
Saturday, 1 October 2011

•Why?
•Problem points?
Building multiple JIRA version
supported plugins"
7
Saturday, 1 October 2011

•Why?
•Problem points?
•Some Solutions.
Building multiple JIRA version
supported plugins"
7
Saturday, 1 October 2011

•Increase the size
of your market
•Should try and
support two
versions back.
Maximise your customer base
8
Earlier 4.0 4.1 4.2 4.3
Saturday, 1 October 2011

•Deploy to multiple internal
instances
•For example,
https://support.atlassian.com/
is 4.3, where as
https://jira.atlassian.com/ is
4.4.
Multiple JIRA instances
9
Saturday, 1 October 2011

•Test against EAPs!
•Give feedback.
•Participate in API building
•Support JIRA 5.0 from
launch
Be ready for upgrades
10
Saturday, 1 October 2011

Problems
11
Saturday, 1 October 2011

•Java API changes
Problems
11
Saturday, 1 October 2011

•Java API changes
•JS and Markup changes
Problems
11
Saturday, 1 October 2011

•Java API changes
•JS and Markup changes
•Testing across multiple
versions
Problems
11
Saturday, 1 October 2011

Branching
12
Saturday, 1 October 2011

•Cleaner code
Branching
12
Saturday, 1 October 2011

•Cleaner code
•Is this good or bad?
Branching
12
Saturday, 1 October 2011

•Cleaner code
•Is this good or bad?
•Overhead
Branching
12
Saturday, 1 October 2011

•Cleaner code
•Is this good or bad?
•Overhead
•Builds
Branching
12
Saturday, 1 October 2011

•Cleaner code
•Is this good or bad?
•Overhead
•Builds
•MergingBranching
12
Saturday, 1 October 2011

•Cleaner code
•Is this good or bad?
•Overhead
•Builds
•Merging
•Testing
Branching
12
Saturday, 1 October 2011

One build, multiple versions
13
Saturday, 1 October 2011

One build, multiple versions
13
•Messier code
Saturday, 1 October 2011

One build, multiple versions
13
•Messier code
•No merging
Saturday, 1 October 2011

One build, multiple versions
13
•Messier code
•No merging
•Shipping one jar
Saturday, 1 October 2011

One build, multiple versions
13
•Messier code
•No merging
•Shipping one jar
•All tests in one branch
Saturday, 1 October 2011

One build, multiple versions
13
•Messier code
•No merging
•Shipping one jar
•All tests in one branch
•Know when touching
problem areas
Saturday, 1 October 2011

Six multi-version plugin
techniques
14
Saturday, 1 October 2011

1. CI using AMPS
Six multi-version plugin
techniques
14
Saturday, 1 October 2011

1. CI using AMPS
2. Javascript / Markup changes - AJS.version
Six multi-version plugin
techniques
14
Saturday, 1 October 2011

1. CI using AMPS
2. Javascript / Markup changes - AJS.version
3. Non-compile breaking API changes - BuildUtilsInfo
Six multi-version plugin
techniques
14
Saturday, 1 October 2011

1. CI using AMPS
2. Javascript / Markup changes - AJS.version
3. Non-compile breaking API changes - BuildUtilsInfo
4. UI location changes - Web fragment conditions
Six multi-version plugin
techniques
14
Saturday, 1 October 2011

1. CI using AMPS
2. Javascript / Markup changes - AJS.version
3. Non-compile breaking API changes - BuildUtilsInfo
4. UI location changes - Web fragment conditions
5. Compile breaking changes - Reflection
Six multi-version plugin
techniques
14
Saturday, 1 October 2011

1. CI using AMPS
2. Javascript / Markup changes - AJS.version
3. Non-compile breaking API changes - BuildUtilsInfo
4. UI location changes - Web fragment conditions
5. Compile breaking changes - Reflection
6. Compile breaking changes - Dynamic module types
Six multi-version plugin
techniques
14
Saturday, 1 October 2011

•Run CI against all supported versions
•Use testGroups in AMPS to facilitate this
•Quickly identify compile-time issues introduced
Continuous Integration
15
Saturday, 1 October 2011

16
Saturday, 1 October 2011

17
Saturday, 1 October 2011

•AJS.version to find AUIʼs version, split the code path
•https://developer.atlassian.com/display/AUI/AUI
+Version+Matrix
JavaScript / Markup changes
18
Saturday, 1 October 2011

19
Saturday, 1 October 2011

20
Saturday, 1 October 2011

•BuildUtilsInfo in JIRA can be used to find the JIRA
version and split the code path
Querying JIRA version
21
Saturday, 1 October 2011

•Allows you to define a boolean condition as to whether
or not a web-fragment shows up
•IsPriorToJIRAVersion condition to only show web
fragments in certain JIRA versions (uses
BuildUtilsInfo)
Web-fragment Conditions
22
Saturday, 1 October 2011

Example
23
Saturday, 1 October 2011

•Use this:
•To load a class only present in later versions of JIRA
•To load a class that changes names across JIRA
versions
Compile breaking changes -
Reflection"
24
Saturday, 1 October 2011

Example
25
Saturday, 1 October 2011

Example
26
Saturday, 1 October 2011

•JIRA 5.0 removes OSUser
entirely
•Replaced with Crowd user
•Large scale compile time
breaking changes
How does this look in JIRA 5?
27
Saturday, 1 October 2011

•Approach taken by Bonfire was to drop 4.2 support,
and remove as much OSUser as possible
•Some instances of OSUser couldnʼt be removed
(IssueTabPanel for example)
•Then create a branch, and change the imports for the
branchWe tried branching
28
Saturday, 1 October 2011

•In JIRA 4.3 / 4.4, use special methods to get crowd
user object
•jiraAuthContext.getUser for OSUser
•jiraAuthContext.getLoggedInUser() for Crowd User
•OSUser based methods are deprecated in 4.3 / 4.4
Deprecation pains
29
Saturday, 1 October 2011

•In JIRA 5.0, the better 4.3/4.4
Crowd user methods are now
deprecated (moved to nicer
named methods)
•Doing the right thing yields
lots of warnings
Deprecation pains
30
Saturday, 1 October 2011

•For the same reasons outlined before
•No eyes on JIRA 5.0 changes
•Merge pain
•Multiple jars
•How can we fix this?Branching sucks!
31
Saturday, 1 October 2011

•Don Brown created jira4-compat to allow Speakeasy
to support 4.2 -> 5.0 without branching
•Uses dynamic plugin module types to allow for new,
cross version compatible module types
•4 maven modules, compile different maven modules
based on JIRA version
•FactoryBean Spring Component to inject the correct
dependency
Dynamic module types
32
Saturday, 1 October 2011

1. Multi-version support - you should be doing it!
2. Donʼt have to branch to do multi-version.
3. The documentation can help!
http://confluence.atlassian.com/display/JIRA/Plugin
+Developer+Notes+for+JIRA+5.0Bonfire multi-version
experiences - takeaways
33
Saturday, 1 October 2011

Bonfire remote JIRA integration
34
Saturday, 1 October 2011

Bonfire remote JIRA integration
35
Saturday, 1 October 2011

Bonfire remote JIRA integration
35
1. Authentication
Saturday, 1 October 2011

Bonfire remote JIRA integration
35
1. Authentication
2. Issue metadata
Saturday, 1 October 2011

Bonfire remote JIRA integration
35
1. Authentication
2. Issue metadata
3. Issue Creation
Saturday, 1 October 2011

Authentication
36
•Canʼt store the password
•Ideally, single step
authentication
Saturday, 1 October 2011

Authentication
37
•Use JIRA REST
•Returns a cookie
•Use cookie for all future
requests
•Re-authenticate on
cookie timeout
Saturday, 1 October 2011

•Need metadata to draw the
issue creation form
•XML-RPC
•Missing fields
•Could not create on some
instances
Issue metadata
38
Saturday, 1 October 2011

•Now on custom REST
•Bad: extra code
•Good: In control, works on
all instances, can add new
Bonfire specific features
Issue metadata
39
Saturday, 1 October 2011

•XML-RPC
•Gaps filled with REST
(e.g. labels)
•SOAP for attachments
Issue creation
40
Saturday, 1 October 2011

•Now on custom REST
•Bad: extra code
•Good: In control, works on
all instances, can add new
Bonfire specific features
•Déjà vu?
Issue creation
41
Saturday, 1 October 2011

•In JIRA 5.0, neither custom
REST resource would be
required
Good news, everyone!
42
Saturday, 1 October 2011

1. Test on real / complex data!
(use atlas-create-home-zip)
2. Favour REST
3. Donʼt fear custom REST resources
Bonfire Remote API
experiences - takeaways
43
Saturday, 1 October 2011

Thank you!
Saturday, 1 October 2011
Tags