Skip to content

Feature: Option to report success to PR when build is not triggered#632

Open
MaitreyaBuddha wants to merge 7 commits intojenkinsci:masterfrom
Leanplum:master
Open

Feature: Option to report success to PR when build is not triggered#632
MaitreyaBuddha wants to merge 7 commits intojenkinsci:masterfrom
Leanplum:master

Conversation

@MaitreyaBuddha
Copy link
Copy Markdown

This is a resolution for #630

This introduces a new checkbox after include/exclude sections. It gives you the ability to report GHCommitState.SUCCESS status with "Skipped..." message when a build is skipped because it didn't match any include/exclude patterns.

For example, if you have 4 builds but only Java files changed, you might get this output:
image

The title of this PR should work for CHANGELOG entry.

Copy link
Copy Markdown
Contributor

@bjoernhaeuser bjoernhaeuser left a comment

Choose a reason for hiding this comment

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

Thank you very much for your contribution!

}
}

public void createCommitStatus(GHCommitState state, String message) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hm, shouldnt that method already exist somewhere else?

}
}

public void createCommitStatus(Job<?, ?> project,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah I see the problem. So basically you cannot call this method.

Should this method be extracted and moved to a common place or is there no abstraction level which makes sense for both callers?

I personally feel its a bit edgy that the interface now has the createCommitStatus method.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

You're right, it is out of place there the way it is. I wanted to make an easy implementation of GhprbPullRequest.createCommitStatus(GHCommitState state, String message) for future developers, but maybe that's not necessary.
I could create GhprbCommitStatus.onBuildSkipped that would make more sense for GhprbCommitStatus being an event interface. But also, the only other implementor is GhprbNoCommitStatus and completely unused. I could remove the interface, remove GhprbNoCommitStatus, and then it doesn't seem as edgy.

I thought that level of refactor might be out of scope, but I'm open to it. Of these options I am in favor of removing the unused classes & abstraction. Which direction would you prefer?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry for the late response. I think the best option is to remove the unused classes & abstraction.

Do you have an Idea in your head how this could look like in the end?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Just pushed it. It was relatively concise and simple. It exposed to me that there's another class GhprbSimpleStatusDescriptor which is completely unused, but I left that as it is not in scope of this change.

bjoernhaeuser
bjoernhaeuser previously approved these changes Apr 28, 2018
@bjoernhaeuser
Copy link
Copy Markdown
Contributor

@samrocketman I this is fine for you I would go ahead and merge this and test the current master with the other PRs which are "candidate to merge" and are approved by either me or you. Is this fine for you?

@samrocketman
Copy link
Copy Markdown
Member

@bjoernhaeuser you're welcome to go ahead; I haven't had a chance to look at it but if you feel it's good to merge I don't have any problem with it.

@MaitreyaBuddha
Copy link
Copy Markdown
Author

Sorry for the noise, we prematurely merged unrelated work to our fork's master. It has been reverted and this is back to the latest relevant changes.

@bjoernhaeuser
Copy link
Copy Markdown
Contributor

@MaitreyaBuddha could you squash your commits into one? :)

@MaitreyaBuddha
Copy link
Copy Markdown
Author

@bjoernhaeuser Done! Github also has an option to do that when merging if you have not disabled it in settings.

@bjoernhaeuser
Copy link
Copy Markdown
Contributor

@MaitreyaBuddha would be cool if you can rebase to latest master to retrigger the jenkins build itself. For whatever reason it failed :(

@MaitreyaBuddha
Copy link
Copy Markdown
Author

@bjoernhaeuser Rebased and passed 💥

@samrocketman
Copy link
Copy Markdown
Member

We're planning to release this upcoming Monday and won't be merging any additional changes until after Monday's release (Apr 4th).

@miguelslemos
Copy link
Copy Markdown

miguelslemos commented Oct 25, 2018

Any update on this issue?

@samrocketman
Copy link
Copy Markdown
Member

This change can’t be merged or tested without passing checks.

Refactored out a create commit status function.
Added option to report success if not pertinent.
@MaitreyaBuddha
Copy link
Copy Markdown
Author

Rebased to master to trigger build again. Looks g2g?

@samrocketman
Copy link
Copy Markdown
Member

I'll look it over again.

bjoernhaeuser
bjoernhaeuser previously approved these changes Jan 13, 2019
@bjoernhaeuser
Copy link
Copy Markdown
Contributor

@samrocketman IMHO we can merge this :)

@MaitreyaBuddha
Copy link
Copy Markdown
Author

I had to create another fork and PR to trigger build again: #739

@bjoernhaeuser
Copy link
Copy Markdown
Contributor

@samrocketman also with this, can we merge it?

@mmpetarpeshev
Copy link
Copy Markdown

Can we merge this and release new version ?

Show PR author's login if the name is empty.
@asif-anwar
Copy link
Copy Markdown

Any update on this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment