Skip to content

Commit

Permalink
update timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
nfuden committed Nov 13, 2024
1 parent 5ac4976 commit d719978
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/issuegrab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
jobs:
grab_and_update:
runs-on: ubuntu-22.04
timeout-minutes: 360
timeout-minutes: 3600
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand Down
24 changes: 20 additions & 4 deletions issuegrabber/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
)

func main() {
startPage := 314
startPage := 350
// maxPages := 3 + startPage
maxPages := 900
magicNumber := 3141 // current issue number
magicNumber := 3505 // current issue number

donorDetails := []string{"k8sgateway", "k8sgateway"}
destDetails := []string{"solo-io", "gloo_2"}
Expand Down Expand Up @@ -60,7 +60,7 @@ func main() {
Sort: "created",
Direction: "asc",
}
issues, _, err := g.Issues.ListByRepo(ctx, donorDetails[0], donorDetails[1], opt)
issues, _, err := g.Issues.ListBy Repo(ctx, donorDetails[0], donorDetails[1], opt)
if err != nil {
logger.Error(err.Error())
}
Expand All @@ -72,8 +72,9 @@ func main() {
if issue.GetNumber() <= magicNumber {
continue
}


if issue.GetNumber() <= maxForNow {
if issue.GetNumber() < maxForNow {

logger.Warn("skipping issue", logger.Args("issue", issue.GetNumber()))
continue
Expand All @@ -90,6 +91,21 @@ func main() {
newTitle := fmt.Sprintf("[Migrated] %s", *issue.Title)
var err error


if issue.GetNumber() == maxForNow {
_, _, err = g.Issues.Edit(ctx, destDetails[0], destDetails[1], issue.GetNumber(), &github.IssueRequest{
Title: &newTitle,
Body: &candidateBody,
State: issue.State,
})
if err != nil {
logger.Error(err.Error())
}
logger.Info("updated issue", logger.Args("issue", issue.GetNumber()))
continue
}


returnedIsh, _, err := g.Issues.Create(ctx, destDetails[0], destDetails[1], &github.IssueRequest{
Title: &newTitle,
Body: &candidateBody,
Expand Down

0 comments on commit d719978

Please sign in to comment.