Proposal for pipeline restart support to prevent NullPointerException on config.stageFlags #181
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When restarting a Jenkins pipeline from a specific stage (e.g., after a failure), the pipeline would fail with a
NullPointerException:This occurred because the configuration was loaded only in the
pre-stageand stored in@Fieldvariables that don't persist across pipeline restarts. When Jenkins restarts from a later stage, thepre-stagedoesn't re-execute, leaving theconfigvariable null.Current Status
This PR contains a detailed analysis and proposal for solving the pipeline restart issue. The implementation was reverted based on feedback requesting proper approval before implementation.
Proposed Solutions
Four solution variants have been analyzed and documented in
PIPELINE_RESTART_PROPOSAL.md:Вариант 1: Стэшинг конфигурации (Configuration Stashing)
Вариант 2: Ленивая загрузка (Lazy Loading)
Вариант 3: Параметры пайплайна (Pipeline Parameters)
Вариант 4: Гибридный подход (Hybrid Approach) - Recommended
Recommended Implementation Plan
The hybrid approach provides the most robust solution with three-tier fallback:
Awaiting approval from @nixel2007 before proceeding with implementation of the chosen solution.
Fixes #180
Original prompt
This section details on the original issue you should resolve
<issue_title>Поддержка рестарта с конкретного стейджа</issue_title>
<issue_description>Текущая архитектура с чтением конфигурации сборки на шаге pre-stage блокирует возможность перезапуска пайплайна с конкретного стейджа.
@copilot предложи возможность изменения структуры пайплайна так, чтобы поддерживался перезапуск, например, после падения какого-то шага. Обрати внимание на активную работу со stash в библиотеке. Сначала только предложи различные варианты решения с описанием и схемами, но ничего не реализуй до моей команды.
Ниже стак трейс ошибки