Add linter rule arm-post-lro-response-mismatch for ARM POST LRO operations - #4145
Add linter rule arm-post-lro-response-mismatch for ARM POST LRO operations#4145Mark Cowlishaw (markcowl) with Copilot wants to merge 70 commits into
arm-post-lro-response-mismatch for ARM POST LRO operations#4145Conversation
…tions Agent-Logs-Url: https://github.com/Azure/typespec-azure/sessions/7bf3456e-7b67-406e-a438-d26cf5637117 Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
…-lro-response-mismatch Agent-Logs-Url: https://github.com/Azure/typespec-azure/sessions/7bf3456e-7b67-406e-a438-d26cf5637117 Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
arm-post-lro-response-mismatch for ARM POST LRO operations
Mark Cowlishaw (markcowl)
left a comment
There was a problem hiding this comment.
Copilot Pull the latest from main and then apply the fixes in the comments. Ensure that all tests pass and all files are correctly formatted.
…r-arm-post-lro Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Azure/typespec-azure/sessions/52cf9dab-ba01-4457-92cd-cd8badcefa7d Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
|
Copilot Please pull the latest from main, regenrate docs for tyepspec-azure-resource-manager, validate that all files are correctly formatted. |
Agent-Logs-Url: https://github.com/Azure/typespec-azure/sessions/f4c32a71-7b4b-4f80-ba9b-5ba00fbfab8b Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Pulled latest from main (already up to date at a228fc5), regenerated docs for typespec-azure-resource-manager (added the new rule to README.md and linter.md), validated formatting, and confirmed all 286 tests pass. Done in 7e87831. |
Mark Cowlishaw (markcowl)
left a comment
There was a problem hiding this comment.
Please pull the latest from main, make the changes suggested, ensure all tests are passing and all files are correctly formatted.
…finalResult Agent-Logs-Url: https://github.com/Azure/typespec-azure/sessions/1f249f2b-9ceb-48a6-ba20-2449bb561b02 Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Pulled latest from main (already up to date), added the fallback for non-template operations that checks the 200 response body vs final-result-schema, and verified all 288 tests pass with correct formatting. Done in fcb4809. |
Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Reverted |
|
Copilot there is a merge issue with readme.md (generated by rebuilding docs for typespec-azure-resource-manager). Please pull the latest, rebuild and regen docs, ensure that all files are correctly formatted, any merge conflicts are fixed and only the changes associated with this pr are in the pr diff. |
…r-arm-post-lro # Conflicts: # packages/typespec-azure-resource-manager/README.md # packages/typespec-azure-resource-manager/src/rules/lro-response-mismatch.md Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Pulled latest from main, resolved the README.md merge conflict (took main's version then regenerated docs), all 377 tests pass, files formatted, only PR-related files in the diff. |
Mark Cowlishaw (markcowl)
left a comment
There was a problem hiding this comment.
Copilot it looks like you missed change the rule source file name and the function name for the rule to match the new rule name (no-lro-response-mismatch). Please pull the latest from main, make these changes, rebuild and regenerate docs, ensure all tests pass and all changed files are properly formatted, then ensure that only the changes associated with this pr are in the pr diff.
…r-arm-post-lro Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Renamed source file to |
Mark Model, Operation, Program, Type, HttpOperationResponse, HttpPayloadBody, ArmResourceOperation and ResolvedResource as type-only imports to satisfy verbatimModuleSyntax. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58ecbd2d-0593-429f-be07-b8a97dbbefa4
|
suppression pr: Azure/azure-rest-api-specs#45314 Private suppression pr: https://github.com/Azure/azure-rest-api-specs-pr/pull/29906 |
📦 Package size report✅ No notable package size changes compared to the base branch. 13 package(s) with no notable change
Packed = gzipped |
…le doc Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58ecbd2d-0593-429f-be07-b8a97dbbefa4
Mark Cowlishaw (markcowl)
left a comment
There was a problem hiding this comment.
Please fix these two issues
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58ecbd2d-0593-429f-be07-b8a97dbbefa4
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58ecbd2d-0593-429f-be07-b8a97dbbefa4
arm-post-lro-response-mismatchfor ARM POST LRO operations"void""void""void"conflictingResponsesdiagnostic (POST should not have both 204 NoContent and 200 OK with a non-empty body)Azure.ResourceManager.ActionAsync(fully-qualified name) for Response param match with finalResultdoesFinalResultMatchchecks both namespace-qualified name equality (for named types) andisAssignableTofrom typekit for type compatibility"void"finalResult is compared against TypeSpec builtin void type viaisVoidTyperesolveArmResourcesfor both resource-level and provider-level actionsarm-post-lro-set-final-resultusingArmLroLocationHeader<FinalResult = ResponseType>— handles:resolveArmResourceOperations: raw@armResourceActionoperations (with simple HTTP paths like/generate) are now properly discovered by matching against already-resolved resources when path-based resolution fails. Previously these operations were silently dropped becausegetResourceInfocouldn't derive ARM resource type info from relative paths....ResourceNameParameter<Employee>throughoutit.eachfor parameterized type matching/non-matching scenariosArmAcceptedLroResponsefor proper LRO constructs: invalid case (200 with Model body + ArmAcceptedLroResponse) and valid case (204 + ArmAcceptedLroResponse)💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.