Dependency
Management in
a Complex World
September 28, 2022
Roberto Perez Alcolea
Senior Software Engineer @ Net
fl
ix
JVM Ecosystem Team
rperezalcolea@net
fl
ix.com
@rpalcolea
Dependency Management in a Complex World
Life of a
developer
Dependency Management in a Complex World
Dependency Management in a Complex World
Tuesday Afternoon
Dependency Management in a Complex World
Wednesday
Morning
Dependency Management in a Complex World
Dependency Management in a Complex World
Are we in
dependency hell?
Dependency Management in a Complex World
Most likely, yes!
🔥😱 🔥😱 🔥😱
Dependency Management in a Complex World
This is just one
project… what if…
Dependency Management in a Complex World
Your dependency graph looks like this
Dependency Management in a Complex World
— Multi/Many repositories setup
(~3k)
— Binary integration (JARs)
— Microservices with fat clients
— Hundreds/Thousands of
Engineers
— Thousands of builds per day
— Thousands of artifacts generated
per day
Dependency Management in a Complex World
Dependency Management in a Complex World
How to keep up with all these changes?
Build often, release often!
Dependency Management in a Complex World
Yes, but this comes with
some costs 💸 💸
Common
Problems
in dependency
Management
(That we have seen)
Dependency Management in a Complex World
Compatibility issues
— 2 components depending on the
same module but with different,
incompatible, APIs
— Multiple libraries providing the same
feature (logger APIs)
— Dealing with incompatible versions
of a runtime (e.g: Scala 2.11 vs
Scala 2.12)
— Misaligned dependencies of a
component (e.g: Jackson Databind
2.9.0 with Jackson Core 2.9.4)
— Intentional and unintentional
Breaking API changes in libraries
— Java version
Dependency Management in a Complex World
Build / Dependency graph Hygiene
— Build does not declares the
dependencies it needs
— Build declares dependencies that
doesn’t need
Dependency Management in a Complex World
Publishers lack visibility
— Who uses my library?
— Who will I break if I release a
change?
— Who is exercising/using a
particular method I want to
deprecate and/or replace?
Dependency Management in a Complex World
Semver is not enough
— Which version should I use?
— Pinning versions is technical debt
— In a dynamic environment where
projects get changes constantly,
moving them between majors can
be challenging
Dependency Management in a Complex World
Constant change
— How can we migrate a project
from dependency A to B?
— Can it be done only by
dependency management
machinery rules?
— Do we need to ship code changes
also?
— Can we do this on behalf of the
users?
Dependency Management in a Complex World
Security Vulnerabilities
— Prevent projects from using a
given version of a dependency
— Reject a particular module from
the dependency graph
— Let users know that they might be
in danger
Dependency Management in a Complex World
Ownership
When my project is broken…
— Who owns the module/library
breaking my project?
— How can I contact them?
— Is there a support channel to
reach out?
— Can I open an incident directly
with them?
Dependency Management in a Complex World
Are there any
solutions?
Dependency Management in a Complex World
Dependency Management in a Complex World
Sure, there are 😃😃!
Dependency Management in a Complex World
Dependency Resolution
— Resolution Rules Plugin
— Resolution Rules
— Gradle Plugins with
Resolution Strategies
— Gradle Module Metadata
Dependency Management in a Complex World
Build Hygiene
— Nebula Lint plugin
— Dependency Analysis
Gradle Plugin
Dependency Management in a Complex World
Who uses my library?
Collection of services and UIs
that enable artifact
observability and the ability to
effect change in the Netflix
ecosystem.
Astrid to the rescue ⛑!
Dependency Management in a Complex World
Who uses my library?
Dependency Management in a Complex World
Who uses my library?
Dependency Management in a Complex World
Who uses my library?
Dependency Management in a Complex World
But what about
security
vulnerabilities?
Dependency Management in a Complex World
CVE + Astrid + Nebula
Practical Approach to Automate the Discovery &
Eradication of Open-Source Software Vulnerabilities
Aladdin Almubayed | 2019 ▶
Dependency Management in a Complex World
Astrid Campaign
Dependency Management in a Complex World
And you said
constant change…
Dependency Management in a Complex World
Automated dependencies and
lint updates
Dependency Management in a Complex World
Automated dependencies and
lint updates
Dependency Management in a Complex World
Automated dependencies and
lint updates
Dependency Management in a Complex World
Managed Delivery
Dependency Management in a Complex World
Paved Path vs non-Paved Path (log4j edition)
~minutes-hour vs ~hours-days
Dependency Management in a Complex World
Paved Path vs non-Paved Path (log4j edition)
Dependency Management in a Complex World
Who owns this
library?
Dependency Management in a Complex World
Software Ownership
Dependency Management in a Complex World
Unfortunately, some of these
things are not OSS Today.
However there are OSS and
Enterprise options…
Dependency Management in a Complex World
Update dependencies
Security
Constant change
Code usage
Refactoring
Comby
Ownership
What’s next for
us?
Dependency Management in a Complex World
Publisher feedback
— When a new version of a library is
published, build all the consumers
and verify if the change breaks
them.
• This requires proper verification
steps on each project
— Use Sourcegraph Code Intelligence
capabilities to understand when a
modified/removed code is being
used by consumers or not
Dependency Management in a Complex World
Dependency Management in a Complex World
Distributed Refactoring
Dependency Management in a Complex World
Library changesets with
publications
Last thoughts…
— Dependency management is hard
— Dependency hell is inevitable, let’s
try to reduce the pain
— Build often, release often. Avoid
conflict resolution by limiting
version skew
— Producers and consumers play an
important role
— Moving projects from A to B is
hard but there are options out
there
Dependency Management in a Complex World
Questions?
Dependency Management in a Complex World
Thank
You.
Roberto Perez Alcolea
rperezalcolea@net
fl
ix.com

Dependency Management in a Complex World (JConf Chicago 2022)