Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(3143): skip jobs between stage setup and startFrom stage job only if they belong to the same stage #3166

Conversation

ThehamzaIftikhar
Copy link
Contributor

Context

The isStartFromMiddleOfStage function does not check if the startFrom job and the stage setup belong to the same stage

Objective

the function will check that both the current job and startFrom belong to the same stage if the ortrigger is to be executed for this scenario

References

#3143

License

I confirm that this contribution is made under a BSD license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@coveralls
Copy link

coveralls commented Aug 7, 2024

Coverage Status

coverage: 95.255% (+0.002%) from 95.253%
when pulling ce7fa2c on hiftikhar01_feat_3413_trigger_the_startFrom_job_after_stage_setup_if_event_started_from_middle_of_stage
into c0560d6 on master.

@ThehamzaIftikhar ThehamzaIftikhar changed the title isStartFromMiddleOfStage checks if the startFrom job and the stage setup belong to the same stage feat(3143): isStartFromMiddleOfStage checks if the startFrom job and the stage setup belong to the same stage Aug 7, 2024
@ThehamzaIftikhar ThehamzaIftikhar changed the title feat(3143): isStartFromMiddleOfStage checks if the startFrom job and the stage setup belong to the same stage fix(3413): skip jobs between stage setup and startFrom stage job only if they belong to the same stage Aug 7, 2024
Copy link
Member

@sagar1312 sagar1312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a test to cover the scenario where event.startFrom is from a different stage that the stage of the current job (stage setup)

package.json Show resolved Hide resolved
plugins/builds/triggers/helpers.js Outdated Show resolved Hide resolved
plugins/builds/triggers/helpers.js Outdated Show resolved Hide resolved
return isStageSetup(triggerJob) && !isStageSetup(startFrom) && isStageJob(workflowGraph, startFrom);
if (isStageSetup(triggerJob)) {
const startFromStageName = getStageName(workflowGraph, triggerJob);
const triggerStageName = getStageName(workflowGraph, triggerJob);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const triggerStageName = getStageName(workflowGraph, triggerJob);
const currentStageName = getStageName(workflowGraph, currentJobName);

…ame stage for the startFrom job to be executed right after the current job
@ThehamzaIftikhar ThehamzaIftikhar changed the title fix(3413): skip jobs between stage setup and startFrom stage job only if they belong to the same stage fix(3143): skip jobs between stage setup and startFrom stage job only if they belong to the same stage Aug 8, 2024
@sagar1312 sagar1312 merged commit c3888a7 into master Aug 8, 2024
2 checks passed
@sagar1312 sagar1312 deleted the hiftikhar01_feat_3413_trigger_the_startFrom_job_after_stage_setup_if_event_started_from_middle_of_stage branch August 8, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants