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

Draft: Introducing Build Position as a Condition - Seeking Guidance and Collaboration #93

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

Conversation

nurgul212
Copy link
Contributor

@nurgul212 nurgul212 commented Oct 26, 2023

Description

This pull request introduces a draft version of the Build Position as a condition feature to the Build History manager plugin.
This new functionality aims to provide users with greater control over build execution based on the position in the build history.

Changes

  1. Added a new class: BuildPositionCondition.java

    • this class represents the condition that checks if a build's position meets the specific criteria
  2. Modified existing classes to accommodate the new feature

    • In the BuildHistoryManager.java class, a counter was introduced to keep track of the build position.
    • Added a buildPosition parameter to the validateConditions() method in the Rule.java class to pass the build position to conditions.

Here is a screenshot of Build Position as displayed in the Jenkins UI:
image

Testing

Conducted one integration test to ensure the new feature works as expected.

Related Issues

This pull request can address the issue #89.

Ongoing Development & Request for Guidance and Collaboration

This draft version is a starting point, I intend to continue developing and refining this feature based on the feedback. I kindly ask for your guidance and suggestions. Your knowledge and insights would be really helpful in making this new addition work well.

THANK YOU!!!

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

Nurgul Amat added 20 commits September 12, 2023 14:38
- The 'buildPosition' variable is used to track the position of each build as we iterate through completed builds
…java

- Update method calls and logic to include 'buildPosition' in condition validation
…ion sub-classes

- I have added these overloaded matches method for buildPosition default value as -1, which was not a correct way, so I had to remove them.
@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Merging #93 (6f01959) into master (0250b4c) will decrease coverage by 2.46%.
Report is 5 commits behind head on master.
The diff coverage is 57.14%.

@@             Coverage Diff              @@
##             master      #93      +/-   ##
============================================
- Coverage     99.12%   96.66%   -2.46%     
- Complexity      123      125       +2     
============================================
  Files            27       29       +2     
  Lines           229      240      +11     
  Branches         18       18              
============================================
+ Hits            227      232       +5     
- Misses            1        7       +6     
  Partials          1        1              
Files Coverage Δ
...nkins/buildhistorymanager/BuildHistoryManager.java 100.00% <100.00%> (ø)
...s/conditions/BuildPositionConditionDescriptor.java 100.00% <100.00%> (ø)
...epanik/jenkins/buildhistorymanager/model/Rule.java 100.00% <100.00%> (ø)
...nager/model/conditions/BuildAgeRangeCondition.java 100.00% <ø> (ø)
...er/model/conditions/BuildNumberRangeCondition.java 100.00% <ø> (ø)
...manager/model/conditions/BuildResultCondition.java 100.00% <ø> (ø)
...istorymanager/model/conditions/CauseCondition.java 100.00% <ø> (ø)
...uildhistorymanager/model/conditions/Condition.java 100.00% <ø> (ø)
...ger/model/conditions/MatchEveryBuildCondition.java 100.00% <ø> (ø)
...ymanager/model/conditions/TokenMacroCondition.java 100.00% <ø> (ø)
... and 1 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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.

1 participant