From 191dc517dc7e10faf713b8e39b357de8251768b6 Mon Sep 17 00:00:00 2001 From: Angelika Tyborska Date: Sun, 18 Feb 2024 18:37:44 +0100 Subject: [PATCH 1/2] Add mentoring_request_url param to feedback_request comment --- lib/elixir_analyzer/submission.ex | 6 +++++- test/elixir_analyzer_test.exs | 36 +++++++++++++++++++++++++++---- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/lib/elixir_analyzer/submission.ex b/lib/elixir_analyzer/submission.ex index 2b2bde42..ae182b34 100644 --- a/lib/elixir_analyzer/submission.ex +++ b/lib/elixir_analyzer/submission.ex @@ -103,7 +103,11 @@ defmodule ElixirAnalyzer.Submission do [ %{ type: :informative, - comment: Constants.general_feedback_request() + comment: Constants.general_feedback_request(), + params: %{ + mentoring_request_url: + "https://exercism.org/tracks/elixir/exercises/#{submission.source.slug}/mentor_discussions" + } } ] else diff --git a/test/elixir_analyzer_test.exs b/test/elixir_analyzer_test.exs index 5c8f656b..aff76636 100644 --- a/test/elixir_analyzer_test.exs +++ b/test/elixir_analyzer_test.exs @@ -71,7 +71,14 @@ defmodule ElixirAnalyzerTest do }, "type" => "informative" }, - %{"comment" => "elixir.general.feedback_request", "type" => "informative"} + %{ + "comment" => "elixir.general.feedback_request", + "type" => "informative", + "params" => %{ + "mentoring_request_url" => + "https://exercism.org/tracks/elixir/exercises/two-fer/mentor_discussions" + } + } ], "summary" => "Check the comments for some suggestions. 📣" } @@ -202,7 +209,14 @@ defmodule ElixirAnalyzerTest do }, "type" => "informative" }, - %{"comment" => "elixir.general.feedback_request", "type" => "informative"} + %{ + "comment" => "elixir.general.feedback_request", + "type" => "informative", + "params" => %{ + "mentoring_request_url" => + "https://exercism.org/tracks/elixir/exercises/not-a-real-exercise/mentor_discussions" + } + } ], "summary" => "Check the comments for some suggestions. 📣" } @@ -270,7 +284,14 @@ defmodule ElixirAnalyzerTest do "type" => "informative" }, %{"comment" => "elixir.solution.todo_comment", "type" => "informative"}, - %{"comment" => "elixir.general.feedback_request", "type" => "informative"} + %{ + "comment" => "elixir.general.feedback_request", + "type" => "informative", + "params" => %{ + "mentoring_request_url" => + "https://exercism.org/tracks/elixir/exercises/lasagna/mentor_discussions" + } + } ], "summary" => "Check the comments for some suggestions. 📣" } @@ -294,7 +315,14 @@ defmodule ElixirAnalyzerTest do }, "type" => "actionable" }, - %{"comment" => "elixir.general.feedback_request", "type" => "informative"} + %{ + "comment" => "elixir.general.feedback_request", + "type" => "informative", + "params" => %{ + "mentoring_request_url" => + "https://exercism.org/tracks/elixir/exercises/lasagna/mentor_discussions" + } + } ], "summary" => "Check the comments for some suggestions. 📣" } From 8155a9eb22eaea4405934aa41884bd88cd4fafda Mon Sep 17 00:00:00 2001 From: Angelika Tyborska Date: Sun, 18 Feb 2024 18:46:45 +0100 Subject: [PATCH 2/2] Adjust smoke test data --- test_data/lasagna/deprecated_modules/expected_analysis.json | 2 +- test_data/lasagna/failing_solution/expected_analysis.json | 2 +- test_data/square-root/split_solution/expected_analysis.json | 2 +- test_data/two_fer/imperfect_solution/expected_analysis.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test_data/lasagna/deprecated_modules/expected_analysis.json b/test_data/lasagna/deprecated_modules/expected_analysis.json index ce50ddb9..314976e2 100644 --- a/test_data/lasagna/deprecated_modules/expected_analysis.json +++ b/test_data/lasagna/deprecated_modules/expected_analysis.json @@ -1 +1 @@ -{"comments":[{"comment":"elixir.solution.compiler_warnings","params":{"warnings":"warning: Behaviour.defcallback/1 is deprecated. Use the @callback module attribute instead\n lib/lasagna.ex:4:13\n\nwarning: HashDict.new/0 is deprecated. Use maps and the Map module instead\n lib/lasagna.ex:7:14\n\nwarning: HashSet.member?/2 is deprecated. Use the MapSet module instead\n lib/lasagna.ex:12:13\n\nwarning: HashSet.new/0 is deprecated. Use the MapSet module instead\n lib/lasagna.ex:12:29\n\n"},"type":"actionable"},{"comment":"elixir.general.feedback_request","type":"informative"}],"summary":"Check the comments for some suggestions. 📣"} +{"comments":[{"comment":"elixir.solution.compiler_warnings","params":{"warnings":"warning: Behaviour.defcallback/1 is deprecated. Use the @callback module attribute instead\n lib/lasagna.ex:4:13\n\nwarning: HashDict.new/0 is deprecated. Use maps and the Map module instead\n lib/lasagna.ex:7:14\n\nwarning: HashSet.member?/2 is deprecated. Use the MapSet module instead\n lib/lasagna.ex:12:13\n\nwarning: HashSet.new/0 is deprecated. Use the MapSet module instead\n lib/lasagna.ex:12:29\n\n"},"type":"actionable"},{"comment":"elixir.general.feedback_request","type":"informative","params": {"mentoring_request_url":"https://exercism.org/tracks/elixir/exercises/lasagna/mentor_discussions"}}],"summary":"Check the comments for some suggestions. 📣"} diff --git a/test_data/lasagna/failing_solution/expected_analysis.json b/test_data/lasagna/failing_solution/expected_analysis.json index 13cc374c..05711cde 100644 --- a/test_data/lasagna/failing_solution/expected_analysis.json +++ b/test_data/lasagna/failing_solution/expected_analysis.json @@ -1 +1 @@ -{"comments":[{"comment":"elixir.lasagna.function_reuse","type":"actionable"},{"comment":"elixir.solution.private_helper_functions","params":{"actual":"def public_helper(_)","expected":"defp public_helper(_)"},"type":"informative"},{"comment":"elixir.solution.todo_comment","type":"informative"},{"comment":"elixir.general.feedback_request","type":"informative"}],"summary":"Check the comments for some suggestions. 📣"} +{"comments":[{"comment":"elixir.lasagna.function_reuse","type":"actionable"},{"comment":"elixir.solution.private_helper_functions","params":{"actual":"def public_helper(_)","expected":"defp public_helper(_)"},"type":"informative"},{"comment":"elixir.solution.todo_comment","type":"informative"},{"comment":"elixir.general.feedback_request","type":"informative","params": {"mentoring_request_url":"https://exercism.org/tracks/elixir/exercises/lasagna/mentor_discussions"}}],"summary":"Check the comments for some suggestions. 📣"} diff --git a/test_data/square-root/split_solution/expected_analysis.json b/test_data/square-root/split_solution/expected_analysis.json index e9055922..b4348d75 100644 --- a/test_data/square-root/split_solution/expected_analysis.json +++ b/test_data/square-root/split_solution/expected_analysis.json @@ -1,2 +1,2 @@ -{"comments":[{"comment":"elixir.square-root.do_not_use_built_in_sqrt","type":"essential"},{"comment":"elixir.general.feedback_request","type":"informative"}],"summary":"Check the comments for things to fix. 🛠"} +{"comments":[{"comment":"elixir.square-root.do_not_use_built_in_sqrt","type":"essential"},{"comment":"elixir.general.feedback_request","type":"informative","params": {"mentoring_request_url":"https://exercism.org/tracks/elixir/exercises/square-root/mentor_discussions"}}],"summary":"Check the comments for things to fix. 🛠"} diff --git a/test_data/two_fer/imperfect_solution/expected_analysis.json b/test_data/two_fer/imperfect_solution/expected_analysis.json index d5c8bcf3..3f53bb74 100644 --- a/test_data/two_fer/imperfect_solution/expected_analysis.json +++ b/test_data/two_fer/imperfect_solution/expected_analysis.json @@ -1 +1 @@ -{"comments":[{"comment":"elixir.solution.raise_fn_clause_error","type":"actionable"},{"comment":"elixir.solution.variable_name_snake_case","params":{"actual":"_nameInPascalCase","expected":"_name_in_pascal_case"},"type":"actionable"},{"comment":"elixir.solution.module_attribute_name_snake_case","params":{"actual":"someUnusedModuleAttribute","expected":"some_unused_module_attribute"},"type":"actionable"},{"comment":"elixir.solution.module_pascal_case","params":{"actual":"My_empty_module","expected":"MyEmptyModule"},"type":"actionable"},{"comment":"elixir.solution.compiler_warnings","params":{"warnings":"warning: module attribute @someUnusedModuleAttribute was set but never used\n lib/two_fer.ex:2\n\n"},"type":"actionable"},{"comment":"elixir.solution.indentation","type":"informative"},{"comment":"elixir.solution.private_helper_functions","params":{"actual":"def public_helper(_)","expected":"defp public_helper(_)"},"type":"informative"},{"comment":"elixir.general.feedback_request","type":"informative"}],"summary":"Check the comments for some suggestions. 📣"} +{"comments":[{"comment":"elixir.solution.raise_fn_clause_error","type":"actionable"},{"comment":"elixir.solution.variable_name_snake_case","params":{"actual":"_nameInPascalCase","expected":"_name_in_pascal_case"},"type":"actionable"},{"comment":"elixir.solution.module_attribute_name_snake_case","params":{"actual":"someUnusedModuleAttribute","expected":"some_unused_module_attribute"},"type":"actionable"},{"comment":"elixir.solution.module_pascal_case","params":{"actual":"My_empty_module","expected":"MyEmptyModule"},"type":"actionable"},{"comment":"elixir.solution.compiler_warnings","params":{"warnings":"warning: module attribute @someUnusedModuleAttribute was set but never used\n lib/two_fer.ex:2\n\n"},"type":"actionable"},{"comment":"elixir.solution.indentation","type":"informative"},{"comment":"elixir.solution.private_helper_functions","params":{"actual":"def public_helper(_)","expected":"defp public_helper(_)"},"type":"informative"},{"comment":"elixir.general.feedback_request","type":"informative","params": {"mentoring_request_url":"https://exercism.org/tracks/elixir/exercises/two_fer/mentor_discussions"}}],"summary":"Check the comments for some suggestions. 📣"}