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

Do not build draft MRs #396

Merged
merged 1 commit into from
Feb 9, 2024
Merged

Conversation

basilevs
Copy link
Contributor

@basilevs basilevs commented Feb 3, 2024

Respect "Ignore builds for Work In Progress MRs" job property during project rescan.

Before the change:
"Ignore builds for Work In Progress MRs" job property was respected while handling Gitlab events, but was ignored during project scan.

After the change:
"Ignore builds for Work In Progress MRs" job property is always respected (no Draft MRs are built if property is set).

Fixes #384.

Caveat
The job property is hidden in "Webhook Listener Conditions" behavior and is already applied when handling webhooks, but from usability point of view the discrepancy in behavior for hook and scan handling is a bug.

Testing done

Submitter checklist

@basilevs basilevs changed the title Do not build draft MRs. Fixes #384 Do not build draft MRs (#384) Feb 3, 2024
@basilevs basilevs marked this pull request as ready for review February 3, 2024 18:33
@jetersen jetersen changed the title Do not build draft MRs (#384) Do not build draft MRs Feb 9, 2024
@jetersen jetersen merged commit aa4df93 into jenkinsci:master Feb 9, 2024
15 checks passed
@jetersen jetersen added the enhancement New feature or request label Feb 9, 2024
@basilevs basilevs deleted the fix/no-drafts branch February 9, 2024 07:02
request.setGitLabApi(gitLabApi);
request.setProject(gitlabProject);
request.setMembers(getMembers());
if (request.isFetchBranches()) {
request.setBranches(gitLabApi.getRepositoryApi().getBranches(gitlabProject));
}
Predicate<MergeRequest> filter = ignore -> false;
Copy link
Contributor

Choose a reason for hiding this comment

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

The default should be true, otherwise all mr`s are filtered out or when alwaysIgnoreMRWorkInProgress is not set or?

Copy link
Member

Choose a reason for hiding this comment

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

Yes it should 🤕🪦

Copy link
Contributor

Choose a reason for hiding this comment

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

I will provide a pr

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
Development

Successfully merging this pull request may close these issues.

Ignore draft merge requests during rescan
3 participants