Add validation to get_sdk_pull_request_link for work item id#12127
Add validation to get_sdk_pull_request_link for work item id#12127smw-ms wants to merge 0 commit into
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds validation to ensure a work item ID is provided when retrieving SDK pull request details, removing the option to use a build ID as an alternative parameter.
- Simplifies parameter validation by requiring only work item ID instead of allowing either build ID or work item ID
- Updates error message to reflect the new requirement
| if (workItemId == 0) | ||
| { | ||
| return "Either build ID or release plan work item ID is required to get SDK pull request details."; | ||
| return "Release plan work item ID is required to get SDK pull request details."; | ||
| } |
There was a problem hiding this comment.
This change removes the ability to use build ID as an alternative to work item ID, which is a breaking change. Consider if existing callers rely on the build ID parameter, and ensure this breaking change is intentional and properly communicated.
maririos
left a comment
There was a problem hiding this comment.
I don't understand how the work item ID is important for getting the SKD PR from an SDK pipeline.
We want to find the SDK both ways. from the pipeline or from the work item. but they should be independent
| } | ||
|
|
||
| if (buildId == 0 && workItemId == 0) | ||
| if (workItemId == 0) |
There was a problem hiding this comment.
why is the workItem ID required if we have the buildId?
There was a problem hiding this comment.
We should not do this change. It will effectively enforce a release plan as mandatory to run SDK generation and we don't want to do that. We need to check why did the tool failed to get SDK details from build ID. WorkItemId is optional.
79c74a3 to
cab9a03
Compare
#12083
Need a valid work item id for the code to work with or without a
buildId