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

Autobuild Docs for Pull Requests #5684

Closed
saadmk11 opened this issue May 9, 2019 · 10 comments
Closed

Autobuild Docs for Pull Requests #5684

saadmk11 opened this issue May 9, 2019 · 10 comments

Comments

@saadmk11
Copy link
Member

saadmk11 commented May 9, 2019

Initial Discussion about the PR Builder

This project involves automatically building docs for Pull Requests in GitHub repositories.
This Issue will work as the initial discussion for completing this project.
We can extend this to other issues when required while working on this part by part.

Initial Proposal

  • We already get Pull requests event from Github webhooks. So, I think there is no need to do any changes to that.
  • We can fetch the pull request like travis-ci. ref: Add travis-ci style pull request builder #1340 (comment)
    git fetch origin +refs/pull/<pr_number>/merge:
  • We might consider creating versions for pull requests. we can separate the PR versions by adding a Boolean field to Version Model or adding a type to VERSION_TYPES.
  • Update all the version Querysets accordingly.
  • We can create a PR version when a pull request is opened. (Event Name: pull_request, Action: opened)
  • We might want to triger a build for the PR version if there is a new commit in the PR. (Event Name: pull_request, Action: synchronize)
  • We can delete a PR version when a pull request is closed/merged. (Event Name: pull_request, Action: closed, Merged: True/False)
  • Or we might want to have a life time limit of a PR version if its not merged in a Long Time or if we do not receive webhook event for any reason.
  • We need some design decisions for where to store the PR Build data.
  • We might want to Exclude PR builds from Search Engines.

In this Issue we might want to discuss about:

  • How we can get started on This.
  • What will be the best approach to implement this.
  • In which order should these be done.
  • what should be the best approach to Pull the PR data to our build server.
  • The changes needed to the proposal and additional requirements.
  • Get the Design Decisions, Suggestions from the Team.
  • The step we can follow to make the Project successful.
  • What kind of issues we might face while working on this.
  • How we can solve those issues that might arise while working on this.

I would like to know Everyone's Initial Thoughts about it and carry the discussion forward :)

@safwanrahman
Copy link
Member

I think we should move to Github Apps. @saadmk11 Can you evaluate Github Apps to know if we can move to Github Apps?

@safwanrahman
Copy link
Member

The important part is, how do we serve the documentation. Should be it in the same domain or it should be served from different domain/subdomain. Moreover, are we going to support only Github or we should also evaluate if we can support Github/Gitlab both.

@saadmk11
Copy link
Member Author

saadmk11 commented May 15, 2019

The important part is, how do we serve the documentation. Should be it in the same domain or it should be served from different domain/subdomain.

@safwanrahman I was thinking we could serve the PR builds using <pr_number> namespace.
We can do something like: : https://<project_slug>.readthedocs.io/en/pr/<pr_number>/
What do you think ?

Moreover, are we going to support only Github or we should also evaluate if we can support Github/Gitlab both.

We can get started with Github and then extend to Gitlab if we can support it.

@saadmk11
Copy link
Member Author

saadmk11 commented May 15, 2019

I think we should move to Github Apps. @saadmk11 Can you evaluate Github Apps to know if we can move to Github Apps?

I read briefly about Github apps from the official Documentations. Github App has many differences from the OAuth implementation that we are currently using. we would need a good amount of refactoring to implement this and it is not as flexible as our current implementation.

Github Apps Provide Built-in, centralized webhooks receive events for all repositories and organizations the app can access. Conversely, OAuth Apps require configuring a webhook for each repository and organization accessible to the user.
Read More

Which we do not want.

It needs permissions to a users repository manually.

@agjohnson
Copy link
Contributor

We've decided to not block this work on migration to GitHub apps. We already have migrating to GH apps on our roadmap in a few months though, so we'll deal with the change then.

@stale
Copy link

stale bot commented Aug 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Aug 10, 2019
@humitos
Copy link
Member

humitos commented Aug 10, 2019

@saadmk11 what's the status of this issue? I think it's OK to close it, but not as stale because everything is implemented, right?

@stale stale bot removed the Status: stale Issue will be considered inactive soon label Aug 10, 2019
@saadmk11
Copy link
Member Author

Yes, we can close this issue as everything discussed here has been implemented.

@webknjaz
Copy link
Contributor

webknjaz commented Feb 3, 2020

@safwanrahman @agjohnson I saw you mentioning migration to GitHub Apps earlier. This is a topic I'm interested in a lot so if there's any help with reviews of relevant PRs needed, feel free to ping me for help.

P.S. I'm developing a small framework for making GitHub Apps (something similar to Probot which is in JS) in Python. You can try out how it feels by following this tutorial: https://tutorial.octomachinery.dev/ (beware of bugs! there's some inconsistency that I haven't yet fixed in the tutorial itself).
It's Python 3.7+ so I'm not sure if it'll fit your needs but if you need any help with integration and decide to try it out, feel free to text me and I'll see what I can do here.

@stsewd
Copy link
Member

stsewd commented Feb 3, 2020

@webknjaz thanks, I have linked your comment in our internal ticket where we are tracking the migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants