You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we provide the name or path of the pipeline definition (ado-pipeline) to perform the rewire.
With this value, we look for the definitionId (int) - this is expensive as it is necessary to enumerate all Definitions as the API does not provide a method for this.
// removed code for brevitypublicvirtualasyncTask<int>GetPipelineId(stringorg,stringteamProject,stringpipeline){// Check if we have the pipeline id cached - this will gone after process kill / executionif(_pipelineIds.TryGetValue((org.ToUpper(), teamProject.ToUpper(), pipelinePath.ToUpper()),outvar result)){returnresult;}varurl=$"{_adoBaseUrl}/{org.EscapeDataString()}/{teamProject.EscapeDataString()}/_apis/build/definitions?queryOrder=definitionNameAscending";// expensive callvarresponse=await _client.GetWithPagingAsync(url);
To avoid this, the user could have the option to directly pass definitionId - this would avoid unnecessary calls and make the process faster.
The suggestion is to use the same parameter (ado-pipeline) and in the implementation, consider that it is the definitionId if it is a number, otherwise, follow the current process - convenient for those who do not have the definitionId at hand.
// removed some code for brevitypublicvirtualasyncTask<int> GetPipelineId(stringorg,stringteamProject,stringpipeline){// Check if the pipeline is a number - the id itselfif(int.ParseInt(pipeline,outvar definitionId)){returndefinitionId;}/// continue with the rest of the code
It makes sense? If so, I will provide a PR.
The text was updated successfully, but these errors were encountered:
@tiago-soczek I would suggest creating a new option --ado-pipeline-id instead seeing as we have a very specific use for --ado-pipeline to do the look up of the id.
It also works, using two options it will be necessary to change the validation (--ado-pipeline OR --ado-pipeline-id is mandatory), but I think this is not a problem.
Description
Currently, we provide the name or path of the pipeline definition (ado-pipeline) to perform the rewire.
With this value, we look for the definitionId (int) - this is expensive as it is necessary to enumerate all Definitions as the API does not provide a method for this.
To avoid this, the user could have the option to directly pass definitionId - this would avoid unnecessary calls and make the process faster.
The suggestion is to use the same parameter (ado-pipeline) and in the implementation, consider that it is the definitionId if it is a number, otherwise, follow the current process - convenient for those who do not have the definitionId at hand.
It makes sense? If so, I will provide a PR.
The text was updated successfully, but these errors were encountered: