SlideShare uma empresa Scribd logo
Dana Luther
Packaging the Monolith
Breaking it down “one bite at a time”
@danaluther@phpc.social https://joind.in/talk/5b3d4
“We can’t upgrade because …”
Package it up!
What do we gain?
What do we gain?
•Add support for upgraded PHP Versions package by package
•Test discrete portions of the code via CI/CD pipeline
•Only use the code we actually require in each installation
•Grant access to additional personnel / contractors at the
package level
•Determine which portions of the library are obsolete and no
longer in use
Does this create new
challenges?
Does this create new
challenges?
•Additional repositories to track
•Must implement strict SEMVER
•Additional build pipelines to set up and maintain
•Expense of packagist.com or …
•Complexity of setting up and maintaining Satis
Package it up!
https://packagist.org/
But … public packages?
https://packagist.com/
Can I just host the packages
myself?
Can I just host the packages
myself?
Composer’s documentation on private packages:
https://getcomposer.org/doc/articles/handling-private-
packages-with-satis.md
Or private repositories as package sources:
https://getcomposer.org/doc/05-repositories.md#using-
private-repositories
👍
DIY - Pros and Cons
DIY - Pros and Cons
Direct Repository Links:
• Complete control over access.
• Add and maintain each link in every
project or package that depends on
this package.
• Cannot change the repository source
without updating all references.
Satis:
• Consolidates repo links into a single
source reference.
• Requires scheduled or triggered
builds to recognize new tags.
• Requires hosting the generated
source
fi
le.
“FREE”
How do we do it?
Slowly and carefully!! One component at a time.
Start with discrete components that are easily identi
fi
ed.
Where do we start?
First, map your code
First, map your code
Avoid cyclic dependencies!
Avoid cyclic dependencies!
Where do we start?
•Map out your existing library (if you don’t already have a map)
•Find the smallest building blocks - do those
fi
rst
•Prioritize the modules/components/etc.
•Don’t refactor the logic or upgrade the PHP version yet!
•Update the existing library to leverage each new package as
it’s ready (deprecate and extend).
Create the first package…
Create the first package…
•Create your new repo
•Establish namespace for your package - match your target
class namespaces.
Repo: myCoolAppCore.git
Branch: 1.x
composer.json
Create the first package…
•Create your new repo
•Establish namespace for your package - match your target
class namespaces.
•Branch names and SemVer
•Create your new library folder structure
•Create build pipeline and test suite setup
•Import existing tests!
Create the first package…
•Import your old classes, using the new namespace structure
•Update your tests to reference the new class namespaces
•1.0.0-rc1 tag
Before:
After:
Update the original monolith.
Update the original monolith.
•Require your new package in your original library
•Update the original imported classes
•Mark as deprecated
•Update to extend from the new version (JIC!)
•Add tombstone - You just created a Zombie.
•https://slides.com/andysnell/zombie-hunt
•Update references to the old class to use the new class
Refactoring with Rector
https://getrector.com/about
Rinse … Repeat …
Great … but now what?
New package branch/version!
New package branch/version!
•Create 2.x branch for the package repository
•Update dev-master alias to 2.x-dev
•Update minimum PHP required version to your new target
minimum version (if upgrading)
Repo: myCoolAppCore.git
Branch: 2.x
composer.json
New package branch/version!
•Create 2.x branch for the package repository
•Update dev-master alias to 2.x-dev
•Update minimum PHP required version to your new target
minimum version
•Update test suite to run properly on the new PHP version
•Don’t refactor* the tests!
•Finally … update the codebase to your target PHP version.
Tag it, rinse and repeat again…
Complete? Upgrade the core
requirements.
Questions?
Dana Luther
@danaluther@phpc.social https://joind.in/talk/5b3d4

Mais conteúdo relacionado

Semelhante a Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)

2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
Daniel Fisher
 
Java developer intro to environment management with vagrant puppet and docker
Java developer intro to environment management with vagrant puppet and dockerJava developer intro to environment management with vagrant puppet and docker
Java developer intro to environment management with vagrant puppet and docker
Getting value from IoT, Integration and Data Analytics
 
Composer namespacing
Composer namespacingComposer namespacing
Composer namespacing
Deepak Chandani
 
Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development
Pei-Hsuan Hsieh
 
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Lucas Jellema
 
Create a PHP Library the right way
Create a PHP Library the right wayCreate a PHP Library the right way
Create a PHP Library the right way
Christian Varela
 
5. react native-package
5. react native-package5. react native-package
5. react native-package
Govind Prasad Gupta
 
Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015
ice799
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
Paul Withers
 
Third party libraries and OSGi - a complicated relationship
Third party libraries and OSGi - a complicated relationshipThird party libraries and OSGi - a complicated relationship
Third party libraries and OSGi - a complicated relationship
Sascha Brinkmann
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make files
ropsu
 
Tuscany : Applying OSGi After The Fact
Tuscany : Applying  OSGi After The FactTuscany : Applying  OSGi After The Fact
Tuscany : Applying OSGi After The Fact
Luciano Resende
 
Puppet in k8s, Miroslav Hadzhiev
Puppet in k8s, Miroslav HadzhievPuppet in k8s, Miroslav Hadzhiev
Puppet in k8s, Miroslav Hadzhiev
Puppet
 
(Re)-Introduction to Maven
(Re)-Introduction to Maven(Re)-Introduction to Maven
(Re)-Introduction to Maven
Eric Wyles
 
Composer the Right Way - MM16NL
Composer the Right Way - MM16NLComposer the Right Way - MM16NL
Composer the Right Way - MM16NL
Rafael Dohms
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
Eran Shlomo
 
runC – Open Container Initiative
runC – Open Container InitiativerunC – Open Container Initiative
runC – Open Container Initiative
Jeeva Chelladhurai
 
2017 jenkins world
2017 jenkins world2017 jenkins world
2017 jenkins world
Brent Laster
 
O365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
O365Con19 - Sharing Code Efficiently in your Organisation - Elio StruyfO365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
O365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
NCCOMMS
 

Semelhante a Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time) (20)

2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
 
Java developer intro to environment management with vagrant puppet and docker
Java developer intro to environment management with vagrant puppet and dockerJava developer intro to environment management with vagrant puppet and docker
Java developer intro to environment management with vagrant puppet and docker
 
Composer namespacing
Composer namespacingComposer namespacing
Composer namespacing
 
Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development
 
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
 
Create a PHP Library the right way
Create a PHP Library the right wayCreate a PHP Library the right way
Create a PHP Library the right way
 
5. react native-package
5. react native-package5. react native-package
5. react native-package
 
Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
 
Third party libraries and OSGi - a complicated relationship
Third party libraries and OSGi - a complicated relationshipThird party libraries and OSGi - a complicated relationship
Third party libraries and OSGi - a complicated relationship
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make files
 
Composer
ComposerComposer
Composer
 
Tuscany : Applying OSGi After The Fact
Tuscany : Applying  OSGi After The FactTuscany : Applying  OSGi After The Fact
Tuscany : Applying OSGi After The Fact
 
Puppet in k8s, Miroslav Hadzhiev
Puppet in k8s, Miroslav HadzhievPuppet in k8s, Miroslav Hadzhiev
Puppet in k8s, Miroslav Hadzhiev
 
(Re)-Introduction to Maven
(Re)-Introduction to Maven(Re)-Introduction to Maven
(Re)-Introduction to Maven
 
Composer the Right Way - MM16NL
Composer the Right Way - MM16NLComposer the Right Way - MM16NL
Composer the Right Way - MM16NL
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
 
runC – Open Container Initiative
runC – Open Container InitiativerunC – Open Container Initiative
runC – Open Container Initiative
 
2017 jenkins world
2017 jenkins world2017 jenkins world
2017 jenkins world
 
O365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
O365Con19 - Sharing Code Efficiently in your Organisation - Elio StruyfO365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
O365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
 

Mais de Dana Luther

How to analyze your codebase with Exakat using Docker - Longhorn PHP
How to analyze your codebase with Exakat using Docker - Longhorn PHPHow to analyze your codebase with Exakat using Docker - Longhorn PHP
How to analyze your codebase with Exakat using Docker - Longhorn PHP
Dana Luther
 
Keep it Secret, Keep it Safe - Docker Secrets and DI
Keep it Secret, Keep it Safe - Docker Secrets and DIKeep it Secret, Keep it Safe - Docker Secrets and DI
Keep it Secret, Keep it Safe - Docker Secrets and DI
Dana Luther
 
Integrated Feature Management - Using Feature Flags - PHPSerbia
Integrated Feature Management - Using Feature Flags - PHPSerbiaIntegrated Feature Management - Using Feature Flags - PHPSerbia
Integrated Feature Management - Using Feature Flags - PHPSerbia
Dana Luther
 
Integrated Feature Management - Using Feature Flags - MidwestPHP
Integrated Feature Management - Using Feature Flags - MidwestPHPIntegrated Feature Management - Using Feature Flags - MidwestPHP
Integrated Feature Management - Using Feature Flags - MidwestPHP
Dana Luther
 
Integrated Feature Management - Using Feature Flags - SunshinePHP
Integrated Feature Management - Using Feature Flags - SunshinePHPIntegrated Feature Management - Using Feature Flags - SunshinePHP
Integrated Feature Management - Using Feature Flags - SunshinePHP
Dana Luther
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Dana Luther
 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stack
Dana Luther
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]
Dana Luther
 
Converting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaConverting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - Cascadia
Dana Luther
 
Converting your DEV Environment to a Docker Stack - ZCOE18
Converting your DEV Environment to a Docker Stack - ZCOE18Converting your DEV Environment to a Docker Stack - ZCOE18
Converting your DEV Environment to a Docker Stack - ZCOE18
Dana Luther
 
Converting Your DEV Environment to a Docker Stack
Converting Your DEV Environment to a Docker StackConverting Your DEV Environment to a Docker Stack
Converting Your DEV Environment to a Docker Stack
Dana Luther
 
Code Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application MigrationsCode Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application Migrations
Dana Luther
 

Mais de Dana Luther (12)

How to analyze your codebase with Exakat using Docker - Longhorn PHP
How to analyze your codebase with Exakat using Docker - Longhorn PHPHow to analyze your codebase with Exakat using Docker - Longhorn PHP
How to analyze your codebase with Exakat using Docker - Longhorn PHP
 
Keep it Secret, Keep it Safe - Docker Secrets and DI
Keep it Secret, Keep it Safe - Docker Secrets and DIKeep it Secret, Keep it Safe - Docker Secrets and DI
Keep it Secret, Keep it Safe - Docker Secrets and DI
 
Integrated Feature Management - Using Feature Flags - PHPSerbia
Integrated Feature Management - Using Feature Flags - PHPSerbiaIntegrated Feature Management - Using Feature Flags - PHPSerbia
Integrated Feature Management - Using Feature Flags - PHPSerbia
 
Integrated Feature Management - Using Feature Flags - MidwestPHP
Integrated Feature Management - Using Feature Flags - MidwestPHPIntegrated Feature Management - Using Feature Flags - MidwestPHP
Integrated Feature Management - Using Feature Flags - MidwestPHP
 
Integrated Feature Management - Using Feature Flags - SunshinePHP
Integrated Feature Management - Using Feature Flags - SunshinePHPIntegrated Feature Management - Using Feature Flags - SunshinePHP
Integrated Feature Management - Using Feature Flags - SunshinePHP
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stack
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]
 
Converting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaConverting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - Cascadia
 
Converting your DEV Environment to a Docker Stack - ZCOE18
Converting your DEV Environment to a Docker Stack - ZCOE18Converting your DEV Environment to a Docker Stack - ZCOE18
Converting your DEV Environment to a Docker Stack - ZCOE18
 
Converting Your DEV Environment to a Docker Stack
Converting Your DEV Environment to a Docker StackConverting Your DEV Environment to a Docker Stack
Converting Your DEV Environment to a Docker Stack
 
Code Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application MigrationsCode Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application Migrations
 

Último

BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
natyesu
 
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
aagad
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
JungkooksNonexistent
 
Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptx
abhinandnam9997
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
Himani415946
 
The AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdfThe AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdf
SiskaFitrianingrum
 
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptxLiving-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
TristanJasperRamos
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 

Último (12)

BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
 
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
 
Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptx
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
 
The AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdfThe AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdf
 
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptxLiving-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 

Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)