-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Connect Project with RemoteRepository Model to send Build Status Reports #6014
Comments
I do see different things here:
I see 1) more robust in the way that the token used to make the call could change in time without issues (e.g. if the user who imported the project is not a maintainer anymore, then the next user's token will be used). Also, 1) is something that we are already doing. This way, if at least one of the maintainers has a Social account connected (with permissions on that GitHub repository) it will work. What are the drawbacks for 1)? I'm not seeing them right now. In all the cases, the communication to the user can be done using our Notification system. |
@humitos I agree with you. I think 1 is more cleaner approach and it will help us get around permission issues in most of the projects. and I also don't see any big issue with No. 1. |
I'm fine with #1, but what happens when a user tries to get PR builds working, they don't have a connected social account, and the PR builds just fail to work? We need to actively communicate the status of this to the user, and show them how to resolve the issue. |
I think we probably need some kind of setting for PR builds that users can turn on and off, and if it's turned on, then we show the status of the GitHub connection on the project detail page. |
I think we could have a |
@stsewd thoughts on whether this should be on the config file? It's a project-level setting, so I don't think it necessarily makes sense per-version on the config, so probably makes the most sense in the DB. |
So, travis does this in the config file to allow users to skip the CI on some branches.
|
Another approach for Communicating with the users: We can send site notifications about the issue when the |
Details
To send build status reports to the providers ((GitHub, GitLab, Bitbucket)) we need to get a users token for that project. To get the token we are currently using the
RemoteRepository
Model so that we can get the social account of the user (i.e:project.remote_repository.account
).But There are many legacy projects in ReadtheDocs that do not have a remote repository connected or the users do not have a social account (GitHub, GitLab, Bitbucket) connected.
So, we need a good way to solve this issue to be able to send build status reports to the providers using their API.
Initial Proposal
There are mainly two way we could solve this issue for most of the users.
We have an existing approach in our codebase which we may use
readthedocs.org/readthedocs/oauth/tasks.py
Lines 63 to 89 in e47f8d5
We can use something similar to this approach to solve the issue. we can pass the users of the project and check for their connected social accounts and try to send the status reports.
For projects that don't have any users with a social account connected we can have a UI or site notification which will tell them to connect to a social account to get this feature available.
This approach includes 2 steps.
First: for new projects we need to have a way to create a remote repository while importing a projects manually and connect the project with that. But if the user importing the project does not have a social account that won't be much useful.
Secondly: We need a UI for users to connect their project to remote repository maybe a button or something that will send a request to the providers API and fetch the repository data and create a remote repository. also in the UI we can tell the users why the build status might not be working for them.
There might be more approaches to this. these are what I came up with.
I would like to get @readthedocs/core teams thoughts on this and select an approach that will be best for us. :)
TODO:
The text was updated successfully, but these errors were encountered: