OSLC-CM connector in SD

65
Cliquez pour modifier le style des sous-titres du masque Stéphanie Ouillon - Mentor : Olivier Berger Cassiopee Project 2012 Implementing the support of OSLC-CM in Simple Defects

description

Implementing the support of OSLC-CM in the bugtracker SD. More information at http://arroway.github.com/Net-OSLC-CM

Transcript of OSLC-CM connector in SD

Page 1: OSLC-CM connector in SD

Cliquez pour modifier le style des sous-titres du masque

Stéphanie Ouillon - Mentor : Olivier Berger

Cassiopee Project 2012

Implementing the support of OSLC-CM in Simple Defects

Page 2: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Contents

q  Simple Defects (SD) q  SD connectors q  Introduction to OSLC-CM q  Development goal q  Net-OSLC-CM Perl module q  OSLC connector in SD q  Using and testing q  Making-up

Page 3: OSLC-CM connector in SD

Specifications

q  Implementing a OSLC-CM adaptator for the bugtracker Simple Defects q  Open Source contribution

q  Publishing content on the web

Base de données Pro

Cassiopee 2012 OSLC-CM connector in SD

Page 4: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Simple Defects (SD)

Simple Defects (SD) q  Introduction to OSLC-CM q  Development goal q  SD connectors q  Net-OSLC-CM Perl module q  OSLC connector in SD q  Using and testing q  Making-up

Page 5: OSLC-CM connector in SD

Simple Defects : a bugtracker

q  In command ligne

Prophet database

Cassiopee 2012 OSLC-CM connector in SD

Page 6: OSLC-CM connector in SD

Simple Defects : a bugtracker

Cassiopee 2012 OSLC-CM connector in SD 5

filesystem

Web browser

code

bugs

Server/storage IDE

Page 7: OSLC-CM connector in SD

Simple Defects : a bugtracker

Cassiopee 2012 OSLC-CM connector in SD 6

filesystem

Terminal + SD

code

bugs

Server/storage Terminal + Vim

filesystem

Page 8: OSLC-CM connector in SD

Simple Defects : un bugtracker

q  In command ligne

q  Prophet database

https://gitorious.org/prophet/prophet

Cassiopee 2012 OSLC-CM connector in SD

Page 9: OSLC-CM connector in SD

Prophet

ü  Semi-relationnal

ü  Peer to peer replicated

ü  Disconnected

ü  Versioned

ü  Self-healing conflict resolution

Cassiopee 2012 OSLC-CM connector in SD

Page 10: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Page 11: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Page 12: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Page 13: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Page 14: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Page 15: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Page 16: OSLC-CM connector in SD

Demonstration

Cassiopee 2012 OSLC-CM connector in SD

Page 17: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Page 18: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Page 19: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Introduction to OSLC-CM

Simple Defects (SD) Introduction to OSLC-CM q  Development goal q  SD connectors q  Net-OSLC-CM Perl module q  OSLC connector in SD q  Using and testing q  Making-up

Page 20: OSLC-CM connector in SD

OSLC

Open Services for Lifecycle Collaboration

q  Specifications

ü  Sharing data

ü  Between software development tools

Cassiopee 2012 OSLC-CM connector in SD

Page 21: OSLC-CM connector in SD

Specifications

q  Core specifications v2

q  Change Management specifications v2

Defining a web services REST interface for Change Management

Cassiopee 2012 OSLC-CM connector in SD

Page 22: OSLC-CM connector in SD

Change Management

q  Defects, bugs

q  Change requests, tasks

Cassiopee 2012 OSLC-CM connector in SD

Page 23: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Page 24: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Page 25: OSLC-CM connector in SD

Principles: REST – Linked Data

q  ‘’Everything is a URI.’’ q  RDF/XML data format q  HTTP protocol

Pull : GET Push : POST, UPDATE, DELETE

Cassiopee 2012 OSLC-CM connector in SD

Page 26: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Page 27: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Development goal

Simple Defects (SD) Introduction to OSLC-CM Development goal q  SD connectors q  Net-OSLC-CM Perl module q  OSLC connector in SD q  Using and testing q  Making-up

Page 28: OSLC-CM connector in SD

Goal

Cassiopee 2012 OSLC-CM connector in SD

SD Bugzilla

Adaptator OSLC-CM Service Provider

Page 29: OSLC-CM connector in SD

Goal

Cassiopee 2012 OSLC-CM connector in SD

SD Bugzilla

Adaptator OSLC-CM Service Provider

Adaptator OSLC-CM Consumer

Page 30: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

SD connectors

Simple Defects (SD) Introduction to OSLC-CM Development goal SD connectors q  Net-OSLC-CM Perl module q  OSLC connector in SD q  Using and testing q  Making-up

Page 31: OSLC-CM connector in SD

Development in SD

q  Developed in Perl 5

q  Object-oriented with Moose

Cassiopee 2012 OSLC-CM connector in SD

Page 32: OSLC-CM connector in SD

Example with Github bugtracker

q  3 classes in Replica/

ü  github.pm

ü  github/PullEncoder.pm

ü  github/PushEncoder.pm

Cassiopee 2012 OSLC-CM connector in SD

Page 33: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Partial UML diagram (inheritance)

Page 34: OSLC-CM connector in SD

Example with Github

q  Perl interface for github.com

Net::GitHub::V2

Cassiopee 2012 OSLC-CM connector in SD

Page 35: OSLC-CM connector in SD

Example with Github

q  github.pm module

$sd clone –-from \ ‘github:http://github.com/arroway/SD/issues’

ü  Authentification (OAuth or basic auth)

ü  Connection

Cassiopee 2012 OSLC-CM connector in SD

Page 36: OSLC-CM connector in SD

Example with Github

q  github/PullEncoder.pm module

find_matching_tickets calls

github->issue->list(‘open’) github->issue->list(‘closed’)

Cassiopee 2012 OSLC-CM connector in SD

Page 37: OSLC-CM connector in SD

Example with Github

q  github/PushEncoder.pm module

integrate_ticket_create/update calls

$github->issue->open/edit

Cassiopee 2012 OSLC-CM connector in SD

Page 38: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Net-OSLC-CM Perl Module

Simple Defects (SD) SD connectors Introduction to OSLC-CM Development goal Net-OSLC-CM Perl Module q  OSLC connector in SD q  Using and testing q  Making-up

Page 39: OSLC-CM connector in SD

Net-OSLC-CM

q  Standard Perl module

q  Helping implement a OSLC-CM Consumer

Cassiopee 2012 OSLC-CM connector in SD

Page 40: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Page 41: OSLC-CM connector in SD

Example

Cassiopee 2012 OSLC-CM connector in SD

use Net::OSLC::CM; my $oslccm = Net::OSLC::CM−>new( url => $self−>remote_url, username => $username, password => $password )); # Getting an array of changeRequests

my @results = $oslccm−>get_oslc_resources;

Page 42: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

my @results = $oslccm−>changeRequests;

Résultat final

Page 43: OSLC-CM connector in SD

Detailed example

Cassiopee 2012 OSLC-CM connector in SD

$oslccm−>url = "http://example.com"; $oslccm−>parser( Net::OSLC::CM::Parser−>new(cm => $oslccm) ); $oslccm−>create_catalog; $oslccm−>get_provider_catalog_resource; $oslccm−>get_service_providers; $oslccm−>get_changeRequests($oslccm−>providers); $oslccm−>load_changeRequests(); my @results = $oslccm−>changeRequests;

Page 44: OSLC-CM connector in SD

http://localhost:8282/bugz Connection Authentification (basic auth)

Connection OK Authenticated

Consumer

Connection to a bugtracker

Cassiopee 2012 OSLC-CM connector in SD

Connection

Page 45: OSLC-CM connector in SD

http://localhost:8282/bugz GET http://localhost:8282/bugz/catalog Accept => application/rdf+xml

Consumer

GET Catalog

<oslc:ServiceProviderCatalog rdf:about="http://localhost/bugz/catalog">

Cassiopee 2012 OSLC-CM connector in SD

Getting the Service Provider Catalog

Page 46: OSLC-CM connector in SD

Service Provider Catalog <oslc:ServiceProviderCatalog rdf:about="http://localhost:8282/bugz/catalog">

<dcterms:title>OSLC-CM Adapter/Bugzilla Service Provider Catalog</dcterms:title> <oslc:domain rdf:resource="http://open-services.net/ns/cm#" />

<oslc:serviceProvider> <oslc:ServiceProvider rdf:about="http://localhost:8282/bugz/provider?

productId=1"> <dcterms:title>TestProduct</dcterms:title> </oslc:ServiceProvider> </oslc:serviceProvider>

<oslc:serviceProvider>

<oslc:ServiceProvider rdf:about="http://localhost:8282/bugz/provider?productId=3">

<dcterms:title>FakePortal</dcterms:title> </oslc:ServiceProvider> </oslc:serviceProvider>

</oslc:ServiceProviderCatalog>

Cassiopee 2012 OSLC-CM connector in SD

Catalog RDF/XML

Page 47: OSLC-CM connector in SD

GET http://localhost:8282/bugz/provider?productId=1 GET http://localhost:8282/bugz/provider?productId=2 GET http://localhost:8282/bugz/provider?productId=3 …

Consumer

GET Service Providers

Cassiopee 2012 OSLC-CM connector in SD

Getting Service Providers data

Page 48: OSLC-CM connector in SD

Service Provider <oslc:ServiceProvider rdf:about="http://localhost:8282/bugz/provider?productId=1"> <dcterms:title>Bugzilla Service Provider: Product TestProduct(1)</dcterms:title> <oslc:Service>

<oslc:selectionDialog/> <oslc:creationDialog/> <oslc:CreationFactory/> <oslc:QueryCapability> <oslc:queryBase rdf:resource="http://localhost:8282/bugz/changerequests? productId=1" /> <oslc:resourceShape rdf:resource="http://localhost:8282/bugz/queryshape? productId=1" /> </oslc:QueryCapability>

<oslc:Service/> <oslc:ServiceProvider/>

Cassiopee 2012 OSLC-CM connector in SD

Service Provider RDF/XML

Page 49: OSLC-CM connector in SD

GET http://localhost:8282/bugz/changerequests?productId=1

Consumer

GET Change Requests list

Cassiopee 2012 OSLC-CM connector in SD

Getting a list of Change Requests (tickets)

Page 50: OSLC-CM connector in SD

GET http://localhost:8282/bugz/changerequest?id=24

Consumer

GET Change Request

Cassiopee 2012 OSLC-CM connector in SD

Getting a Change Request

Page 51: OSLC-CM connector in SD

Change Request <oslc_cm:ChangeRequest rdf:about="http://192.168.56.101:8282/bugz/changerequest?id=24">

<dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string”> New Bug: installation </dcterms:title> <dcterms:created rdf:datatype=“http://www.w3.org/2001 XMLSchema#dateTime”> 2012-04-22T16:16:00Z </dcterms:created> <dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string”> 24 </dcterms:identifier>

</oslc_cm:ChangeRequest>

Cassiopee 2012 OSLC-CM connector in SD

Change Request RDF/XML

Page 52: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

OSLC connector in SD

Simple Defects (SD) SD Connectors Introduction to OSLC-CM Development goal Net-OSLC-CM Perl Module OSLC connector in SD q  Using and testing q  Making-up

Page 53: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

my @results = $oslccm−>changeRequests;

Result gained from Net::OSLC::CM

Page 54: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

my @results = $oslccm−>changeRequests;

Result gained from Net::OSLC::CM

List of tickets in SD

Page 55: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Using and testing

Simple Defects (SD) SD connectors Introduction to OSLC-CM Development goal Net-OSLC-CM Perl Module OSLC connector in SD Using and testing q  Making-up

Page 56: OSLC-CM connector in SD

Test environment

Cassiopee 2012 OSLC-CM connector in SD

Host

SD Bugzilla

Adaptator OSLC-CM Service Provider

Adaptator OSLC-CM Consumer

Page 57: OSLC-CM connector in SD

Test environment

Cassiopee 2012 OSLC-CM connector in SD

Host

Debian virtual machine

SD Bugzilla

Adaptator OSLC-CM Service Provider

Adaptator OSLC-CM Consumer

Page 58: OSLC-CM connector in SD

Test environment

Cassiopee 2012 OSLC-CM connector in SD

Host

Debian virtual machine

Vboxnet network interface between host and guest (//local network)

SD Bugzilla

Adaptator OSLC-CM Service Provider

Adaptator OSLC-CM Consumer

Page 59: OSLC-CM connector in SD

Demonstration

Cassiopee 2012 OSLC-CM connector in SD

Page 60: OSLC-CM connector in SD

Testing Net::OSLC::CM

q  With Test::More

q  Testing Net::OSLC::CM classes

01-connection.t 02-get-provider-catalog-resources.t 03-get-service-providers.t 04-get-change-requests.t

Cassiopee 2012 OSLC-CM connector in SD

Page 61: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Making-up

Simple Defects (SD) SD connectors Introduction to OSLC-CM Development goal Net-OSLC-CM Perl Module OSLC connector in SD Using and testing Making-up

Page 62: OSLC-CM connector in SD

Cassiopee 2012 OSLC-CM connector in SD

Commits in Net-OSLC-CM

Page 63: OSLC-CM connector in SD

Next development steps

q  Implementing the Push part in Net::OSLC::CM with a serializer RDF/XML

q  Implementing PushEncoder.pm in SD

q  Completing the implementation of the specs

q  Refactoring Net::OSLC::CM ü  RDF data are extensible – so is the Prophet database ü  Data OSLC/ Net OSLC

Cassiopee 2012 OSLC-CM connector in SD

Page 64: OSLC-CM connector in SD

What I learned

Cassiopee 2012 OSLC-CM connector in SD

q  Perl 5 and OO Perl with Moose

q  Creation of a Perl module

q  Tests with Test::More

q  Specifications OSLC-CM v2

q  Searching through RDF data and performing SPARQL queries

Page 65: OSLC-CM connector in SD

Links

Cassiopee 2012 OSLC-CM connector in SD

q  Source code http://github.com/arroway/Net-OSLC-CM (Perl licence) http://github/com/arroway/SD (Best Practicals Solutions)

q  Documentation

http://arroway.github.com/Net-OSLC-CM q  SD

http://syncwith.us

q  OSLC http://open-services.net