18
SAPUI5 Continuous Integration Peter Muessig, SAP SE January, 2017 Confidential

SAPUI5/OpenUI5 - Continuous Integration

Embed Size (px)

Citation preview

Page 1: SAPUI5/OpenUI5 - Continuous Integration

SAPUI5

Continuous IntegrationPeter Muessig, SAP SEJanuary, 2017

Confidential

Page 2: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 2© 2017 SAP SE or an SAP affiliate company. All rights reserved. 2Public

KPIs

Some figures from SAPUI5:

1 Build Cluster45 build slaves (classic virtual machines / some real)

2.200.000 Lines of JavaScript Code78% Code Coverage (82,52 MB of JavaScript code)

1.200 QUnit / OPA Tests17.000 checks in total (per OS/Browser combination)

30 (up to 100!) integrations per day for OpenUI5150 people contributing to OpenUI5 / SAPUI5 Core & Runtime

5 parallel nightly builds6 hours per nightly build, test and deployment

Page 3: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 3© 2017 SAP SE or an SAP affiliate company. All rights reserved. 3Public

What is Continuous Integration?

“Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. “

- Martin Fowler, ThoughtWorks

Page 4: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 4© 2017 SAP SE or an SAP affiliate company. All rights reserved. 4Public

Continuous Integration Workflow @ SAPUI5

DeveloperPrepares and uploadsa change/commit

CodeReview & Verify

IntegrateBuild

Test Deploy

Build ServerVerifies the changewith code checks,functional andintegration tests

Build ServerRuns a nightly build andexecutes the full verificationprocess.

DeveloperSubmits the changeonce verified and reviewed by anotherdeveloper.

Build ServerValidates the changeswith application and visual tests.

Build ServerDeploys the validatedbuild result into allplatforms.

DeveloperDoes a 4-eyes reviewof the change

1 hour 6 hours

Page 5: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 5© 2017 SAP SE or an SAP affiliate company. All rights reserved. 5Public

Key Concepts (by Martin Fowler)

The 9 pillars of Continuous Integration are: Maintain a source code repository

Automate the build

Make your build self testing

Every commit should build before integration

Keep the build fast Test in a clone of the production environment

Make it easy to get the latest deliverables

Everyone can see what’s happening Automate the deployment

Code

Build

Test

Deploy

Page 6: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 6© 2017 SAP SE or an SAP affiliate company. All rights reserved. 6Public

Pillar #1: Maintain a source code repository

Source code is maintained in:

Git/Gerrit (fulfills SAP product standards)• SAPUI5 has been moved to Git/Gerrit (5yrs ago)

to use the voter & review process. • Nowadays also GitHub is supported but the

migration effort is too high and advantages are too minimal.

Multiple Git repositories• SAPUI5 code base is splitted into the

OpenUI5, SAPUI5 Core & Runtime, Inner Source and SAPUI5 Distribution.

OpenUI5 is mirrored to GitHub• Established a Git/Gerrit to GitHub mirroring to

publish changes incl. contribution process.

OpenUI5

SAPUI5 Core & Runtime

Inner Source

SAPUI5 Distribution

Contributor #1 Contributor #2

Page 7: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 7© 2017 SAP SE or an SAP affiliate company. All rights reserved. 7Public

Pillar #2: Automate the build

The build is…

…based on Apache Maven• Best or breed development & build tool 8 years

ago with a strong dependency management which became the standard build tool inside SAP being certified to create customer releases

• SAPUI5 implemented several plugins to support a JavaScript build, test and deployment with Maven for UI5 libraries and UI5 components (e.g. minification, preloads, bundling, theme builds, lightening, …)

…automated with Jenkins• Executes scheduled Maven/Node builds

…advancing to NodeJS (Grunt)• OpenUI5 development & build tools are based on

Grunt• Modernization of SAPUI5 build tooling to a pure

Node tooling incl. customer availability is in progress

Page 8: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 8© 2017 SAP SE or an SAP affiliate company. All rights reserved. 8Public

Pillar #3: Make your build self testing

The build executes…

…static code checks• Platform constraints checks to verify proper

file encoding of source files, avoid internals, …

• ESLint checks to identify typical issues and to ensure a proper coding guideline

…functional and integration test• QUnit function tests to validate a fully

functional framework and controls functionality on feature level

• OPA integration tests to verify the framework and controls functionality in application scenarios

Page 9: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 9© 2017 SAP SE or an SAP affiliate company. All rights reserved. 9Public

Pillar #4: Every commit should build before integration

The commits/changes are…

…uploaded to Git/Gerrit• Every new feature must provide a QUnit test• Bug fixes must include a check via a QUnit

test …verified with a Jenkins voter build

• Commit messages are validated• Platform checks, static code checks are

executed• QUnit tests and OPA tests are executed via

Selenium with PhantomJS on Jetty server …reviewed by another SAPUI5

developer• Each commit requires a 4-eyes review to

finally submit the change into the central codeline

• Enforced by Git/Gerrit process

Page 10: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 10© 2017 SAP SE or an SAP affiliate company. All rights reserved. 10Public

Pillar #5: Keep the build fast

Build performance is key but tough!

Voter builds are running for 1 hour• Full build of the deliverables• Tests on a reduced set of OS/browser

combination

Nightly builds are running for 6 hours• Exclusive build machines (one per version)• Tests on each supported OS/browser

combination• Runs Bitmap Comparison Tests• Executes Performance Tests• Triggers Security Code Scans• Runs Open Source Software Scans• Uploads i18n texts

Developers Wishlist:

1.I want a fast build!

Page 11: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 11© 2017 SAP SE or an SAP affiliate company. All rights reserved. 11Public

Pillar #6: Test in a clone of the production environment

Integration tests are…

…executing real application tests• Implemented as OPA/QUnit tests• Contributed by application

development …running on several OS

…running in several browsers

…relevant to decide whether a version can be deployed or not

Page 12: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 12© 2017 SAP SE or an SAP affiliate company. All rights reserved. 12Public

Pillar #7: Make it easy to get the latest deliverables

The build artifacts are…

…deployed to central Maven repository• SAP hosts a Nexus server which acts as a proxy

for external Maven repositories and is used to manage the SAP artifacts

• The build results are uploaded to Nexus after a successful nightly build

…available in several versions• SNAPSHOTs are updated on daily basis• Releases are stable (uploaded once)

…available in various formats• Static deployable, Java deployable, …

Page 13: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 13© 2017 SAP SE or an SAP affiliate company. All rights reserved. 13Public

Pillar #8: Everyone can see what’s happening

Processes are transparent:

Maven builds are reproducible everywhere• Developers can run the Maven build and test

execution locally at any time (same as central)

Sonar reporting• ESLint violations• QUnit test success rate • Code coverage percentage

Jenkins reporting• Access to build logs• Mail notification when breaking the build• QUnit test checks

(incl. screenshot for errors)• Code coverage results

Page 14: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 14© 2017 SAP SE or an SAP affiliate company. All rights reserved. 14Public

Pillar #9: Automate the deployment

Build results will be deployed to:

Tomcat Sandboxes

NetWeaver ABAP

SAP HANA Cloud Platform

NetWeaver Java

SAP HANA XS Classic and Advanced

Page 15: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 15© 2017 SAP SE or an SAP affiliate company. All rights reserved. 15Public

Continuous Integration for Customers

Material & Tutorials:

OpenUI5 Preload Toolinghttps://blogs.sap.com/2015/02/18/optimizing-openui5-apps/

CI for SAPUI5/SAP Fiori on ABAP Front-End Serverhttp://www.sap.com/developer/tutorials/ci-best-practices-fiori-abap.html

Page 16: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 16© 2017 SAP SE or an SAP affiliate company. All rights reserved. 16Public

Questions?

Thank You…

Page 17: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 17© 2017 SAP SE or an SAP affiliate company. All rights reserved. 17Public

© 2017 SAP SE or an SAP affiliate company. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional trademark information and notices.

Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.

National product specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP SE or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.

In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.

Page 18: SAPUI5/OpenUI5 - Continuous Integration

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 18© 2017 SAP SE or an SAP affiliate company. All rights reserved. 18Public

© 2017 SAP SE oder ein SAP-Konzernunternehmen. Alle Rechte vorbehalten.

Weitergabe und Vervielfältigung dieser Publikation oder von Teilen daraus sind, zu welchem Zweck und in welcher Form auch immer, ohne die ausdrückliche schriftliche Genehmigung durch SAP SE oder ein SAP-Konzernunternehmen nicht gestattet.

SAP und andere in diesem Dokument erwähnte Produkte und Dienstleistungen von SAP sowie die dazugehörigen Logos sind Marken oder eingetragene Marken der SAP SE (oder von einem SAP-Konzernunternehmen) in Deutschland und verschiedenen anderen Ländern weltweit. Weitere Hinweise und Informationen zum Markenrecht finden Sie unter http://global.sap.com/corporate-de/legal/copyright/index.epx.

Die von SAP SE oder deren Vertriebsfirmen angebotenen Softwareprodukte können Softwarekomponenten auch anderer Softwarehersteller enthalten.

Produkte können länderspezifische Unterschiede aufweisen.

Die vorliegenden Unterlagen werden von der SAP SE oder einem SAP-Konzernunternehmen bereitgestellt und dienen ausschließlich zu Informationszwecken. Die SAP SE oder ihre Konzernunternehmen übernehmen keinerlei Haftung oder Gewährleistung für Fehler oder Unvollständigkeiten in dieser Publikation. Die SAP SE oder ein SAP-Konzernunternehmen steht lediglich für Produkte und Dienstleistungen nach der Maßgabe ein, die in der Vereinbarung über die jeweiligen Produkte und Dienstleistungen ausdrücklich geregelt ist. Keine der hierin enthaltenen Informationen ist als zusätzliche Garantie zu interpretieren.

Insbesondere sind die SAP SE oder ihre Konzernunternehmen in keiner Weise verpflichtet, in dieser Publikation oder einer zugehörigen Präsentation dargestellte Geschäftsabläufe zu verfolgen oder hierin wiedergegebene Funktionen zu entwickeln oder zu veröffentlichen. Diese Publikation oder eine zugehörige Präsentation, die Strategie und etwaige künftige Entwicklungen, Produkte und/oder Plattformen der SAP SE oder ihrer Konzernunternehmen können von der SAP SE oder ihren Konzernunternehmen jederzeit und ohne Angabe von Gründen unangekündigt geändert werden. Die in dieser Publikation enthaltenen Informationen stellen keine Zusage, kein Versprechen und keine rechtliche Verpflichtung zur Lieferung von Material, Code oder Funktionen dar. Sämtliche vorausschauenden Aussagen unterliegen unterschiedlichen Risiken und Unsicherheiten, durch die die tatsächlichen Ergebnisse von den Erwartungen abweichen können. Die vorausschauenden Aussagen geben die Sicht zu dem Zeitpunkt wieder, zu dem sie getätigt wurden. Dem Leser wird empfohlen, diesen Aussagen kein übertriebenes Vertrauen zu schenken und sich bei Kaufentscheidungen nicht auf sie zu stützen.