-
Notifications
You must be signed in to change notification settings - Fork 67
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
Migrate dapr issues from dotnet/aspire #458
Comments
I'll look into what would be required to migrate between orgs |
Is it worth triaging these beforehand? Based on initial review some of these are either not issues or may have been addressed already |
We could, but we don't have permission to close the issues on the Aspire repo, so we would have to wait for the Aspire team to help with that. If we migrate them here first, then we have better control on them, we can also engage with the author without having a split dialog of the code being in one repo and the issue in another. |
Bummer, you can't transfer issues between orgs (per the docs). Here's a creative workaround that uses the fact you can move repos between orgs, but it might be a lot of overhead. Probably easiest to just copy each issue across from the Aspire repo, tag the original author in our copy, close the original, and we can take it from there. |
It's a pity there are no programmers around here 😜Would need some mods to filter and select relevant issues. # Define parameters
param (
[string]$sourceOrg,
[string]$sourceRepo,
[string]$destOrg,
[string]$destRepo,
[string]$token
)
# Function to get issues from the source repository
function Get-Issues {
param (
[string]$org,
[string]$repo,
[string]$token
)
$url = "https://api.github.com/repos/$org/$repo/issues"
$headers = @{
Authorization = "token $token"
Accept = "application/vnd.github.v3+json"
}
Invoke-RestMethod -Uri $url -Headers $headers -Method Get
}
# Function to get comments for an issue
function Get-Comments {
param (
[string]$org,
[string]$repo,
[int]$issueNumber,
[string]$token
)
$url = "https://api.github.com/repos/$org/$repo/issues/$issueNumber/comments"
$headers = @{
Authorization = "token $token"
Accept = "application/vnd.github.v3+json"
}
Invoke-RestMethod -Uri $url -Headers $headers -Method Get
}
# Function to create issues in the destination repository
function Create-Issue {
param (
[string]$org,
[string]$repo,
[string]$token,
[string]$title,
[string]$body
)
$url = "https://api.github.com/repos/$org/$repo/issues"
$headers = @{
Authorization = "token $token"
Accept = "application/vnd.github.v3+json"
}
$body = @{
title = $title
body = $body
} | ConvertTo-Json
Invoke-RestMethod -Uri $url -Headers $headers -Method Post -Body $body
}
# Get issues from the source repository
$issues = Get-Issues -org $sourceOrg -repo $sourceRepo -token $token
# Migrate issues to the destination repository
foreach ($issue in $issues) {
# Get comments for the issue
$comments = Get-Comments -org $sourceOrg -repo $sourceRepo -issueNumber $issue.number -token $token
# Format comments as a markdown table
$commentsTable = "| Username | Timestamp | Comment |\n| --- | --- | --- |\n"
foreach ($comment in $comments) {
$commentsTable += "| $($comment.user.login) | $($comment.created_at) | $($comment.body) |\n"
}
# Create the new issue body with comments table
$newBody = $issue.body + "`n`n### Comments`n" + $commentsTable
# Create the issue in the destination repository
Create-Issue -org $destOrg -repo $destRepo -token $token -title $issue.title -body $newBody
}
Write-Output "Issues and comments migrated successfully from $sourceOrg/$sourceRepo to $destOrg/$destRepo" EDIT: will embed source issue's comments as an inline table in the body of the new issue in the target repo. |
@oising you need to handle comments too 😄 |
Done. |
Now make it an extension for the GitHub CLI 😝 |
That sounds like fun. I didn't know it took extensions? I'll look into it; I need a less-stressful side project than working on Aspire :P |
We have noticed this issue has not been updated within 21 days. If there is no action on this issue in the next 14 days, we will automatically close it. You can use |
/stale-extend |
https://github.com/dotnet/aspire/issues?q=is%3Aissue%20state%3Aopen%20label%3Adapr%20
cc @aaronpowell @FullStackChef @oising @paule96
The text was updated successfully, but these errors were encountered: