Git Coaching Session Number 1 - Collab Coaching Session • Git & Code Governance –Friends or...
Transcript of Git Coaching Session Number 1 - Collab Coaching Session • Git & Code Governance –Friends or...
1 Copyright ©2013 CollabNet, Inc. All Rights Reserved.ENTERPRISE CLOUD DEVELOPMENT
Git & Code Governance – Friends or Foes? Coaching Session 1
Laurence Sweeney, VP Enterprise Transformation
Kevin Hancock, Sr. Director Field Operations
CollabNet, April 16, 2013blogs.collab.net
twitter.com/collabnet
www.facebook.com/CollabNetHQ
www.linkedin.com/company/collabnet-inc
2 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Git Coaching Session
• Git & Code Governance – Friends or Foes? April/16
• IBM Rational ClearCase – The Journey to Git May/02
• Git and Subversion – Replace or Integrate? May/14
3 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Laurence Sweeney, VP Enterprise Transformation, CollabNet
Laurence Sweeney has over 25 years of software development
experience in a variety of roles. Prior to joining CollabNet, his role as Director of Software at Hewlett Packard encompassed acquiring, deploying and managing multiple Agile ALM platforms for tens of
thousands of developers and managers in dozens of divisions.
Kevin Hancock, Senior Director Field Operations, CollabNet
In his ten plus years at CollabNet, Kevin has led the successful
implementation of CollabNet products and services at some of its largest customers. Working with his clients to transform their globally distributed application development teams to modern agile
enterprises, he has saved these organizations millions of dollars.
Today’s Presenters
4 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Agenda
• Enterprise Git – what you need to know
• Common pitfalls – security, governance, compliance
• History protection – the ‘undo’ for Git
5 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
• Distributed version control system (DVCS)
• Every Git working directory is full repository w/ history
• Not dependent of network, or central server
• Optimized for speed:
– No network latency
– ‘Shared-nothing’ design
– Powerful, quick
branching and merging
Git in Nutshell
6 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Git has arrived in the enterprise
Almost 60% had organizations with more than 100 developers and 1000 employees
• Amongst all organizations, 5% use Git only, 19% use Git + Others• Amongst ‘Git using’ organizations, 23% standardize on Git
• 40% of ‘Git using’ organizations are $1b and above• 58% of ‘Git using’ organizations have 100+ developers• 58% of ‘Git using’ organizations have 1000+ employees
8 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
What developers love about Git
People love Git for its powerful branching and merging capabilities and solid network performance.
• 65% of ‘Git using’ organizations like ‘powerful branching & merging’ (and 57% like this the most)• 57% of ‘Git using’ organizations like ‘network performance’ (and 22% like this the most)• 32% of ‘Git using’ organizations like ‘Git’s popularity’ (and 10% like this the most)
11 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Enterprises continue to have reservations about Git
Anybody (Git using orgs): • 37% Tool integration (trackers, CI/CD, …)• 36% Co-existence with other SCM tools• 33% Security, traceability, process governance• 16% 24/7 Support and SLA’s
Managers and Above (Git using orgs): • 51% Security, traceability, process governance• 49% Tool integration• 37% Co-existence with other SCM tools• 22% 24/7 Support and SLA’s
12 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Git History Rewrite – Defined
“We define History Rewrite as non-fast forward updates of remote
refs and its associated objects. This happens whenever a branch in
the remote repository gets deleted, previously pushed commits get
amended/tree filtered and forcefully re-pushed, or a remote
branch/tag is pointed to an entire different commit history.”
13 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Git History Rewrite – Functionality in Detail
Commit #1Initially files added
File A added
Commit #2More files added
File B Added
Commit #3Files modified
File A modified
Commit #4Files Deleted
File A Delete
Change log Change log after
History Re-Write
Commit #1Initially files added
File A added
Commit #5More files added
File X added
Commit #1Initially files added
File A added
Commit #2More files added
File B Added
Commit #3Files modified
File A modified
Commit #4Files Deleted
File A Delete
Local git commit(s)
• No traces about deleted
changes (commits &
metadata associated, files,
directories)
• Periodic garbage collection
will remove unreferenced
commits soon and
afterwards they can no
longer be recovered
LocalGit Repo
git clone
Developer
Commit #1Initially files added
File A added
Commit #2More files added
Commit #3Files modified
Commit #4Files Deleted
Developer
Removes some
files either
by purpose or
accidentally
BlessedGit Repo
git push –f origin master
Commit #1Initially files added
File A added
Commit #5More files added
File X added
14 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Single space may wipe entire history:
– Update: git push origin production-quick-fix:stable
– Wipe: git push origin production-quick-fix :stable
No traces left behind:
– No alerts
– No recovery (unless noticed quickly, via administrators)
Happens even to the experts:
– https://bugs.eclipse.org/bugs/show_bug.cgi?id=361707
– Eclipse Foundation lost almost all their branches
and tags of platform-ui repo accidentally, garbage collection
pruned unreferenced commits, backup was misconfigured,
restoration done with help of local repositories and
developer cooperation
Git History Rewrite – This Can Happen to You, Too!
15 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
It needs to be supplemented with a tool(s) that:
• Adds path-level read and write access
• “Freezes” commits
• Protects users from some of their dumb mistakes (e.g., history
preservation)
What can be done about security with Git?
16 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Introducing Git History Protection
Commit #1Initially files added
File A added
Commit #2More files added
File B Added
Commit #3Files modified
File A modified
Commit #4Files Deleted
File A Delete
Change log Change log after
History Re-Write
Commit #1Initially files added
File A added
Commit #5More files added
File X added
Commit #1Initially files added
File A added
Commit #2More files added
File B Added
Commit #3Files modified
File A modified
Commit #4Files Deleted
File A Delete
Local git commit(s)
LocalGit Repo
git clone
Developer
Commit #1Initially files added
File A added
Commit #2More files added
Commit #3Files modified
Commit #4Files Deleted
Developer
Removes some
files either
by purpose or
accidentally
BlessedGit Repo
git push –f origin master
Commit #1Initially files added
File A added
Commit #5More files added
File X added
TeamForge
History Protect
Detects
Rewrite Event
git push –f origin master
1. Notification: Automatic e-mail
to administrators
2. Reporting: Temper-proof audit-
trail (who, what, when)
3. Recovery: Self-service
resurrection of history rewrite
TeamForge automatically secures history snapshots on ‘blessed’ master repository (under
“refs/rewrite” or “refs/deleted”), for auditing & recovery.
17 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
• The days of silo development have long passed with the
advent of:
– ALM (Application Lifecycle Management)
– DevOps
• Must include logical points of integration:
– Code review
– Build management
• Must look to leverage centralized tools
What about tool integration?
18 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Why TeamForge for Enterprise Git – The Six Reasons
Git + Subversion – Integrate or Mitigate
Tool Integration – Application Lifecycle
Dev Productivity – Code Reviews & Discovery
History protection – “Un-do” Any Commit
Access Control – Protect Your IP
24/7 Support – Enterprise-Ready Git
19 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Stay Tuned - We’ll Continue at 10am PT / 1pm ET
• Git & Code Governance – Friends or Foes? April/16
• IBM Rational ClearCase – The Journey to Git May/02
• Git and Subversion – Replace or Integrate? May/14
20 Copyright ©2013 CollabNet, Inc. All Rights Reserved.ENTERPRISE CLOUD DEVELOPMENT
Git & Code Governance – Friends or Foes? Coaching Session 1 (Technical Session)
Laurence Sweeney, VP Enterprise Transformation
Kevin Hancock, Sr. Director Field Operations
CollabNet, April 16, 2013blogs.collab.net
twitter.com/collabnet
www.facebook.com/CollabNetHQ
www.linkedin.com/company/collabnet-inc
21 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Configurable Application Lifecycle Management Platform
• Configurable and Selectable Tool Templates for ALM, Collaboration, & Community
22 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
� Protection
� Code Quality
� Control
� IT standard compliance
� ALM integration
� Hybrid SCM
� Advanced Git security
� Git Projects organization
� Code-review
� Replication
TeamForge = Enterprise-Grade Git Mgmt. + ALM
� Basic SCM features
� jGit engine
� Native engine
� GitWeb
Gerrit
With TeamForge and Gerrit, Git is now ready for the enterprise. Realize all the
benefits of Git, without compromising governance, security and compliance.
23 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Central Control. Enterprise-grade security & compliance.
� Protection from errors and malicious acts
� Code Quality assurance with code reviews
� Control who can access what, and how
� IT Standard compliance: upgrades and 24/7 support
� ALM Integration across lifecycle, tools & clouds
� Hybrid SCM – manage Git and Subversion side-by-side
Why TeamForge with Gerrit
Learn more at:
http://www.collab.net/products/teamforge/git-for-the-enterprise
24 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Manage Git and Subversion with One Enterprise Platform
25 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Git History Protection
Commit #1Initially files added
File A added
Commit #2More files added
File B Added
Commit #3Files modified
File A modified
Commit #4Files Deleted
File A Delete
Change log Change log after
History Re-Write
Commit #1Initially files added
File A added
Commit #5More files added
File X added
Commit #1Initially files added
File A added
Commit #2More files added
File B Added
Commit #3Files modified
File A modified
Commit #4Files Deleted
File A Delete
Local git commit(s)
LocalGit Repo
git clone
Developer
Commit #1Initially files added
File A added
Commit #2More files added
Commit #3Files modified
Commit #4Files Deleted
Developer
Removes some
files either
by purpose or
accidentally
BlessedGit Repo
git push –f origin master
Commit #1Initially files added
File A added
Commit #5More files added
File X added
TeamForge
History Protect
Detects
Rewrite Event
git push –f origin master
1. Notification: Automatic e-mail
to administrators
2. Reporting: Temper-proof audit-
trail (who, what, when)
3. Recovery: Self-service
resurrection of history rewrite
TeamForge automatically secures history snapshots on ‘blessed’ master repository (under
“refs/rewrite” or “refs/deleted”), for auditing & recovery.
26 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Git History Protection – Alerting
1. Notification: Automatic e-mail
to administrators
2. Reporting: Temper-proof
audit-trail (who, what, when)
3. Recovery: Self-service
resurrection of history rewrite
Whenever history gets ‘re-written’, an email gets sent out to
‘Gerrit Administrators’ containing details about old HEAD of
branch and new HEAD after ‘re-write’.
27 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Git History Protection – Reporting (Audit Log)
Audit Log containing all
History Rewrite Events is
accessible through
TeamForge Web UI
Audit Log containing all
History Rewrite Events is
accessible through
TeamForge Web UI
1. Notification: Automatic e-mail
to administrators
2. Reporting: Temper-proof
audit-trail (who, what, when)
3. Recovery: Self-service
resurrection of history rewrite
28 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Git History Protection – Reporting (Web UI)
1. Notification: Automatic e-mail
to administrators
2. Reporting: Temper-proof
audit-trail (who, what, when)
3. Recovery: Self-service
resurrection of history rewrite
29 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Git History Protection – Reporting (Eclipse)
1. Notification: Automatic e-mail
to administrators
2. Reporting: Temper-proof
audit-trail (who, what, when)
3. Recovery: Self-service
resurrection of history rewrite
30 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Git History Protection – Recovery (Web UI)
1. Notification: Automatic e-mail
to administrators
2. Reporting: Temper-proof
audit-trail (who, what, when)
3. Recovery: Self-service
resurrection of history rewrite
31 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Git History Protection – Recovery (Command Line)
1Run this command on git
command line
2Copy HEAD SHA1 of branch
created after history ’re-write’
3
Use copied SHA1 to create new
local branch in Git
Push this local branch to remote
‘blessed reposiotry’
Fetch SHA1 of rewritten history
from server
4
5
1. Notification: Automatic e-mail
to administrators
2. Reporting: Temper-proof
audit-trail (who, what, when)
3. Recovery: Self-service
resurrection of history rewrite
32 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Git History Protection – Administration
Gerrit Config-Option allows you to protect all Git repositories hosted by TeamForge: Not even TeamForge Site
Admins can override
<Preview: TeamForge 7.0 UI (planned)>
33 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Control Code Review Workflows directly in TeamForge 6.2+
34 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Using Gerrit and Jenkins together
master
CI Build: OKCI Build: OK
A1local
master
Verified: -1
(build failed)
Verified: +1
(build OK)
refs/for/masterC2
push
C2
C2*
C2*
push
Reviewed: +2
C2*A1
35 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
Why TeamForge for Enterprise Git – The Six Reasons
Git + Subversion – Integrate or Mitigate
Tool Integration – Application Lifecycle
Dev Productivity – Code Reviews & Discovery
History protection – “Un-do” Any Commit
Access Control – Protect Your IP
24/7 Support – Enterprise-Ready Git
36 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
3-Minute Video on History Protectionhttp://www.collab.net/products/teamforge/git-for-the-enterprise
Software Downloads (TeamForge, Git + clients)http://www.collab.net/git
Git Blogshttp://blogs.collab.net/git
Learn More
37 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
CollabNet, the ‘One-Stop-Shop’ for Enterprise Git
Learn more at www.collab.net/git
38 Copyright ©2013 CollabNet, Inc. All Rights Reserved.38 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
About CollabNet
CollabNet is a leading provider of Enterprise Cloud Development and Agile ALM products and services for
software-driven organizations. With more than 10,000 global customers, the company provides a suite of
platforms and services to address three major trends disrupting the software industry: Agile, DevOps and hybrid
cloud development. Its CloudForge™ development-Platform-as-a-Service (dPaaS) enables cloud development
through a flexible platform that is team friendly, enterprise ready and integrated to support leading third party
tools. The CollabNet TeamForge® ALM, ScrumWorks® Pro project management and Subversion Edge source code
management platforms can be deployed separately or together, in the cloud or on-premise. CollabNet
complements its technical offerings with industry leading consulting and training services for Agile and cloud
development transformations. Many CollabNet customers improve productivity by as much as 70 percent, while
reducing costs by 80 percent.
For more information, please visit www.collab.net.
39 Copyright ©2013 CollabNet, Inc. All Rights Reserved.39 Copyright ©2013 CollabNet, Inc. All Rights Reserved.
© 2013 CollabNet, Inc., All rights reserved. CollabNet is a
trademark or registered trademark of CollabNet Inc., in the US
and other countries. All other trademarks, brand names, or
product names belong to their respective holders.
CollabNet, Inc.
8000 Marina Blvd., Suite 600
Brisbane, CA 94005
www.collab.net
+1-650-228-2500
+1-888-778-9793
blogs.collab.net
twitter.com/collabnet
www.facebook.com/collabnet
www.linkedin.com/company/collabnet-inc