From 64c6a5b85160cebc94cc9ec0dd0c0b7b013f691a Mon Sep 17 00:00:00 2001 From: Pete Davison Date: Sat, 3 Jun 2023 23:25:30 +0000 Subject: [PATCH] feat: update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 21 +++++++++++++-------- .github/ISSUE_TEMPLATE/feature_request.md | 16 ++++++++++------ CHANGELOG.md | 2 ++ setup.go | 6 +++++- task_test.go | 16 ++++++++++++++-- 5 files changed, 44 insertions(+), 17 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 830e671301..d2c7d29971 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -3,13 +3,18 @@ name: Bug Report about: Use this to report bugs and issues --- -> Thanks for your bug report! -> -> Before submitting this issue, please make sure the same problem was -> not already reported by someone else. -> -> Please describe the bug you're facing. Consider pasting example -> Taskfiles showing how to reproduce the problem. + - Task version: -- Operating System: +- Operating system: +- Experiments enabled: diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 41d78a398b..6a711ee1f4 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -3,9 +3,13 @@ name: Feature Request about: Use this to make feature requests --- -> Describe in detail what feature do you want to see in Task. -> Give examples if possible. -> -> Please, search if this wasn't proposed before, and if this is more like an idea -> than a strong feature request, consider opening a -> [discussion](https://github.com/go-task/task/discussions) instead. + diff --git a/CHANGELOG.md b/CHANGELOG.md index b962c93ddf..d55e76ddc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ #1194 by @deviantintegral). - Added [experiments documentation](https://taskfile.dev/experiments) to the website (#1198 by @pd93). +- Deprecated `version: 2` schema. This will be removed in the next major release + (#1197, #1198, #1199 by @pd93). ## v3.25.0 - 2023-05-22 diff --git a/setup.go b/setup.go index 2eb72a87b6..060cc7821f 100644 --- a/setup.go +++ b/setup.go @@ -250,7 +250,11 @@ func (e *Executor) doVersionChecks() error { *v = *e.Taskfile.Version if v.LessThan(taskfile.V2) { - return fmt.Errorf(`task: Taskfile versions prior to v2 are not supported anymore`) + return fmt.Errorf(`task: version 1 schemas are no longer supported`) + } + + if v.LessThan(taskfile.V3) { + e.Logger.Errf(logger.Yellow, "task: version 2 schemas are deprecated and will be removed in a future release\nSee https://github.com/go-task/task/issues/1197 for more details\n") } // consider as equal to the greater version if round diff --git a/task_test.go b/task_test.go index e238e95dfb..4046a7a853 100644 --- a/task_test.go +++ b/task_test.go @@ -1371,7 +1371,7 @@ func TestDynamicVariablesShouldRunOnTheTaskDir(t *testing.T) { tt.Run(t) } -func TestDisplaysErrorOnUnsupportedVersion(t *testing.T) { +func TestDisplaysErrorOnVersion1Schema(t *testing.T) { e := task.Executor{ Dir: "testdata/version/v1", Stdout: io.Discard, @@ -1379,7 +1379,19 @@ func TestDisplaysErrorOnUnsupportedVersion(t *testing.T) { } err := e.Setup() require.Error(t, err) - assert.Equal(t, "task: Taskfile versions prior to v2 are not supported anymore", err.Error()) + assert.Equal(t, "task: version 1 schemas are no longer supported", err.Error()) +} + +func TestDisplaysWarningOnVersion2Schema(t *testing.T) { + var buff bytes.Buffer + e := task.Executor{ + Dir: "testdata/version/v2", + Stdout: io.Discard, + Stderr: &buff, + } + err := e.Setup() + require.NoError(t, err) + assert.Equal(t, "task: version 2 schemas are deprecated and will be removed in a future release\nSee https://github.com/go-task/task/issues/1197 for more details\n", buff.String()) } func TestShortTaskNotation(t *testing.T) {