Introduction
When multiple builds run in parallel, sometimes you want to keep only the latest one and stop older ones. The milestone step in Jenkins helps control this by marking points in the pipeline where older builds can be discarded to avoid wasted work.
When you have frequent code changes and want to avoid running outdated builds that started earlier.
When multiple developers push code quickly and you want to keep the pipeline focused on the newest changes.
When running long pipelines and you want to save resources by canceling older builds that are no longer relevant.
When you want to ensure only one build passes a certain point before others proceed.
When you want to prevent race conditions by controlling concurrency in your pipeline.