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

[JENKINS-73960] Extract event handlers in BuildCardExtension/buildCardTemplate.jelly #142

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

shlomomdahan
Copy link

@shlomomdahan shlomomdahan commented Oct 23, 2024

JENKINS-73960

Testing done


Line 64

Setup Instructions: Jenkins Build Pipeline

1. Create Two Freestyle Projects:

  • Upstream and Downstream

2. Configure the Upstream Project:

  • In the Build section, add an Execute Shell build step with the following script:
    sleep 20
  • In the Post-build Actions section, select Build other projects and specify Downstream in the Projects to build field.

3. Create a Build Pipeline View:

  • Go to the Jenkins dashboard and click New View.
  • Choose Build Pipeline View and configure it with the default settings.

4. Run the Pipeline:

  • Navigate to the new pipeline view and click the Run button to start the upstream build.

5. Check the Progress:

  • Click on the progress bar while the build is running.
  • This should correctly open a modal window displaying the console output of the upstream build.

Line 97

Same as above +

1. Add Parameterized Values

  • Configure upstream -> Check the box "This project is Parameterized"
  • Add a boolean parameter

Line 109

Same as above +

  1. Create a new freestyle project named downstream2
  2. Add it as another downstream project in upstream post-build actions
  3. After successful builds, look for the play icon next to console icon on bottom right corner of the card.
    Screenshot 2024-10-29 at 3 58 17 PM
  4. Click it to verify:
    • Progress spinner appears
    • Build triggered with correct dependency IDs for both downstream projects

Line 118

Same as above +

  1. In Pipeline View configuration, check the box "Restrict triggers to most recent successful builds"
  2. Go to either downstream project and set execute shell to exit 1 to trigger a failure
  3. This will reveal the retry button
    Screenshot 2024-10-29 at 4 55 49 PM

Line 125

  1. Create a new downstream3 freestyle project
  2. In upstream, add the below settings to allow manual builds in the pipeline.
  3. When you run upstream, this one will not run unless manually specified.
  4. This required a change to the isManualTrigger in ProjectUtil.java
    Screenshot 2024-10-30 at 1 55 39 PM

Line 129

Same as above +

  1. Upstream project should build a downstream project
  2. In the downstream, add a build step with exit 1 so the build fails.
  3. Run the pipeline and wait for failure. Retry button will appear

Screenshot 2024-10-29 at 9 57 26 PM


Line 140

  1. Create new freestyle project downstream 3
  2. in the upstream project, add the downstream3 as a manual build step
    Screenshot 2024-10-29 at 9 49 00 PM
  3. In Pipeline configuration, use the below settings:
    Screenshot 2024-10-29 at 9 47 52 PM

Line 145

Same as line 140 but use below settings for Pipeline View Configuration

Screenshot 2024-10-29 at 9 50 38 PM


Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@shlomomdahan shlomomdahan changed the title [JENKINS-73960] [JENKINS-73960] Extract event handlers in BuildCardExtension/buildCardTemplate.jelly Oct 23, 2024
@shlomomdahan shlomomdahan marked this pull request as ready for review October 30, 2024 18:04
@shlomomdahan shlomomdahan requested a review from a team as a code owner October 30, 2024 18:04
Copy link

@yaroslavafenkin yaroslavafenkin left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants