Let Azure DevOps review GitHub pull request











up vote
1
down vote

favorite












https://azurecomcdn.azureedge.net/cvt-15581a490a8fb478b3258ea2c0ebb74bfa82fabce2af64ffc38962598949b138/images/page/services/devops/pipelines/github-integrations.jpg



My code repo was in GitHub and my pipelines are configured in Azure DevOps.



I need to let Azure DevOps check and filter every pull request submitted to my GitHub repo and limit the pull request to be merged unless it passes Azure DevOps build. It seems that Azure DevOps do support that. But there was no document or tutorial about it. How to achieve that?










share|improve this question




























    up vote
    1
    down vote

    favorite












    https://azurecomcdn.azureedge.net/cvt-15581a490a8fb478b3258ea2c0ebb74bfa82fabce2af64ffc38962598949b138/images/page/services/devops/pipelines/github-integrations.jpg



    My code repo was in GitHub and my pipelines are configured in Azure DevOps.



    I need to let Azure DevOps check and filter every pull request submitted to my GitHub repo and limit the pull request to be merged unless it passes Azure DevOps build. It seems that Azure DevOps do support that. But there was no document or tutorial about it. How to achieve that?










    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      https://azurecomcdn.azureedge.net/cvt-15581a490a8fb478b3258ea2c0ebb74bfa82fabce2af64ffc38962598949b138/images/page/services/devops/pipelines/github-integrations.jpg



      My code repo was in GitHub and my pipelines are configured in Azure DevOps.



      I need to let Azure DevOps check and filter every pull request submitted to my GitHub repo and limit the pull request to be merged unless it passes Azure DevOps build. It seems that Azure DevOps do support that. But there was no document or tutorial about it. How to achieve that?










      share|improve this question















      https://azurecomcdn.azureedge.net/cvt-15581a490a8fb478b3258ea2c0ebb74bfa82fabce2af64ffc38962598949b138/images/page/services/devops/pipelines/github-integrations.jpg



      My code repo was in GitHub and my pipelines are configured in Azure DevOps.



      I need to let Azure DevOps check and filter every pull request submitted to my GitHub repo and limit the pull request to be merged unless it passes Azure DevOps build. It seems that Azure DevOps do support that. But there was no document or tutorial about it. How to achieve that?







      azure github azure-devops devops






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 at 5:49

























      asked Nov 20 at 3:22









      Anduin

      335




      335
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          You'll need to define a build validation policy for you branches (taken from Improve code quality with branch policies > Build Validation:





          • Select the build definition from the Build definition drop-down.

          • Choose the type of Trigger - either Automatic (whenever the source branch is updated) or Manual.

          • Configure the Policy requirement. If set to Required, builds must complete successfully in order to complete pull requests. Choose Optional to provide a notification of the build failure but still allow pull requests to complete.

          • Set a build expiration to make sure that updates to your protected branch don't break changes in open pull requests.



            • Immediately when branch name is updated: This option sets the build policy status in a pull request to failed when the protected branch is updated. You must requeue a build to refresh the build status. This setting ensures that the changes in pull requests build successfully even as the protected branch changes. This option is best for teams that have important branches with a lower volume of changes. Teams working in busy development branches may find it disruptive to wait for a build to complete every time the protected branch is updated.


            • After n hours if branch name has been updated: This option expires the current policy status when the protected branch updates if the passing build is older than the threshold entered. This option is a compromise between always requiring a build when the protected branch updates and never requiring one. This choice is excellent for reducing the number of builds when your protected branch has frequent updates.


            • Never: Updates to the protected branch do not change the policy status. This reduces the number of builds for your branch, but can cause problems when closing pull requests that haven't been updated recently.



          • Choose an optional Display name for this build policy which is used to identify the policy on the Branch policies page. If you don't specify a display name, the build definition name is used.




          Once the configuration is complete, a pull request from GitHub should trigger a build in Azure DevOps.



          Hope it helps!






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53385751%2flet-azure-devops-review-github-pull-request%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote



            accepted










            You'll need to define a build validation policy for you branches (taken from Improve code quality with branch policies > Build Validation:





            • Select the build definition from the Build definition drop-down.

            • Choose the type of Trigger - either Automatic (whenever the source branch is updated) or Manual.

            • Configure the Policy requirement. If set to Required, builds must complete successfully in order to complete pull requests. Choose Optional to provide a notification of the build failure but still allow pull requests to complete.

            • Set a build expiration to make sure that updates to your protected branch don't break changes in open pull requests.



              • Immediately when branch name is updated: This option sets the build policy status in a pull request to failed when the protected branch is updated. You must requeue a build to refresh the build status. This setting ensures that the changes in pull requests build successfully even as the protected branch changes. This option is best for teams that have important branches with a lower volume of changes. Teams working in busy development branches may find it disruptive to wait for a build to complete every time the protected branch is updated.


              • After n hours if branch name has been updated: This option expires the current policy status when the protected branch updates if the passing build is older than the threshold entered. This option is a compromise between always requiring a build when the protected branch updates and never requiring one. This choice is excellent for reducing the number of builds when your protected branch has frequent updates.


              • Never: Updates to the protected branch do not change the policy status. This reduces the number of builds for your branch, but can cause problems when closing pull requests that haven't been updated recently.



            • Choose an optional Display name for this build policy which is used to identify the policy on the Branch policies page. If you don't specify a display name, the build definition name is used.




            Once the configuration is complete, a pull request from GitHub should trigger a build in Azure DevOps.



            Hope it helps!






            share|improve this answer

























              up vote
              2
              down vote



              accepted










              You'll need to define a build validation policy for you branches (taken from Improve code quality with branch policies > Build Validation:





              • Select the build definition from the Build definition drop-down.

              • Choose the type of Trigger - either Automatic (whenever the source branch is updated) or Manual.

              • Configure the Policy requirement. If set to Required, builds must complete successfully in order to complete pull requests. Choose Optional to provide a notification of the build failure but still allow pull requests to complete.

              • Set a build expiration to make sure that updates to your protected branch don't break changes in open pull requests.



                • Immediately when branch name is updated: This option sets the build policy status in a pull request to failed when the protected branch is updated. You must requeue a build to refresh the build status. This setting ensures that the changes in pull requests build successfully even as the protected branch changes. This option is best for teams that have important branches with a lower volume of changes. Teams working in busy development branches may find it disruptive to wait for a build to complete every time the protected branch is updated.


                • After n hours if branch name has been updated: This option expires the current policy status when the protected branch updates if the passing build is older than the threshold entered. This option is a compromise between always requiring a build when the protected branch updates and never requiring one. This choice is excellent for reducing the number of builds when your protected branch has frequent updates.


                • Never: Updates to the protected branch do not change the policy status. This reduces the number of builds for your branch, but can cause problems when closing pull requests that haven't been updated recently.



              • Choose an optional Display name for this build policy which is used to identify the policy on the Branch policies page. If you don't specify a display name, the build definition name is used.




              Once the configuration is complete, a pull request from GitHub should trigger a build in Azure DevOps.



              Hope it helps!






              share|improve this answer























                up vote
                2
                down vote



                accepted







                up vote
                2
                down vote



                accepted






                You'll need to define a build validation policy for you branches (taken from Improve code quality with branch policies > Build Validation:





                • Select the build definition from the Build definition drop-down.

                • Choose the type of Trigger - either Automatic (whenever the source branch is updated) or Manual.

                • Configure the Policy requirement. If set to Required, builds must complete successfully in order to complete pull requests. Choose Optional to provide a notification of the build failure but still allow pull requests to complete.

                • Set a build expiration to make sure that updates to your protected branch don't break changes in open pull requests.



                  • Immediately when branch name is updated: This option sets the build policy status in a pull request to failed when the protected branch is updated. You must requeue a build to refresh the build status. This setting ensures that the changes in pull requests build successfully even as the protected branch changes. This option is best for teams that have important branches with a lower volume of changes. Teams working in busy development branches may find it disruptive to wait for a build to complete every time the protected branch is updated.


                  • After n hours if branch name has been updated: This option expires the current policy status when the protected branch updates if the passing build is older than the threshold entered. This option is a compromise between always requiring a build when the protected branch updates and never requiring one. This choice is excellent for reducing the number of builds when your protected branch has frequent updates.


                  • Never: Updates to the protected branch do not change the policy status. This reduces the number of builds for your branch, but can cause problems when closing pull requests that haven't been updated recently.



                • Choose an optional Display name for this build policy which is used to identify the policy on the Branch policies page. If you don't specify a display name, the build definition name is used.




                Once the configuration is complete, a pull request from GitHub should trigger a build in Azure DevOps.



                Hope it helps!






                share|improve this answer












                You'll need to define a build validation policy for you branches (taken from Improve code quality with branch policies > Build Validation:





                • Select the build definition from the Build definition drop-down.

                • Choose the type of Trigger - either Automatic (whenever the source branch is updated) or Manual.

                • Configure the Policy requirement. If set to Required, builds must complete successfully in order to complete pull requests. Choose Optional to provide a notification of the build failure but still allow pull requests to complete.

                • Set a build expiration to make sure that updates to your protected branch don't break changes in open pull requests.



                  • Immediately when branch name is updated: This option sets the build policy status in a pull request to failed when the protected branch is updated. You must requeue a build to refresh the build status. This setting ensures that the changes in pull requests build successfully even as the protected branch changes. This option is best for teams that have important branches with a lower volume of changes. Teams working in busy development branches may find it disruptive to wait for a build to complete every time the protected branch is updated.


                  • After n hours if branch name has been updated: This option expires the current policy status when the protected branch updates if the passing build is older than the threshold entered. This option is a compromise between always requiring a build when the protected branch updates and never requiring one. This choice is excellent for reducing the number of builds when your protected branch has frequent updates.


                  • Never: Updates to the protected branch do not change the policy status. This reduces the number of builds for your branch, but can cause problems when closing pull requests that haven't been updated recently.



                • Choose an optional Display name for this build policy which is used to identify the policy on the Branch policies page. If you don't specify a display name, the build definition name is used.




                Once the configuration is complete, a pull request from GitHub should trigger a build in Azure DevOps.



                Hope it helps!







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 20 at 5:42









                Itay Podhajcer

                1,192312




                1,192312






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53385751%2flet-azure-devops-review-github-pull-request%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Costa Masnaga

                    Fotorealismo

                    Sidney Franklin