-
Notifications
You must be signed in to change notification settings - Fork 43
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
Academy: Set up workflow to import issues from participating projects #11
Comments
Can I please be assigned for this task? I wanted to learn more about Github actions. |
I can give this a whirl, though I would need someone to confirm/set up token access on a separate repository also owned by Canonical to test it. I've tested the following workflow using two existing personal repositories, one in which I created an issue and labeled it with ODA, and one in which the GH action makes a copy of the ODA-labeled issue. The former (the repository being copied FROM) contains a GH_TOKEN repository secret with repo access. I've tested to make sure that it only copies the issue when the ODA label is added, not when any others are. I've added a link to the original issue in the body of the copied issue. This is the workflow I tested, with the repo name and repo owner name changed to 'open-documentation-academy' and 'canonical'.
|
Hello! Sorry for the long delay getting back to you, @minaelee and @alexvonme. I'll assign the task to both of you for now, but I'll also give @minaelee's suggestion a go and see if this works. This is actually one of the most important tasks in the repository because we really want to incorporate external projects. Thanks for taking the time to consider this! |
You're welcome, good luck with the action setup and let me know if you have questions or run into issues! |
@minaelee Thanks very much for this work. When I initially looked into it, the primary problem was that without a GH token issued from the ODA repo there weren't sufficient permissions to create an issue even on a public repo. Does this get around that limitation or does it still need a token issued from this repo? I don't consider that a complete blocker, it just makes it slightly more work for projects to use as we will have to issue tokens to participants, but maybe that could be considered useful gatekeeping to prevent spam anyhow. |
That limitation does still exist. AFAIK a workflow in repo1 can't create an issue on repo2 without token-based authentication, even if repo2 is public. I can't think of any workaround that wouldn't be more complicated than setting a token. You should only need to issue one token from the ODA repo, then use that same token in all the other repos. |
Hi, I am Till Kamppeter, lead of OpenPrinting. I want to participate in the Documentation Academy as an organization in need of documentation. This issue is all about coupling documentation-related issues of participating organizations with the Academy and so it is essential for external organizations to participate. Therefore I have met @degville last week on Canonical's Engineering Sprint and talked with him about that and he agreed that we need to implement this feature request with high priority. @degville could you mark this as high priority and assure that it gets quickly done, as you suggested in our conversation on the Sprint? |
OpenPrinting will participate in Canonical's Open Documentation Academy, as an organization in need of documentation. Essential for that is that documentation-related issue reports on OpenPrinting GitHub repositories get forwarded to the GitHub repository of the Open Documentation Academy: https://github.com/canonical/open-documentation-academy/ This commit is a first test for an automated workflow to do so. We add the GitHub workflow suggested by the user @minaelee (Minae Lee) in the feature request for a GitHub action supporting the automated forwarding: canonical/open-documentation-academy#11 The suggested workflow code is rudimentary, just copying the issue report as the label "ODA" gets added to it. There is no syncing of the copy with the original later on, for example when the original's description gets edited, comments added to the original or the original being closed. Also this workflow is a significant bunch of code, and so a maintenance nightmare if deploying on all the > 30 repositories on OpenPrinting. Therefore we will test it on libcupsfilters for now and include the other repositories as soon as there is a GitHub action which is developed and maintained by the Open Documentation Academy.
@tillkamppeter @degville I have requested a PAT token specifically for this repo with issue-only permissions (which I think should be enough). Will update you when it gets generated and leave issue open for now Thanks @minaelee |
@minaelee Thanks a lot for your workflow! I have now tried to do this in real life. First, I have copied the exact workflow script (with "canonical" and "open-documentation-academy") into the file In the libcupsfilters repo I see on the "Actions" tab that the workflow actually gets executed, triggered by my addition of the "GOA" tag. Only it seems that I do not have a
So I commented out the
The log shows that this is a 403. Canonical's repo seems to not accept reporting an issue via the API. So I tried now the token
@degville for me it seems that the Open Documentation Academy GitHub repo needs some change in the settings for permission/security to allow issue reporting via GitHub API, so that actions and workflows can copy over/sync issues reports from external repos. |
How do you request such tokens and who issues them? Do not close this issue when the token makes @minaelee 's workflow working. Seemy earlier comment about the test character of this workflow. We will need an action which is developed and maintained centrally here and has more advanced functionality. |
@tillkamppeter the token needs to be approved by the owner of the repo, in this case IS. |
Hello! I saw this issue and wondered if anyone had any updates about importing issues from other repositories. If the need for Canonical-issued personal access tokens is going to pose problems, then I have an idea for an alternative approach that might be worth considering. In short, it should be possible to run a GitHub Action on just this repository that uses the GitHub REST API to:
This isn't an elegant solution at all, particularly when compared to the previously discussed 'run-when-labelled' approach. In fact, it's a bit inefficient. Nevertheless, it comes with some few advantages, for example:
All an external project would need to do is:
We would need to define the list of participating repositories somewhere. This could be done in a text file in this repository, which the Action could parse whenever it runs. The registration process could involve someone from the external project filing a pull request against this file. The file also provides an easy way to remove a project if needed - perhaps temporarily in the case of spam, or permanently if there's a more serious issue (or if the project simply no longer wishes to participate) - that doesn't involve revoking a token. The REST API provides a way to read issues from public repositories without needing to be authenticated to GitHub. That said, I think it would be worth creating a 'bot' account that can own the copied issues. The Action could also use that account to comment on the original issue, for example to confirm that the issue has been copied successfully. To avoid duplicating issues, we could store the original issue's unique As GitLab also offers a REST API, it may be possible to take a similar approach to copy issues from projects hosted on a GitLab instance. What does everyone think? I haven't actually tested this out, but I'm happy to have a go if there's any interest - unless someone else wants to! |
Hello - I just wondered whether anyone had any thoughts about this, and/or if any additional work has been done behind the scenes (e.g. in relation to a Canonical-issued PAT). |
While this is a central repository for the Open Documentation Academy, documentation issues are likely (and properly) recorded directly in other repositories. However, for ease of use and visibility, these issues should also exist in the ODA.
There should be an established, automated and obvious way (e.g. by adding a label) to get issues included here
Possible solution: an action in each participating repo which picks up on a unique label, similar to
https://github.com/marketplace/actions/github-issue-copier
The text was updated successfully, but these errors were encountered: