-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Integrate Armstrong Validation into the spec PR check suite. #28773
Comments
I am curious on understanding this process and the implication it will have on our users. There was a conversation on email where it was communicated that the check was going to be optional so not everyone will require it. What is the criteria for the users? |
There are 2 types of Armstrong validations for users:
|
Hi @konrad-jamrozik, thank you for your guidance. I have submitted a PR(#28803) to integrate Armstrong Validation. Please help take a review. |
Thank you @ms-zhenhua
How will the user know that? Besides a failure in the CI, how areyou thinking on letting the user know that this is a required step now? |
RP API Review Team is drafting the API Test workflow and will schedule a meeting with RP teams. After reaching an agreement, API Test will be included as a part of RP API review and the RP team can submit the API Test configurations for their new APIs. Before that, I need to make Armstrong Validation as a required check so that it can help identify the security risks when RP teams start to submit their Terraform configurations. |
Yes, you'd want to do the following:
|
@ms-zhenhua: I just left comments on 28803, feel free to reply in that PR, or if you open a new PR I can move my comments. Once you have opened the new PR we can create the test pipeline. |
@mikeharder, thank you for the review. I created a new PR(#28829) to replace with the original one and resolved the comments. Could you please guide me how to do the step 3 of Besides that, I have another problem about the first point of this comment to confirm with you. At first, I decide to implement the logic with the following steps:
Since the label method is obsolete, is there other mechanism which can support such manual controlled validation for new check? |
Our partner @ms-zhenhua is working on adding a new check to the spec PR check suite.
Overview of the proposed check
The proposed initial check implementation can be currently found in this PR:
Per that PR description, the proposed check is checking for presence of credentials in Terraform (
.tf
) files by leveraging https://github.com/Azure/armstrong.General approach to implementing the check
@ms-zhenhua we no longer add any new checks to the
openapi-alps
repository. All new checks should follow the new check integration model we adopted.Eventually we will provide a full guide (#28772) but for now below I provide some pointers to help you get started.
Implementing a new check: a quickstart
@ms-zhenhua We have few checks following this model:
TypeSpec Requirement
GitHub check.TypeSpec Validation
GitHub check.Swagger PrettierCheck
GitHub check migrated fromopenapi-alps
to the new model.You can find sources of all these checks in https://github.com/Azure/azure-rest-api-specs/tree/main/eng.
You should implement your new check by copy-pasting and adapting one of the existing checks. I.e. you should create a PR that will add your new check artifacts inside the https://github.com/Azure/azure-rest-api-specs/tree/main/eng directory. We will review it.
We recommend keeping it simple and implementing it using PowerShell, like
TypeSpec Requirement
. Consider using TypeScript only if you think the check is too complex for PowerShell.Let me use
TypeSpec Requirement
to explain a bit more how these checks work.TypeSpec Requirement
is one of the checks running on specs PRs. Here is a recent example.TypeSpec Requirement
ADO pipeline that powers this check. It is integrated with GitHub by virtue of being based on GitHub repository and using appropriate service connection. See the YAML tab /Get sources
sub-tab.typespec-requirement.yml
.exit 1
then the check will be reported as failed.TypeSpec Requirement (resource-manager)
(which is one of the entries in the job matrix in the pipeline definition)required
so when it fails, it will block the PR.required
, it will automatically be included in theAutomated merging requirements met
check.Next Steps to Merge
comment if this check fails, we have the following line of code: inopenapi-alps
:createCheckInfo(0, "TypeSpec Requirement (resource-manager)", [], typeSpecRequirementArmTsg),
. That is the only integration point withopenapi-alps
.Implementing support for suppressions
section below.When implementing your check, you should mimic the above setup. We will help with code review, setting up relevant branch protection rule and any other questions you have.
Implementing support for suppressions
@ms-zhenhua re suppressions:
The official guidance on existing suppressions is here:
And here is additional guidance for us devs:
The
Approved-***
is obsolete model which we slowly migrate away from. You can read more about this in the design section in Azure/azure-sdk-tools#8133.Instead, we will want for you to provide suppression via appropriate entry in the
suppresions.yaml
file. The aforementioned TypeSpec-Requirement.ps1 implements support for readingsuppressions.yaml
. You can reuse that code for your own check. You can also read about the design here: #27348.Notes on the existing PR
@ms-zhenhua we did preliminary review of Pull Request 544843: Add Armstrong Validation Task.
Our initial conclusions are as follows:
Terraform Armstrong Validation
notSwagger ArmstrongValidation
.The text was updated successfully, but these errors were encountered: