bumpy-kitchen-92571
02/14/2025, 8:00 PMmain
• The main
resolve is very bloated
• When adding a new dependency or modifying source code that is a common dependency across many python_sources
, we are seeing pants test
run for 60min+ in github ci
◦ We've configured pants test
to run with --changed-dependents=transitive
in ci to test the full blast radius leaning on the side of caution
Strategy
• We could probably throw more money at ci but want to stop taking on tech debt and improve the design first
• Splitting up the main
resolve into many, smaller resolves with better written tests seems like an obvious strategy
• In practice that amount of work is daunting enough (3 yrs of debt) that it is not practical to prioritize above other work for our small team, so we need to do this incrementally
• If we use parametrize
to incrementally share code through dependencies
across resolves at the python_source
level in BUILD files:
◦ The expensive unit tests are still triggered whenever we touch common BUILD files or need to modify common python_sources
that are deep enough in the stack
◦ Unfortunately his happens often enough bc we have a large monorepo that is not practical until we finish streamlining things more
• Our latest idea is to incrementally publish smaller resolves to an internal pypi as standalone python_requirement
packages
◦ Once published to internal repo, we can link packaged python_distribution
's upstream as python_requirements
whenever we need to share code
◦ This strategy should buy us the time to incrementally refactor our tangled up code base by:
▪︎ Trading a small one-time cost of new pypi infra
▪︎ For slightly more complexity in decoupling and then managing our python_source
deps outside of pants' automatic dep inference
◦ Once we take the time pressure off
▪︎ We can make a more careful reassessment of what deps should be inferred from the file system and which should not and adjust accordingly
Question to you
• Has anyone ever had to do something similar?
• Does our latest strategy make sense?
• Better yet are we missing something simple - maybe in a newer version of pants - that could help us solve the problem in a more elegant way?happy-kitchen-89482
02/15/2025, 2:14 AMbumpy-kitchen-92571
02/15/2025, 4:29 AMhappy-kitchen-89482
02/15/2025, 4:41 PMbumpy-kitchen-92571
02/16/2025, 2:00 AMhappy-kitchen-89482
02/16/2025, 4:01 AMhappy-kitchen-89482
02/16/2025, 4:01 AMbumpy-kitchen-92571
02/16/2025, 1:10 PMhappy-kitchen-89482
02/16/2025, 3:50 PMbumpy-kitchen-92571
02/16/2025, 8:34 PM—changed-dependents=transitive
? We like the flag as an additional safeguard to give very high confidence in our builds. Maybe we are abusing it?happy-kitchen-89482
02/17/2025, 3:31 AMbumpy-kitchen-92571
02/17/2025, 2:31 PMhappy-kitchen-89482
02/18/2025, 5:41 AMbumpy-kitchen-92571
02/18/2025, 6:46 PMhappy-kitchen-89482
02/19/2025, 2:04 AM