Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/containers/go-plus/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WORKDIR /app1
# Add the source code and build
ADD "https://github.com/GoogleCloudPlatform/magic-modules/archive/refs/heads/main.zip" source.zip
RUN unzip source.zip && rm source.zip
WORKDIR /app1/magic-modules-main/.ci/magician
WORKDIR /app1/magic-modules-main/tools/magician
# Build the binary (we won't use it in the final image, but it's cached)
RUN go build -o /dev/null .

Expand Down
4 changes: 2 additions & 2 deletions .ci/scripts/go-plus/magician/exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

set -e

# Get the directory of the current script
# Get the directory of the current script (.ci/scripts/go-plus/magician/exec.sh)
DIR="$(dirname $(realpath $0))"

# Construct the path to the Go program directory and binary
GO_PROGRAM_DIR="$DIR/../../../magician"
GO_PROGRAM_DIR="$DIR/../../../../tools/magician"
GO_BINARY="$GO_PROGRAM_DIR/magician_binary"

pushd $GO_PROGRAM_DIR
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reassign-reviewer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
- name: Build magician
if: steps.read-comment.outputs.match != ''
run: |
cd .ci/magician
cd tools/magician
go build .
- name: Run command
if: steps.read-comment.outputs.match != ''
run: .ci/magician/magician reassign-reviewer ${{ github.event.issue.number }} ${{ github.event.comment.user.login }} ${{ steps.read-comment.outputs.group1 }}
run: tools/magician/magician reassign-reviewer ${{ github.event.issue.number }} ${{ github.event.comment.user.login }} ${{ steps.read-comment.outputs.group1 }}
4 changes: 2 additions & 2 deletions .github/workflows/request-reviewer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
cache: false
- name: Build magician
run: |
cd .ci/magician
cd tools/magician
go build .
- name: Request reviewer
run: .ci/magician/magician request-reviewer ${{ github.event.pull_request.number || github.event.issue.number }}
run: tools/magician/magician request-reviewer ${{ github.event.pull_request.number || github.event.issue.number }}

4 changes: 2 additions & 2 deletions .github/workflows/scheduled-pr-reminders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
cache: false
- name: Build magician
run: |
cd .ci/magician
cd tools/magician
go build .
- name: Request reviewer
run: .ci/magician/magician scheduled-pr-reminders ${{ github.event.pull_request.number }}
run: tools/magician/magician scheduled-pr-reminders ${{ github.event.pull_request.number }}
4 changes: 2 additions & 2 deletions .github/workflows/unit-test-magician.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ permissions: read-all
on:
pull_request:
paths:
- '.ci/magician/**'
- 'tools/magician/**'

jobs:
build-and-unit-tests:
Expand All @@ -18,7 +18,7 @@ jobs:
go-version: '^1.23'
- name: Run magician unit tests
run: |
cd .ci/magician
cd tools/magician
go test ./...
env:
GITHUB_TOKEN_CLASSIC: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ tpgtools/temp.serial
tpgtools/serialization.go

# ignore magician binary
.ci/magician/magician
tools/magician/magician

# ignore leftover testlogs and cassettes
.ci/magician/testlogs
.ci/magician/cassettes
tools/magician/testlogs
tools/magician/cassettes
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,19 @@ func TestExecGenerateComment(t *testing.T) {
{"/mock/dir/magic-modules/tools/diff-processor/bin"},
},
"Run": {
{"/mock/dir/magic-modules/.ci/magician", "git", []string{"clone", "-b", "auto-pr-123456", "https://modular-magician:*******@github.com/modular-magician/terraform-provider-google", "/mock/dir/tpg"}, map[string]string(nil)},
{"/mock/dir/magic-modules/tools/magician", "git", []string{"clone", "-b", "auto-pr-123456", "https://modular-magician:*******@github.com/modular-magician/terraform-provider-google", "/mock/dir/tpg"}, map[string]string(nil)},
{"/mock/dir/tpg", "git", []string{"fetch", "origin", "auto-pr-123456-old"}, map[string]string(nil)},
{"/mock/dir/tpg", "git", []string{"checkout", "auto-pr-123456-old"}, map[string]string(nil)},
{"/mock/dir/tpg", "make", []string{"build"}, map[string]string(nil)},
{"/mock/dir/tpg", "git", []string{"checkout", "auto-pr-123456"}, map[string]string(nil)},
{"/mock/dir/magic-modules/.ci/magician", "git", []string{"clone", "-b", "auto-pr-123456", "https://modular-magician:*******@github.com/modular-magician/terraform-provider-google-beta", "/mock/dir/tpgb"}, map[string]string(nil)},
{"/mock/dir/magic-modules/tools/magician", "git", []string{"clone", "-b", "auto-pr-123456", "https://modular-magician:*******@github.com/modular-magician/terraform-provider-google-beta", "/mock/dir/tpgb"}, map[string]string(nil)},
{"/mock/dir/tpgb", "git", []string{"fetch", "origin", "auto-pr-123456-old"}, map[string]string(nil)},
{"/mock/dir/tpgb", "git", []string{"checkout", "auto-pr-123456-old"}, map[string]string(nil)},
{"/mock/dir/tpgb", "make", []string{"build"}, map[string]string(nil)},
{"/mock/dir/tpgb", "git", []string{"checkout", "auto-pr-123456"}, map[string]string(nil)},
{"/mock/dir/magic-modules/.ci/magician", "git", []string{"clone", "-b", "auto-pr-123456", "https://modular-magician:*******@github.com/modular-magician/terraform-google-conversion", "/mock/dir/tgc"}, map[string]string(nil)},
{"/mock/dir/magic-modules/tools/magician", "git", []string{"clone", "-b", "auto-pr-123456", "https://modular-magician:*******@github.com/modular-magician/terraform-google-conversion", "/mock/dir/tgc"}, map[string]string(nil)},
{"/mock/dir/tgc", "git", []string{"fetch", "origin", "auto-pr-123456-old"}, map[string]string(nil)},
{"/mock/dir/magic-modules/.ci/magician", "git", []string{"clone", "-b", "auto-pr-123456", "https://modular-magician:*******@github.com/modular-magician/docs-examples", "/mock/dir/tfoics"}, map[string]string(nil)},
{"/mock/dir/magic-modules/tools/magician", "git", []string{"clone", "-b", "auto-pr-123456", "https://modular-magician:*******@github.com/modular-magician/docs-examples", "/mock/dir/tfoics"}, map[string]string(nil)},
{"/mock/dir/tfoics", "git", []string{"fetch", "origin", "auto-pr-123456-old"}, map[string]string(nil)},
{"/mock/dir/tpg", "git", []string{"diff", "origin/auto-pr-123456-old", "origin/auto-pr-123456", "--shortstat"}, map[string]string(nil)},
{"/mock/dir/tpg", "git", []string{"diff", "origin/auto-pr-123456-old", "origin/auto-pr-123456", "--name-only"}, map[string]string(nil)},
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,32 @@ func NewMockRunner() MockRunner {
return &mockRunner{
calledMethods: make(map[string][]ParameterList),
cmdResults: map[string]string{
"/mock/dir/magic-modules/.ci/magician git [clone -b auto-pr-123456 https://modular-magician:*******@github.com/modular-magician/docs-examples /mock/dir/tfoics] map[]": "",
"/mock/dir/magic-modules/.ci/magician git [clone -b auto-pr-123456 https://modular-magician:*******@github.com/modular-magician/terraform-google-conversion /mock/dir/tgc] map[]": "",
"/mock/dir/magic-modules/.ci/magician git [clone -b auto-pr-123456 https://modular-magician:*******@github.com/modular-magician/terraform-provider-google /mock/dir/tpg] map[]": "",
"/mock/dir/magic-modules/.ci/magician git [clone -b auto-pr-123456 https://modular-magician:*******@github.com/modular-magician/terraform-provider-google-beta /mock/dir/tpgb] map[]": "",
"/mock/dir/magic-modules/tools/diff-processor bin/diff-processor [breaking-changes] map[]": "",
"/mock/dir/magic-modules/tools/diff-processor make [build] " + sortedEnvString(diffProcessorEnv): "",
"/mock/dir/magic-modules/tools/diff-processor bin/diff-processor [schema-diff] map[]": "{\"AddedResources\": [\"google_alloydb_instance\"]}",
"/mock/dir/magic-modules/tools/diff-processor bin/diff-processor [detect-missing-tests /mock/dir/tpgb/google-beta/services] map[]": `{"google_folder_access_approval_settings":{"SuggestedTest":"resource \"google_folder_access_approval_settings\" \"primary\" {\n uncovered_field = # value needed\n}","Tests":["a","b","c"]}}`,
"/mock/dir/magic-modules/tools/diff-processor bin/diff-processor [detect-missing-docs /mock/dir/tpgb] map[]": `{"Resource":[],"DataSource":[]}`,
"/mock/dir/tgc git [diff origin/auto-pr-123456-old origin/auto-pr-123456 --shortstat] map[]": " 1 file changed, 10 insertions(+)\n",
"/mock/dir/tgc git [fetch origin auto-pr-123456-old] map[]": "",
"/mock/dir/tfoics git [diff origin/auto-pr-123456-old origin/auto-pr-123456 --shortstat] map[]": "",
"/mock/dir/tfoics git [fetch origin auto-pr-123456-old] map[]": "",
"/mock/dir/tpg git [diff origin/auto-pr-123456-old origin/auto-pr-123456 --shortstat] map[]": " 2 files changed, 40 insertions(+)\n",
"/mock/dir/tpg git [fetch origin auto-pr-123456-old] map[]": "",
"/mock/dir/tpgb find [. -type f -name *.go -exec sed -i.bak s~github.com/hashicorp/terraform-provider-google-beta~google/provider/new~g {} +] map[]": "",
"/mock/dir/tpgb git [diff origin/auto-pr-123456-old origin/auto-pr-123456 --shortstat] map[]": " 2 files changed, 40 insertions(+)\n",
"/mock/dir/tpgb git [fetch origin auto-pr-123456-old] map[]": "",
"/mock/dir/tpgb sed [-i.bak s|github.com/hashicorp/terraform-provider-google-beta|google/provider/new|g go.mod] map[]": "",
"/mock/dir/tpgb sed [-i.bak s|github.com/hashicorp/terraform-provider-google-beta|google/provider/new|g go.sum] map[]": "",
"/mock/dir/tpgbold find [. -type f -name *.go -exec sed -i.bak s~github.com/hashicorp/terraform-provider-google-beta~google/provider/old~g {} +] map[]": "",
"/mock/dir/tpgbold git [checkout origin/auto-pr-123456-old] map[]": "",
"/mock/dir/tpgbold sed [-i.bak s|github.com/hashicorp/terraform-provider-google-beta|google/provider/old|g go.mod] map[]": "",
"/mock/dir/tpgbold sed [-i.bak s|github.com/hashicorp/terraform-provider-google-beta|google/provider/old|g go.sum] map[]": "",
"/mock/dir/magic-modules/tools/magician git [clone -b auto-pr-123456 https://modular-magician:*******@github.com/modular-magician/docs-examples /mock/dir/tfoics] map[]": "",
"/mock/dir/magic-modules/tools/magician git [clone -b auto-pr-123456 https://modular-magician:*******@github.com/modular-magician/terraform-google-conversion /mock/dir/tgc] map[]": "",
"/mock/dir/magic-modules/tools/magician git [clone -b auto-pr-123456 https://modular-magician:*******@github.com/modular-magician/terraform-provider-google /mock/dir/tpg] map[]": "",
"/mock/dir/magic-modules/tools/magician git [clone -b auto-pr-123456 https://modular-magician:*******@github.com/modular-magician/terraform-provider-google-beta /mock/dir/tpgb] map[]": "",
"/mock/dir/magic-modules/tools/diff-processor bin/diff-processor [breaking-changes] map[]": "",
"/mock/dir/magic-modules/tools/diff-processor make [build] " + sortedEnvString(diffProcessorEnv): "",
"/mock/dir/magic-modules/tools/diff-processor bin/diff-processor [schema-diff] map[]": "{\"AddedResources\": [\"google_alloydb_instance\"]}",
"/mock/dir/magic-modules/tools/diff-processor bin/diff-processor [detect-missing-tests /mock/dir/tpgb/google-beta/services] map[]": `{"google_folder_access_approval_settings":{"SuggestedTest":"resource \"google_folder_access_approval_settings\" \"primary\" {\n uncovered_field = # value needed\n}","Tests":["a","b","c"]}}`,
"/mock/dir/magic-modules/tools/diff-processor bin/diff-processor [detect-missing-docs /mock/dir/tpgb] map[]": `{"Resource":[],"DataSource":[]}`,
"/mock/dir/tgc git [diff origin/auto-pr-123456-old origin/auto-pr-123456 --shortstat] map[]": " 1 file changed, 10 insertions(+)\n",
"/mock/dir/tgc git [fetch origin auto-pr-123456-old] map[]": "",
"/mock/dir/tfoics git [diff origin/auto-pr-123456-old origin/auto-pr-123456 --shortstat] map[]": "",
"/mock/dir/tfoics git [fetch origin auto-pr-123456-old] map[]": "",
"/mock/dir/tpg git [diff origin/auto-pr-123456-old origin/auto-pr-123456 --shortstat] map[]": " 2 files changed, 40 insertions(+)\n",
"/mock/dir/tpg git [fetch origin auto-pr-123456-old] map[]": "",
"/mock/dir/tpgb find [. -type f -name *.go -exec sed -i.bak s~github.com/hashicorp/terraform-provider-google-beta~google/provider/new~g {} +] map[]": "",
"/mock/dir/tpgb git [diff origin/auto-pr-123456-old origin/auto-pr-123456 --shortstat] map[]": " 2 files changed, 40 insertions(+)\n",
"/mock/dir/tpgb git [fetch origin auto-pr-123456-old] map[]": "",
"/mock/dir/tpgb sed [-i.bak s|github.com/hashicorp/terraform-provider-google-beta|google/provider/new|g go.mod] map[]": "",
"/mock/dir/tpgb sed [-i.bak s|github.com/hashicorp/terraform-provider-google-beta|google/provider/new|g go.sum] map[]": "",
"/mock/dir/tpgbold find [. -type f -name *.go -exec sed -i.bak s~github.com/hashicorp/terraform-provider-google-beta~google/provider/old~g {} +] map[]": "",
"/mock/dir/tpgbold git [checkout origin/auto-pr-123456-old] map[]": "",
"/mock/dir/tpgbold sed [-i.bak s|github.com/hashicorp/terraform-provider-google-beta|google/provider/old|g go.mod] map[]": "",
"/mock/dir/tpgbold sed [-i.bak s|github.com/hashicorp/terraform-provider-google-beta|google/provider/old|g go.sum] map[]": "",
},
cwd: "/mock/dir/magic-modules/.ci/magician",
cwd: "/mock/dir/magic-modules/tools/magician",
dirStack: list.New(),
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading