From 8ba28242d0e9fc9359d9501230682f7238c03c9c Mon Sep 17 00:00:00 2001 From: Brad Moylan Date: Wed, 25 Oct 2023 14:48:03 -0400 Subject: [PATCH 1/5] improvement: Add mod-plugin to default tasks --- .../godellauncher/defaulttasks/defaulttasks.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/framework/godellauncher/defaulttasks/defaulttasks.go b/framework/godellauncher/defaulttasks/defaulttasks.go index 167c2350..dfbd756e 100644 --- a/framework/godellauncher/defaulttasks/defaulttasks.go +++ b/framework/godellauncher/defaulttasks/defaulttasks.go @@ -233,6 +233,19 @@ var defaultPluginsConfig = config.PluginsConfig{ }), }), }, + { + LocatorWithResolverConfig: config.ToLocatorWithResolverConfig(config.LocatorWithResolverConfig{ + Locator: config.ToLocatorConfig(config.LocatorConfig{ + ID: "com.palantir.godel-mod-plugin:mod-plugin:1.33.0", + Checksums: map[string]string{ + "darwin-amd64": "ccc2d3e011108ab5610281b31cd1bdcb04f76c346f957882dc747e90ad4de29d", + "darwin-arm64": "e8497f8ab8ebf09be3e43f0ebc9d5f958f848c58a4f3b1a12e2174009c3f5d2f", + "linux-amd64": "97e97d474dbf08708bbb6e494699e0fe174cfb31bd6e0526f87804dffd1d97a5", + "linux-arm64": "03cc1a89d2fc6820a8ff0ac7e2774c932ee0afad9ef2801fc3300e73a7ca8a34", + }, + }), + }), + }, }), } From cc5b66aa5a434d7be07e35321b623a6f62ab0c8f Mon Sep 17 00:00:00 2001 From: svc-changelog Date: Wed, 25 Oct 2023 18:50:24 +0000 Subject: [PATCH 2/5] Add generated changelog entries --- changelog/@unreleased/pr-768.v2.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelog/@unreleased/pr-768.v2.yml diff --git a/changelog/@unreleased/pr-768.v2.yml b/changelog/@unreleased/pr-768.v2.yml new file mode 100644 index 00000000..7aa8ef4a --- /dev/null +++ b/changelog/@unreleased/pr-768.v2.yml @@ -0,0 +1,5 @@ +type: improvement +improvement: + description: Add mod-plugin to default tasks + links: + - https://github.com/palantir/godel/pull/768 From 735e0a21d85c5b5d29dcf2b7665c9c725673e9da Mon Sep 17 00:00:00 2001 From: Brad Moylan Date: Wed, 25 Oct 2023 16:19:43 -0400 Subject: [PATCH 3/5] skip mod in tests --- integration_test/plugins_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/integration_test/plugins_test.go b/integration_test/plugins_test.go index aded7ab2..e8a209e9 100644 --- a/integration_test/plugins_test.go +++ b/integration_test/plugins_test.go @@ -87,14 +87,14 @@ plugins: wantOutput = fmt.Sprintf("--project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml echo foo --bar baz\n", testProjectDir, testProjectDir, testProjectDir, pluginName) assert.Equal(t, wantOutput, gotOutput) - gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-test") + gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-mod", "--skip-test") wantOutput = fmt.Sprintf(`Running format... Running echo-task... --project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml echo `, testProjectDir, testProjectDir, testProjectDir, pluginName) assert.Equal(t, wantOutput, gotOutput) - gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-test", "--apply=false") + gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-mod", "--skip-test", "--apply=false") wantOutput = fmt.Sprintf(`Running format... Running echo-task... --project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml echo --verify @@ -168,14 +168,14 @@ plugins: wantOutput = fmt.Sprintf("--project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml --assets %s echo foo --bar baz\n", testProjectDir, testProjectDir, testProjectDir, pluginName, assetPath) assert.Equal(t, wantOutput, gotOutput) - gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-test") + gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-mod", "--skip-test") wantOutput = fmt.Sprintf(`Running format... Running echo-task... --project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml --assets %s echo `, testProjectDir, testProjectDir, testProjectDir, pluginName, assetPath) assert.Equal(t, wantOutput, gotOutput) - gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-test", "--apply=false") + gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-mod", "--skip-test", "--apply=false") wantOutput = fmt.Sprintf(`Running format... Running echo-task... --project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml --assets %s echo --verify @@ -237,14 +237,14 @@ tasks-config-providers: wantOutput = fmt.Sprintf("--project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml echo foo --bar baz\n", testProjectDir, testProjectDir, testProjectDir, pluginName) assert.Equal(t, wantOutput, gotOutput) - gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-test") + gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-mod", "--skip-test") wantOutput = fmt.Sprintf(`Running format... Running echo-task... --project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml echo `, testProjectDir, testProjectDir, testProjectDir, pluginName) assert.Equal(t, wantOutput, gotOutput) - gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-test", "--apply=false") + gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-mod", "--skip-test", "--apply=false") wantOutput = fmt.Sprintf(`Running format... Running echo-task... --project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml echo --verify From 1d768e039d5779f2d2d42d317149002af43fc3bb Mon Sep 17 00:00:00 2001 From: Brad Moylan Date: Wed, 25 Oct 2023 16:43:22 -0400 Subject: [PATCH 4/5] skip mod in tests --- integration_test/integration_verify_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration_test/integration_verify_test.go b/integration_test/integration_verify_test.go index cab04f52..c862bb46 100644 --- a/integration_test/integration_verify_test.go +++ b/integration_test/integration_verify_test.go @@ -77,7 +77,7 @@ func TestFoo(t *testing.T) { args []string want string }{ - {want: `(?s).+Failed tasks:\n\tformat --verify\n\tlicense --verify\n\tcheck\n\ttest`}, + {want: `(?s).+Failed tasks:\n\tformat --verify\n\tmod --verify\n\tlicense --verify\n\tcheck\n\ttest`}, {args: []string{"--skip-format"}, want: `(?s).+Failed tasks:\n\tlicense --verify\n\tcheck\n\ttest`}, {args: []string{"--skip-check"}, want: `(?s).+Failed tasks:\n\tformat --verify\n\tlicense --verify\n\ttest`}, {args: []string{"--skip-license"}, want: `(?s).+Failed tasks:\n\tformat --verify\n\tcheck\n\ttest`}, @@ -280,7 +280,7 @@ func TestFooIntegration(t *testing.T) {} require.NoError(t, err) // run verify with "none" tags. Should include output for main package but not for integration_test package. - cmd := exec.Command("./godelw", "verify", "--apply=false", "--tags=none") + cmd := exec.Command("./godelw", "verify", "--skip-mod", "--apply=false", "--tags=none") cmd.Dir = testProjectDir output, err := cmd.CombinedOutput() outputStr := string(output) From 4507ed5d9a64b618d51b5741783861e6a98758a4 Mon Sep 17 00:00:00 2001 From: Brad Moylan Date: Wed, 25 Oct 2023 16:53:02 -0400 Subject: [PATCH 5/5] skip mod in tests --- integration_test/integration_verify_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration_test/integration_verify_test.go b/integration_test/integration_verify_test.go index c862bb46..7f4daa07 100644 --- a/integration_test/integration_verify_test.go +++ b/integration_test/integration_verify_test.go @@ -289,7 +289,7 @@ func TestFooIntegration(t *testing.T) {} assert.NotRegexp(t, fmt.Sprintf(`(?s).+%s\s+[0-9.]+s.+`, files["integration_tests/integration_test.go"].ImportPath), outputStr) // run verify with "all" tags. Should include output for integration_test package but not for main package. - cmd = exec.Command("./godelw", "verify", "--apply=false", "--tags=all") + cmd = exec.Command("./godelw", "verify", "--skip-mod", "--apply=false", "--tags=all") cmd.Dir = testProjectDir output, err = cmd.CombinedOutput() outputStr = string(output) @@ -298,7 +298,7 @@ func TestFooIntegration(t *testing.T) {} assert.NotRegexp(t, fmt.Sprintf(`(?s).+%s\s+[0-9.]+s.+`, files["main.go"].ImportPath), outputStr) // run verify in regular mode. Should include output for all tests. - cmd = exec.Command("./godelw", "verify", "--apply=false") + cmd = exec.Command("./godelw", "verify", "--skip-mod", "--apply=false") cmd.Dir = testProjectDir output, err = cmd.CombinedOutput() outputStr = string(output)