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

Skip only if all changes does skip with passing unit tests. #7

Merged
merged 5 commits into from Nov 4, 2023

Conversation

worldjoe
Copy link

This is a cleanup of this pull request: #6
I didn't know how to push to that pull request. But feel free to close this and just incorporate there.

That pull request had 2 problems:

  1. The logic in SCMSkipTools.java for when to print out log messages about whether things were skipped was inverted.
  2. None of the unit tests passed.

Thanks to @jdeniau for the original code. I just made minor changes.
Fixes https://issues.jenkins-ci.org/browse/JENKINS-63918

  • 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

jdeniau and others added 2 commits November 5, 2020 13:54
Imagine the following commits messages

- [skip ci] skip this
- do not skip this

The build will be skipped, and the next commit will be like this :

- [skip ci] skip this
- do not skip this
- really do not skip

Se the build will be skipped and so on.

Fixes https://issues.jenkins-ci.org/browse/JENKINS-63918
for (Object entry : changeLogSet.getItems()) {
if (entry instanceof ChangeLogSet.Entry && inspectChangeSetEntry((Entry) entry, matcher)) {
matchedEntry = (Entry) entry;
} else {
allSkipped = false;
break;
Copy link

Choose a reason for hiding this comment

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

@worldjoe With this change, aren't you checking the first commit instead of the last?

Copy link

@lavor lavor Feb 3, 2022

Choose a reason for hiding this comment

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

@debugmaster I looked at it too, but I think it is correct.

The "if else" is not testing whether there is some (or more) ci skip. It is testing whether there is some commit WITHOUT ci skip. If there is any, the allSkipped is set to false and the loop does not need to continue.

I think we don't want to skip build if there is some commit without ci skip.

BTW: matchedEntry is not used anymore, so matchedEntry = (Entry) entry; can be removed (and if condition inverted if it will be more readable).

Choose a reason for hiding this comment

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

I see. If all commits match the pattern, then skip run. Otherwise, don't skip.

@SunHuawei
Copy link

SunHuawei commented Jun 15, 2022

This can solve my issue, but I noticed that this is a PR submited 2 years ago, anyone can help merge this and release it?

@wwuck
Copy link

wwuck commented Oct 27, 2022

Hi @plavc 👋 😄

Are you still working on this plugin? Any chance you would have time to take a look at this?

@plavc
Copy link

plavc commented Oct 27, 2022

I did some refactoring that should resolve the issue above, but I didn't have time to finish.
I will take a look and prepare a new release in the following days.
@wwuck

@wwuck
Copy link

wwuck commented Nov 25, 2022

Hi @plavc 😄
Did you have a chance to look at the refactoring?

@worldjoe
Copy link
Author

worldjoe commented Jul 11, 2023

@plavc @debugmaster are you looking for new maintainers?
I added a change, below, to address the feedback that @debugmaster gave since @plavc's refactoring hasn't materialized.

worldjoe and others added 3 commits July 11, 2023 08:56
@NotMyFault NotMyFault requested a review from a team as a code owner November 4, 2023 16:33
@NotMyFault NotMyFault added the enhancement New feature or request label Nov 4, 2023
@NotMyFault
Copy link
Member

Thanks!

@NotMyFault NotMyFault merged commit 8b539e9 into jenkinsci:develop Nov 4, 2023
16 checks passed
@zbynek zbynek mentioned this pull request Mar 13, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
8 participants