Skip to content

Commit

Permalink
add: runhistory status update
Browse files Browse the repository at this point in the history
  • Loading branch information
genos1998 committed Sep 18, 2024
1 parent 3de7327 commit 41bc9ae
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
6 changes: 6 additions & 0 deletions july2024august2024/august2024/queries.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ mutation AttachJiraToRunHistory($jira: [AddJiraInput!]!) {
numUids
}
}

mutation UpdateRunHistory {
updateRunHistory(input: { set: { Status: "active" }, filter: {} }) {
numUids
}
}
49 changes: 49 additions & 0 deletions july2024august2024/august2024/schema-generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions july2024august2024/updateRunhistoryStatus.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package july2024august2024

import (
"context"
"fmt"
"upgradationScript/july2024august2024/august2024"

"github.com/Khan/genqlient/graphql"
)

func performStatusUpdate(expDgraphClient graphql.Client) error {
ctx := context.Background()

if _, err := august2024.UpdateRunHistory(ctx, expDgraphClient); err != nil {
return fmt.Errorf("error while updating runhistory status to active")
}

return nil

}
4 changes: 4 additions & 0 deletions july2024august2024/upgradeSteps.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ func UpgradeToAugust2024(prodGraphUrl, prodToken, expDgraphUrl, restoreServiceUr
return fmt.Errorf("UpgradeToAugust2024: performJiraDetailsTransition: %s", err.Error())
}

if err := performStatusUpdate(expDgraphClient); err != nil {
return fmt.Errorf("UpgradeToAugust2024: performStatusUpdate: %s", err.Error())
}

if err := graphqlfunc.BackupAndRestoreDgraph(expDgraphUrl, restoreServiceUrl); err != nil {
return fmt.Errorf("UpgradeToAugust2024: BackupAndRestoreDgraph: %s", err.Error())
}
Expand Down

0 comments on commit 41bc9ae

Please sign in to comment.