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

APIView pipeline job must update comment when APIView job fails #5377

Closed
Tracked by #5761
mikekistler opened this issue Feb 8, 2023 · 7 comments
Closed
Tracked by #5761

APIView pipeline job must update comment when APIView job fails #5377

mikekistler opened this issue Feb 8, 2023 · 7 comments
Assignees
Labels
APIView Central-EngSys This issue is owned by the Engineering System team.
Milestone

Comments

@mikekistler
Copy link
Member

mikekistler commented Feb 8, 2023

The APIView PR pipeline job posts a comment in the PR to say that it has begun generation of an APIView:

image

But if APIView generation fails, the comment is not always updated to indicate that processing failed and why.

The APIView pipeline job should ensure that this comment is updated, whatever the outcome of the processing.

Also, the PR Check should not report "Succeeded" when it has actually failed.

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Feb 8, 2023
@mikekistler mikekistler added APIView Central-EngSys This issue is owned by the Engineering System team. and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Feb 8, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in ApiView Feb 8, 2023
@mikekistler mikekistler moved this from 🆕 New to 📋 Backlog in ApiView Feb 8, 2023
@chidozieononiwu chidozieononiwu moved this from 🤔Triage to 🐝 Dev in Azure SDK EngSys 🚢🎉 Mar 2, 2023
@chidozieononiwu chidozieononiwu added this to the 2023-03 milestone Mar 2, 2023
@praveenkuttappan praveenkuttappan moved this from 📋 Backlog to 🏗 In progress in ApiView Mar 8, 2023
@chidozieononiwu
Copy link
Member

The APIView PR pipeline job posts a comment in the PR to say that it has begun generation of an APIView:

image

But if APIView generation fails, the comment is not always updated to indicate that processing failed and why.

The APIView pipeline job should ensure that this comment is updated, whatever the outcome of the processing.

The comment is updated if APIView generation fails. The only case where it's not updated is if all the APIViews are skipped.

@chidozieononiwu
Copy link
Member

chidozieononiwu commented Mar 17, 2023

Another thing to keep in mind is that the pipeline might generate SDK and Swagger APIReview. While it aggregates all the results in the pipeline under the Generated APIReview Comment
SwaggerAPIReviewComment
The success report in the swagger validation pipeline refers only to the Swagger APIReview generation, so if an SDK review generation should fail this will still apprear as a success.
Swagger Validation Report

@chidozieononiwu
Copy link
Member

chidozieononiwu commented Mar 18, 2023

I think I have identified the actual problem cases.
Case 1: SwaggerAPIView failed but Failure case was not reported as in openapi-env-test/azure-rest-api-specs#3638 , In this case I will report the failure in the comment.
Case2: Swager API View was not generated but Swagger Job still appeared as successful as in Azure/azure-rest-api-specs#22862 , in this case I will add information stating that no swagger generation was carried out.
case 3: Swagger APIView was generated but Generated ApiView comment was not updated as in Azure/azure-rest-api-specs#23105

@chidozieononiwu
Copy link
Member

chidozieononiwu commented Mar 22, 2023

I have fixed the first two cases. And I have added logging so as to be able to track down exactly where and how events are getting missing, dropped or not picked up.

One approach suggested by @praveenkuttappan is to add the comment directly from APIView service using the DetectApiChanges endpoint and setting commentOnPr to true. We will have to format the comment into the existing table structure, then we can disable the unifiedPipelines -> eventhubs -> kebabbot approach for adding the Generated APIView comment.

@weshaggard @maririos @praveenkuttappan

@weshaggard
Copy link
Member

I would like to avoid having the APIView service knowing about the specs PR and figuring out how to update those type of comments. I know we do it for the SDK repos currently but I'd like to eliminate that at some point as well, if possible.

Is the issue that we are generating the APIView's async and we don't update the comment until it is finished? I thought APIView was always returning a URL even if it is wasn't ready yet and we should be able to add that to the comment.

@chidozieononiwu
Copy link
Member

A event is pushed to eventhub for each APIView generation attempted, with the result (success or fail) of the attempt. The kebab bot picks up this event then writes the comment to Github. The issue here is one where the event was pushed to eventhub but the kebab bot did not write any comment.

@weshaggard
Copy link
Member

Yeah that seems like a bug we should be trying to handle in the kebab bot as opposed to adding a new ApiView dependency on it.

@chidozieononiwu chidozieononiwu moved this from 🐝 Dev to 📋 Backlog in Azure SDK EngSys 🚢🎉 Jun 27, 2023
@jsquire jsquire modified the milestones: 2023-03, Backlog Jul 14, 2023
@chidozieononiwu chidozieononiwu moved this from 📋 Backlog to 🔬 Dev in PR in Azure SDK EngSys 🚢🎉 Jul 20, 2023
@kurtzeborn kurtzeborn moved this from 🔬 Dev in PR to 🎊 Closed in Azure SDK EngSys 🚢🎉 Aug 15, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in ApiView Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APIView Central-EngSys This issue is owned by the Engineering System team.
Projects
Status: ✅ Done
Archived in project
Development

No branches or pull requests

6 participants