Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong description and handling in AzureDevOpsAliases.PullRequest #433

Closed
christianbumann opened this issue Oct 11, 2023 · 6 comments
Closed
Labels

Comments

@christianbumann
Copy link
Member

christianbumann commented Oct 11, 2023

The throwExceptionIfPullRequestCouldNotBeFound doesnt' seems to be correct here and in the other method above without this argument.

https://github.com/cake-contrib/Cake.AzureDevOps/blob/681a6268911a14e4ae0e4440ad9bed322859238e/src/Cake.AzureDevOps/AzureDevOpsAliases.PullRequest.cs#L126C26-L126C26

Imho this should be e.g. throwExceptionIfSystemAccessTokenDoesntExists

Maybe als this line doesn't make really sense on the first view. For this line the argument would be ok, but not for the handling above.... maybe there sould be a seconday argument?
https://github.com/cake-contrib/Cake.AzureDevOps/blob/681a6268911a14e4ae0e4440ad9bed322859238e/src/Cake.AzureDevOps/AzureDevOpsAliases.PullRequest.cs#L137C1-L138C1

@christianbumann christianbumann changed the title Wrong description and Handling in AzureDevOpsAliases.PullRequest Wrong description and handling in AzureDevOpsAliases.PullRequest Oct 11, 2023
@pascalberger
Copy link
Member

pascalberger commented Oct 11, 2023

@christianbumann Before diving into implementation details, can you please give some context what (from the public API) you're calling, what's the actual outcome and what would be your expectation?

@christianbumann
Copy link
Member Author

christianbumann commented Oct 11, 2023

@christianbumann Before diving into implementation details, can you please give some context what (from the public API) you're calling, what's the actual outcome and what would be your expectation?

I am using this API
return this.Context.AzureDevOpsPullRequestUsingAzurePipelinesOAuthToken(false);

If there is no PullRequest, I am expect that no Exception will be thrown as described on the API function.
This was working with Version 1.x of Cake.AzureDevOps, but not with 3.0.1 (addition: version 0.5.1, not 1.x)
If you following the code which I described in my second comment above, you will see that this flag doesn't work anymore as expected.

@pascalberger
Copy link
Member

@christianbumann You used version 1.0 or 1.1 where it worked?

@christianbumann
Copy link
Member Author

@christianbumann You used version 1.0 or 1.1 where it worked?

Sorry my fault, ist was version 0.5.1

@pascalberger
Copy link
Member

pascalberger commented Oct 11, 2023

If there is no PullRequest, I am expect that no Exception will be thrown as described on the API function. This was working with Version 1.x of Cake.AzureDevOps, but not with 3.0.1 (addition: version 0.5.1, not 1.x) If you following the code which I described in my second comment above, you will see that this flag doesn't work anymore as expected.

@christianbumann Can you please post the exception message you get?

If it is Failed to read the SYSTEM_PULLREQUEST_PULLREQUESTID environment variable. Make sure you are running in an Azure Pipelines build then this is #435 and will be fixed in upcoming 3.0.2 release.

If it does not find the pull request as you have mentioned then I don't see any changes between < 3.x. In this case please create a repro in a GitHub or public Azure Repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants