microsoft / appcenter

Central repository for App Center open source resources and planning.
https://appcenter.ms
Creative Commons Attribution 4.0 International
1.01k stars 225 forks source link

Build a Pull request and provide status #159

Open simonmcl opened 5 years ago

simonmcl commented 5 years ago

Describe the solution you'd like GitHub allows external services to provide a status for a branch, and for branches to require a status before they can be merged. A common development flow is to build all PR's and block them from merging until the build and/or tests pass. I would like to setup my AppCenter to build all PR's and block them from being merged into /develop or /master until builds and tests are passing. This will ensure stability of these branches and prevent damaging code from being merged in.

Describe alternatives you've considered Allow all merges into /develop and setup AppCenter to build "on push" for /develop. While this will alert us to issues in the /develop branch. One of the core principals of GitFlow is to ensure the /develop branch always has compilable code. This work around doesn't allow us to do that like other tools do.

Additional context The main image on this post shows an example of what it might look like: https://medium.com/@danpurdy0/automated-testing-and-status-reporting-to-github-enterprise-slack-from-atlassian-bamboo-c02328d7211c

simonmcl commented 5 years ago

@nrajpurkar any update? is this something that is likely to be picked up?

nilofer commented 5 years ago

@simonmcl thanks for this request. It is not on our current set of work, but we will continue to evaluate this as something to prioritize in the future. As a possible solution for apps coming from GitHub - connecting to App Center via the GitHub marketplace app allows for PR builds and status checks.

prollin commented 5 years ago

@nrajpurkar if we already have an appcenter account, is it possible to connect to the github app to it? It looks like our only option is to create a new account currently.

nilofer commented 5 years ago

@prollin you can connect the GitHub app to your existing App Center account, but not to existing apps

gfrileux commented 5 years ago

Hi, @nrajpurkar , are there any plans on getting this to work with Bitbucket repos ? Thanks !

nilofer commented 5 years ago

@vinoa-team, no plans as of now but definitely something we will track for the future.

harrisrobin commented 5 years ago

Please add my +1 to this, I would love to be able to trigger builds on PR. Bitrise does this but I prefer appcenter for other reasons.

mAiNiNfEcTiOn commented 5 years ago

I've started with AppCenter, but I definitely need a CI/CD system that allows me to do PR builds. Integrating with the Build Status API from BitBucket would be easy as a post-build process, but the support for building PRs is a lot more important.

@nrajpurkar I wonder if there's a way to, for example, create a build pipeline via the API. That way I'd be able to at least create a lambda triggered by one of the bitbucket hooks (pr created, pr updated, etc...) and with it create dynamically build pipelines based on the PR's branch.

mAiNiNfEcTiOn commented 5 years ago

It seems so...

That could be created either at branch creation or at pull request creation. If the latter, would imply that you need to trigger a build as well, which then you probably need to use the endpoint /v0.1/apps/{owner_name}/{app_name}/branches/{branch}/builds ( https://openapi.appcenter.ms/#/build/builds_create ) which allows you to trigger/create a build.

Funny things to handle are the uploads of certificates to the, and I quote, App Center File Upload Store. After that, this should be possible... no?

(Yes I know this is something that should be in the product and it is on their backlog, but I'm trying to find a temporary solution until the AppCenter team gets it done...)

dennispan commented 5 years ago

@mAiNiNfEcTiOn You can also leverage the cloneFromBranch option from the branch config API, which clones from an existing configuration. This will clone the certificates, etc.

fishercraigj commented 4 years ago

+1 on the build for PR's

cschembor-ww commented 4 years ago

Hi @nilofer , has there been any update regarding this? It would be great to have the ability for existing apps to create a build and run our tests when a PR is opened, for status checks.

fishercraigj commented 4 years ago

For the record, I wanted this too but I started using github actions instead for pull request needs. So if you're using github, you'll be good to go.

harrisrobin commented 4 years ago

@fishercraigj do you happen to have an example of branch deploys with GitHub Actions + AppCenter?

fishercraigj commented 4 years ago

@harrisrobin Sorry I don't. We specifically want to do manual builds where QA can set some custom environment variables and push the build button themselves when they want new builds all from within AppCenter itself.

The only thing that I do with github actions is on every PR, we run unit tests and some swiftlint tests. If they fail they will block the PR from moving forward.

I would like to have everything in one place but it's nicer for developers to see that the PR is blocked from the pull request itself so it ended up working out for our needs.

akm0012 commented 4 years ago

Are there any updates on this? Or does anyone know of a work around yet? Not being able to see if our app builds and passes unit tests when we open a PR completely defeats the purpose of CI/CD and has been burning us constantly since we switched from Nevercode.

cschembor-ww commented 4 years ago

I've mentioned this in a few different threads, but haven't heard anything. Like @fishercraigj , we decided to go the GitHub Actions route for now, so we can at least build and run unit tests at PR time.

akm0012 commented 4 years ago

@cschembor-ww Thanks for the input! Do you happen to have any example code I could look at on how to configure all that?

cschembor-ww commented 4 years ago

@akm0012 I do not, however GitHub actions has many different starter templates available. This repo contains starter workflows for many different languages supported, which mostly do basic things like building the project and linting/running unit tests. I would start with these basic ones.

kevinvangelder commented 4 years ago

This seems like it should be a central feature of any CI system, so the sooner it can be added the better!

PacoSwifty commented 4 years ago

Throwing my name on the pile - we would love to be able to block merges if unit tests fail.

ChediB commented 3 years ago

@nilofer are there any plans on getting this to work with Bitbucket repos ? Thanks !

nilofer commented 3 years ago

I no longer work on App Center. Re-assigning to @elamalani for an update.

ChediB commented 3 years ago

@elamalani are there any plans on getting this to work with Bitbucket repos ? Thanks !

alexsorokoletov commented 3 years ago

Hi! This would be a great feature to have for other than Github providers (Gitlab, Bitbucket). Are there any updates?

syntax-e commented 3 years ago

My team has the same need. We're using Azure Dev Ops as our git repository. Essentially we need a way to automatically trigger a build on a feature branch when a pull request is initiated from that feature branch into our main branch. Right now the build only runs on the main branch after the pull request is merged and by then it's too late to catch issues with the feature branch.

We're working around this by: 1) Manually configuring a build on the feature branch by using "Clone from existing build configuration"-- cloned from the main branch. 2) Then manually kicking off a build to run our tests on the feature branch. 3) Then merging the feature branch into the main branch. 4) Then manually cleaning up the builds and/or feature branches sometime later.

We're looking at automating this via App Center's API to avoid human error but these types of integrations can be brittle and vulnerable to lost tribal knowledge. It would be super useful if automatically triggering builds on pull requests was a first class feature of App Center.

ghost commented 3 years ago

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

alexsorokoletov commented 3 years ago

Might be just my personal opinion, but this is a very unfriendly way of handling an issue with so many 👍

alexsorokoletov commented 3 years ago

Thanks, @msftbot, much better now.

andac-ozcan commented 3 years ago

This is a major need. We're able to send build status of a commit over GitHub API using post-clone and post-build scripts. Here is the example. But it needs too much workaround with GitHub Action for triggering an AppCenter build from a PR. I don't think it's something hard to implement into AppCenter's build config as a third option for triggering a build. It already have Git webhooks for Push and PR cases.

mensly commented 3 years ago

Really disappointed this has been ignored for years. AppCenter has a lot of issues compared to alternatives I've used. I miss the safety of knowing I'm merging code that compiles and passes unit tests.

vskliam commented 3 years ago

Lack of ability to build on PR makes Git Flow simply impossible. We cannot switch from Bitbucket to GitHub and marketplace extension just to do the simple CI feature.

adriansergheev commented 2 years ago

bump this!

ghost commented 2 years ago

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

mensly commented 2 years ago

sage

draggie commented 2 years ago

I have chosen the AppCenter for flexibility in mobile apps building, but this missing feature is really a thing that seems like this is some half-ready product. Like whether the build is passing or failing is quite important in the process, please consider those comments above, thanks!

ivasilev-pe commented 2 years ago

When is AppCenter going to support this? We ended up with the following workaround, which is a pain to implement and support:

Using Azure Functions and Azure API Management, implement an Azure Function App that would do the following:

  1. React on a new feature branch creation on the code repository by configuring the branch build machine on AppCenter (by cloning some existing branch configuration).
  2. After a PR is created for the feature branch, and on every subsequent commit, run the build with the tests, and signal the results back to the repository hosting service (Bitbucket in our case), so that it would be aware of which commits fail the build process.
AmmarArnt commented 2 years ago

+1 for BitBucket support.

ghost commented 2 years ago

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

autimio commented 2 years ago

Very sage

kevinvangelder commented 2 years ago

@elamalani Can this be added to an official roadmap so the bot stops closing it prematurely for being "stale"?

ghost commented 2 years ago

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

charkcl commented 2 years ago

+1!

ghost commented 2 years ago

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

TiagoDanin commented 2 years ago

Ping @msftbot (keep it open)

ghost commented 1 year ago

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

ghost commented 1 year ago

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

dorianroy commented 1 year ago

Am I really writing a comment just to keep a 3+ year old issue alive? I think so

Nzrvynnyk commented 1 year ago

yes )

microsoft-github-policy-service[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.