Sync upstream v11.1.1 (merge conflicts)#72
Conversation
Co-authored-by: Alexander Kolotov <alexander.kolotov@gmail.com> Co-authored-by: Maxim Filonov <53992153+sl1depengwyn@users.noreply.github.com> Co-authored-by: Victor Baranov <baranov.viktor.27@gmail.com> Co-authored-by: Qwerty5Uiop <105209995+Qwerty5Uiop@users.noreply.github.com>
…oints (blockscout#14227) Co-authored-by: Alexander Kolotov <alexander.kolotov@gmail.com> Co-authored-by: Maxim Filonov <53992153+sl1depengwyn@users.noreply.github.com> Co-authored-by: Victor Baranov <baranov.viktor.27@gmail.com> Co-authored-by: Qwerty5Uiop <105209995+Qwerty5Uiop@users.noreply.github.com>
…ut#14251) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Alexander Kolotov <alexander.kolotov@gmail.com> Co-authored-by: Victor Baranov <baranov.viktor.27@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nikita Pozdniakov <nikitosing4@mail.ru> Co-authored-by: Maxim Filonov <53992153+sl1depengwyn@users.noreply.github.com> Co-authored-by: Qwerty5Uiop <alex000010@bk.ru> Co-authored-by: Qwerty5Uiop <105209995+Qwerty5Uiop@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#14350) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Victor Baranov <baranov.viktor.27@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…14385) Co-authored-by: Cursor <cursoragent@cursor.com>
…CY (blockscout#14390) Co-authored-by: Victor Baranov <baranov.viktor.27@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…14396) Co-authored-by: Victor Baranov <baranov.viktor.27@gmail.com>
…ockscout#14399) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive OpenAPI specification framework, including a new inspector agent, detailed authoring skills, and extensive annotations for the Advanced Filter and Arbitrum controllers. It also standardizes parameter handling by migrating to atom-keyed maps via the CastAndValidate plug. Several critical issues were identified in the AdvancedFilterController, including potential runtime crashes due to strict pattern matching on optional parameters, a missing module attribute that would prevent compilation, and a pagination bug where an atom key is passed instead of a required string key.
|
|
||
| next_page_params = | ||
| next_page |> next_page_params(advanced_filters, Map.take(params, ["items_count"]), false, &paging_params/1) | ||
| next_page |> next_page_params(advanced_filters, Map.take(params, [:items_count]), false, &paging_params/1) |
There was a problem hiding this comment.
Passing :items_count as an atom key to next_page_params/5 will likely break the cumulative item count in pagination. The standard BlockScoutWeb.Chain.next_page_params/5 helper expects string keys in the extra_params map. Using an atom key here will result in the helper failing to find the existing count, causing it to reset to 0 on every page.
next_page |> next_page_params(advanced_filters, %{"items_count" => params[:items_count]}, false, &paging_params/1)
| @spec list_methods(Plug.Conn.t(), map()) :: {:method, nil | Explorer.Chain.ContractMethod.t()} | Plug.Conn.t() | ||
| def list_methods(conn, %{"q" => query}) do | ||
| @spec list_methods(Plug.Conn.t(), map()) :: Plug.Conn.t() | ||
| def list_methods(conn, %{q: query}) when is_binary(query) do |
There was a problem hiding this comment.
The list_methods/2 action now strictly matches on the presence of the q parameter. Since q is defined as optional in the OpenAPI spec, a request without this parameter will result in a FunctionClauseError. A fallback clause should be added to handle the default case as described in the endpoint documentation.
| defp merge_methods(a, b) do | ||
| (List.wrap(a) ++ List.wrap(b)) | ||
| |> Enum.uniq() | ||
| |> Enum.take(@methods_filter_limit) |
| defp paging_options(%{ | ||
| "block_number" => block_number_string, | ||
| "transaction_index" => transaction_index_string, | ||
| "internal_transaction_index" => internal_transaction_index_string, | ||
| "token_transfer_index" => token_transfer_index_string, | ||
| "token_transfer_batch_index" => token_transfer_batch_index_string | ||
| block_number: block_number_string, | ||
| transaction_index: transaction_index_string, | ||
| internal_transaction_index: internal_transaction_index_string, | ||
| token_transfer_index: token_transfer_index_string, | ||
| token_transfer_batch_index: token_transfer_batch_index_string | ||
| }) do |
There was a problem hiding this comment.
The strict map pattern match in paging_options/1 will cause a FunctionClauseError when any of the optional pagination parameters are missing from the request. Since CastAndValidate does not populate missing optional parameters in the atom-keyed map, this function should handle partial maps or use Map.get/3.
defp paging_options(params) do
block_number_string = params[:block_number]
transaction_index_string = params[:transaction_index]
internal_transaction_index_string = params[:internal_transaction_index]
token_transfer_index_string = params[:token_transfer_index]
token_transfer_batch_index_string = params[:token_transfer_batch_index]
64009d6 to
8c84e94
Compare
8c84e94 to
709702b
Compare
Upstream Sync - v11.1.1
Auto-merge with upstream
v11.1.1failed. Version/workflow conflicts were auto-resolved,but the following files have code conflicts that need manual resolution:
To resolve:
v11.1.1to trigger Docker buildUpstream release notes