Skip to content

Commit

Permalink
Add mentoring_request_url param to feedback_request comment (#421)
Browse files Browse the repository at this point in the history
* Add mentoring_request_url param to feedback_request comment

* Adjust smoke test data
  • Loading branch information
angelikatyborska authored Feb 19, 2024
1 parent 6c92d6c commit 49fd446
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 9 deletions.
6 changes: 5 additions & 1 deletion lib/elixir_analyzer/submission.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 32 additions & 4 deletions test/elixir_analyzer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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. 📣"
}
Expand Down Expand Up @@ -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. 📣"
}
Expand Down Expand Up @@ -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. 📣"
}
Expand All @@ -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. 📣"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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. 📣"}
2 changes: 1 addition & 1 deletion test_data/lasagna/failing_solution/expected_analysis.json
Original file line number Diff line number Diff line change
@@ -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. 📣"}
Original file line number Diff line number Diff line change
@@ -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. 🛠"}

Original file line number Diff line number Diff line change
@@ -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. 📣"}

0 comments on commit 49fd446

Please sign in to comment.