AL-Go icon indicating copy to clipboard operation
AL-Go copied to clipboard

Skip Pull Request check in draft mode

Open cegekaJG opened this issue 1 year ago • 5 comments

This PR adds a condition to "PullRequestHandler.yaml" that ensures pull requests in draft mode won't trigger the status check. This reduces unnecessary build workflows for feature branches. Additionally, the PR explicitly lists all types of the pull_request_target event. Listing the types isn't supposed to confirm each type as a valid reason to trigger the workflow, but rather to invite maintainers to judge which events can be ignored for this workflow. Resolves #1051

cegekaJG avatar Jul 03 '24 14:07 cegekaJG

https://github.com/microsoft/AL-Go/actions/runs/10140000167 Does the test fail because the templates are using microsoft/AL-Go@main as the template URL? Running the tests locally doesn't result in an error.

cegekaJG avatar Aug 26 '24 07:08 cegekaJG

https://github.com/microsoft/AL-Go/actions/runs/10140000167 Does the test fail because the templates are using microsoft/AL-Go@main as the template URL? Running the tests locally doesn't result in an error.

The error is because the PullRequestHandler needs to be identical in the AppSource App template folder and in the Per Tenant Extension folder.

Your PR only contains changes to the PTE folder.

freddydk avatar Aug 26 '24 08:08 freddydk

I think the PR makes sense. Being able to avoid builds while working on a PR in draft mode, can save a lot of minutes while you don't want them.

Big question is whether it should be possible to run builds on draft mode? with this PR, I guess it is always blocked?

freddydk avatar Aug 26 '24 09:08 freddydk

I do agree there needs to be a way to allow for the pipeline to run in draft mode. We could either run the workflow partially and exit as soon as possible, or supplement Update-Workflow with the ability to append or remove the draft condition.

cegekaJG avatar Aug 26 '24 10:08 cegekaJG

there needs to be a way to allow for the pipeline to run in draft mode. We could either run the workflow partially and exit as soon as possible, or supplement Update-Workflow with the ability to append or remove the draft condition.

We could also create a setting called runPullRequestBuildOnDraftPR and default it to false? Then most people wouldn't change that unless they really want this.

freddydk avatar Aug 26 '24 10:08 freddydk

Closing this Pull Request for now since it's been stale for a while. In order to merge this PR, we would want this behavior to be configurable as mentioned in https://github.com/microsoft/AL-Go/pull/1132#issuecomment-2309879010

The feature suggestion #1051 is still in our backlog so the suggestion is not forgotten just because the PR will be closed now :)

aholstrup1 avatar Jan 07 '25 10:01 aholstrup1