Skip to content

Commit

Permalink
Make all magician references to GoogleCloudPlatform refer instead to …
Browse files Browse the repository at this point in the history
…trodge
  • Loading branch information
trodge committed Sep 5, 2024
1 parent bf76ec3 commit b8c2800
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .ci/magician/cmd/SCHEDULED_PR_WAITING_FOR_REVIEW.md.tmpl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{if ge .SinceDays 5}}@GoogleCloudPlatform/terraform-team {{end}}{{range .CoreReviewers}}@{{ . }} {{end}}This PR has been waiting for review for {{if lt .SinceDays 5}}{{.SinceDays}} weekdays{{else if eq .SinceDays 5}}1 week{{else}}{{weekdaysToWeeks .SinceDays}} weeks{{end}}. Please take a look! Use the label `disable-review-reminders` to disable these notifications.
{{if ge .SinceDays 5}}@trodge/terraform-team {{end}}{{range .CoreReviewers}}@{{ . }} {{end}}This PR has been waiting for review for {{if lt .SinceDays 5}}{{.SinceDays}} weekdays{{else if eq .SinceDays 5}}1 week{{else}}{{weekdaysToWeeks .SinceDays}} weeks{{end}}. Please take a look! Use the label `disable-review-reminders` to disable these notifications.
2 changes: 1 addition & 1 deletion .ci/magician/cmd/generate_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"magician/provider"
"magician/source"

"github.com/GoogleCloudPlatform/magic-modules/tools/issue-labeler/labeler"
"github.com/trodge/magic-modules/tools/issue-labeler/labeler"

"github.com/spf13/cobra"
"golang.org/x/exp/maps"
Expand Down
2 changes: 1 addition & 1 deletion .ci/magician/cmd/generate_downstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func cloneRepo(mmRepo *source.Repo, baseBranch, repo, version, command, ref stri
downstreamRepo.Owner = "hashicorp"
case "terraform-google-conversion":
downstreamRepo.Name = "terraform-google-conversion"
downstreamRepo.Owner = "GoogleCloudPlatform"
downstreamRepo.Owner = "trodge"
case "tf-oics":
if downstreamRepo.Branch == "main" {
downstreamRepo.Branch = "master"
Expand Down
6 changes: 3 additions & 3 deletions .ci/magician/cmd/request_service_reviewers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"math/rand"
"strings"

"github.com/GoogleCloudPlatform/magic-modules/tools/issue-labeler/labeler"
"github.com/trodge/magic-modules/tools/issue-labeler/labeler"
"github.com/spf13/cobra"
"gopkg.in/yaml.v2"
)
Expand Down Expand Up @@ -108,9 +108,9 @@ func execRequestServiceReviewers(prNumber string, gh GithubClient, enrolledTeams

exitCode := 0
for githubTeam := range githubTeamsSet {
members, err := gh.GetTeamMembers("GoogleCloudPlatform", githubTeam)
members, err := gh.GetTeamMembers("trodge", githubTeam)
if err != nil {
fmt.Printf("Error fetching members for GoogleCloudPlatform/%s: %s", githubTeam, err)
fmt.Printf("Error fetching members for trodge/%s: %s", githubTeam, err)
exitCode = 1
continue
}
Expand Down
10 changes: 5 additions & 5 deletions .ci/magician/cmd/scheduled_pr_reminders.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func execScheduledPrReminders(gh *github.Client) error {
for {
pulls, resp, err := gh.PullRequests.List(
ctx,
"GoogleCloudPlatform",
"trodge",
"magic-modules",
opt,
)
Expand Down Expand Up @@ -110,7 +110,7 @@ func execScheduledPrReminders(gh *github.Client) error {
for {
events, resp, err := gh.Issues.ListIssueEvents(
ctx,
"GoogleCloudPlatform",
"trodge",
"magic-modules",
*pr.Number,
eventsOpt,
Expand All @@ -130,7 +130,7 @@ func execScheduledPrReminders(gh *github.Client) error {
for {
reviews, resp, err := gh.PullRequests.ListReviews(
ctx,
"GoogleCloudPlatform",
"trodge",
"magic-modules",
*pr.Number,
reviewsOpt,
Expand Down Expand Up @@ -181,7 +181,7 @@ func execScheduledPrReminders(gh *github.Client) error {
} else {
_, _, err := gh.Issues.CreateComment(
ctx,
"GoogleCloudPlatform",
"trodge",
"magic-modules",
*pr.Number,
&github.IssueComment{
Expand All @@ -200,7 +200,7 @@ func execScheduledPrReminders(gh *github.Client) error {
} else {
_, _, err := gh.Issues.Edit(
ctx,
"GoogleCloudPlatform",
"trodge",
"magic-modules",
*pr.Number,
&github.IssueRequest{
Expand Down
6 changes: 3 additions & 3 deletions .ci/magician/cmd/scheduled_pr_reminders_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ func TestFormatReminderComment(t *testing.T) {
"@" + secondCoreReviewer,
},
notExpectedStrings: []string{
"@GoogleCloudPlatform/terraform-team",
"@trodge/terraform-team",
"@pr-author",
"@other-reviewer",
},
Expand All @@ -899,7 +899,7 @@ func TestFormatReminderComment(t *testing.T) {
state: waitingForReview,
sinceDays: 5,
expectedStrings: []string{
"@GoogleCloudPlatform/terraform-team",
"@trodge/terraform-team",
"waiting for review for 1 week",
"disable-review-reminders",
"@" + firstCoreReviewer,
Expand All @@ -922,7 +922,7 @@ func TestFormatReminderComment(t *testing.T) {
state: waitingForReview,
sinceDays: 10,
expectedStrings: []string{
"@GoogleCloudPlatform/terraform-team",
"@trodge/terraform-team",
"waiting for review for 2 weeks",
"disable-review-reminders",
"@" + firstCoreReviewer,
Expand Down
2 changes: 1 addition & 1 deletion .ci/magician/cmd/sync_branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func execSyncBranchCmd(syncBranchPrefix, baseBranch, sha, githubToken string, ru
return nil
}

_, err := runner.Run("git", []string{"push", fmt.Sprintf("https://modular-magician:%s@github.com/GoogleCloudPlatform/magic-modules", githubToken), fmt.Sprintf("%s:%s", sha, syncBranch)}, nil)
_, err := runner.Run("git", []string{"push", fmt.Sprintf("https://modular-magician:%s@github.com/trodge/magic-modules", githubToken), fmt.Sprintf("%s:%s", sha, syncBranch)}, nil)
return err
}

Expand Down
8 changes: 4 additions & 4 deletions .ci/magician/github/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type PullRequest struct {
}

func (gh *Client) GetPullRequest(prNumber string) (PullRequest, error) {
url := fmt.Sprintf("https://api.github.com/repos/GoogleCloudPlatform/magic-modules/issues/%s", prNumber)
url := fmt.Sprintf("https://api.github.com/repos/trodge/magic-modules/issues/%s", prNumber)

var pullRequest PullRequest

Expand All @@ -49,7 +49,7 @@ func (gh *Client) GetPullRequest(prNumber string) (PullRequest, error) {
}

func (gh *Client) GetPullRequests(state, base, sort, direction string) ([]PullRequest, error) {
url := fmt.Sprintf("https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls?state=%s&base=%s&sort=%s&direction=%s", state, base, sort, direction)
url := fmt.Sprintf("https://api.github.com/repos/trodge/magic-modules/pulls?state=%s&base=%s&sort=%s&direction=%s", state, base, sort, direction)

var pullRequests []PullRequest

Expand All @@ -59,7 +59,7 @@ func (gh *Client) GetPullRequests(state, base, sort, direction string) ([]PullRe
}

func (gh *Client) GetPullRequestRequestedReviewers(prNumber string) ([]User, error) {
url := fmt.Sprintf("https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls/%s/requested_reviewers", prNumber)
url := fmt.Sprintf("https://api.github.com/repos/trodge/magic-modules/pulls/%s/requested_reviewers", prNumber)

var requestedReviewers struct {
Users []User `json:"users"`
Expand All @@ -74,7 +74,7 @@ func (gh *Client) GetPullRequestRequestedReviewers(prNumber string) ([]User, err
}

func (gh *Client) GetPullRequestPreviousReviewers(prNumber string) ([]User, error) {
url := fmt.Sprintf("https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls/%s/reviews", prNumber)
url := fmt.Sprintf("https://api.github.com/repos/trodge/magic-modules/pulls/%s/reviews", prNumber)

var reviews []struct {
User User `json:"user"`
Expand Down
2 changes: 1 addition & 1 deletion .ci/magician/github/membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (gh *Client) GetUserType(user string) UserType {
return CoreContributorUserType
}

if isOrgMember(user, "GoogleCloudPlatform", gh.token) {
if isOrgMember(user, "trodge", gh.token) {
fmt.Println("User is a GCP org member")
return GooglerUserType
}
Expand Down
12 changes: 6 additions & 6 deletions .ci/magician/github/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
)

func (gh *Client) PostBuildStatus(prNumber, title, state, targetURL, commitSha string) error {
url := fmt.Sprintf("https://api.github.com/repos/GoogleCloudPlatform/magic-modules/statuses/%s", commitSha)
url := fmt.Sprintf("https://api.github.com/repos/trodge/magic-modules/statuses/%s", commitSha)

postBody := map[string]string{
"context": title,
Expand All @@ -40,7 +40,7 @@ func (gh *Client) PostBuildStatus(prNumber, title, state, targetURL, commitSha s
}

func (gh *Client) PostComment(prNumber, comment string) error {
url := fmt.Sprintf("https://api.github.com/repos/GoogleCloudPlatform/magic-modules/issues/%s/comments", prNumber)
url := fmt.Sprintf("https://api.github.com/repos/trodge/magic-modules/issues/%s/comments", prNumber)

body := map[string]string{
"body": comment,
Expand All @@ -57,7 +57,7 @@ func (gh *Client) PostComment(prNumber, comment string) error {
}

func (gh *Client) RequestPullRequestReviewers(prNumber string, reviewers []string) error {
url := fmt.Sprintf("https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls/%s/requested_reviewers", prNumber)
url := fmt.Sprintf("https://api.github.com/repos/trodge/magic-modules/pulls/%s/requested_reviewers", prNumber)

body := map[string][]string{
"reviewers": reviewers,
Expand All @@ -75,7 +75,7 @@ func (gh *Client) RequestPullRequestReviewers(prNumber string, reviewers []strin
}

func (gh *Client) AddLabels(prNumber string, labels []string) error {
url := fmt.Sprintf("https://api.github.com/repos/GoogleCloudPlatform/magic-modules/issues/%s/labels", prNumber)
url := fmt.Sprintf("https://api.github.com/repos/trodge/magic-modules/issues/%s/labels", prNumber)

body := map[string][]string{
"labels": labels,
Expand All @@ -91,7 +91,7 @@ func (gh *Client) AddLabels(prNumber string, labels []string) error {
}

func (gh *Client) RemoveLabel(prNumber, label string) error {
url := fmt.Sprintf("https://api.github.com/repos/GoogleCloudPlatform/magic-modules/issues/%s/labels/%s", prNumber, label)
url := fmt.Sprintf("https://api.github.com/repos/trodge/magic-modules/issues/%s/labels/%s", prNumber, label)
err := utils.RequestCall(url, "DELETE", gh.token, nil, nil)

if err != nil {
Expand All @@ -102,7 +102,7 @@ func (gh *Client) RemoveLabel(prNumber, label string) error {
}

func (gh *Client) CreateWorkflowDispatchEvent(workflowFileName string, inputs map[string]any) error {
url := fmt.Sprintf("https://api.github.com/repos/GoogleCloudPlatform/magic-modules/actions/workflows/%s/dispatches", workflowFileName)
url := fmt.Sprintf("https://api.github.com/repos/trodge/magic-modules/actions/workflows/%s/dispatches", workflowFileName)
err := utils.RequestCall(url, "POST", gh.token, nil, map[string]any{
"ref": "main",
"inputs": inputs,
Expand Down
4 changes: 2 additions & 2 deletions .ci/magician/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ module magician

go 1.21

replace github.com/GoogleCloudPlatform/magic-modules/tools/issue-labeler => ../../tools/issue-labeler
replace github.com/trodge/magic-modules/tools/issue-labeler => ../../tools/issue-labeler

require (
github.com/GoogleCloudPlatform/magic-modules/tools/issue-labeler v0.0.0-00010101000000-000000000000
github.com/trodge/magic-modules/tools/issue-labeler v0.0.0-00010101000000-000000000000
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5 // indirect
Expand Down

0 comments on commit b8c2800

Please sign in to comment.