Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Sematically validate notification configs #2850

Merged

Conversation

tevoinea
Copy link
Member

Summary of the Pull Request

What is this about?

Closes #994

Checks notification config for valid properties

Info on Pull Request

What does this include?

  • New feature flag EnableValidateNotificationConfigSemantics that is defaulted to on at deploy time
  • Code to validate an Ado template
  • Code to validate a Github template
  • Small cleanup/refactor within Ado.cs and GithubIssues.cs

Validation Steps Performed

How does someone test & validate?

  • Created a new ado notification config with valid fields -> It works
  • Created a new ado notification config with invalid PAT -> CLI returns:

ERROR:cli:command failed: request did not succeed (400: INVALID_CONFIGURATION): Failed to connect to https://dev.azure.com/fuzzfest using the provided token

  • Created a new ado notification config with invalid unique_fields -> CLI returns:

ERROR:cli:command failed: request did not succeed (400: INVALID_CONFIGURATION): The following unique fields are not valid fields for this project: system.title123412341234 You can find the valid fields for your project by following these steps: https://learn.microsoft.com/en-us/azure/devops/boards/work-items/work-item-fields?view=azure-devops#review-fields

  • Created a new github notification config with valid fields -> It works
  • Created a new github notification config with invalid PAT -> CLI returns:

ERROR:cli:command failed: request did not succeed (400: INVALID_CONFIGURATION): Failed to login to github.com with user tevoinea and the provided Personal Access Token

  • Created a new github notification config with invalid repo -> CLI returns:

ERROR:cli:command failed: request did not succeed (400: INVALID_CONFIGURATION): Failed to access repository: tevoinea/udp-parserwqeqweqwe

@tevoinea tevoinea requested review from chkeita and Porges February 16, 2023 15:26
Co-authored-by: Cheick Keita <kcheick@gmail.com>
@tevoinea tevoinea enabled auto-merge (squash) February 16, 2023 17:59
@tevoinea tevoinea merged commit 572671b into microsoft:main Feb 16, 2023
chkeita added a commit to chkeita/onefuzz that referenced this pull request Feb 16, 2023
* Add new command

* Update remaining jinja templates and references to use scriban

* Add ado template validation

* Validate ado and github templates

* Remove unnecessary function

* Update src/ApiService/ApiService/OneFuzzTypes/Model.cs

Co-authored-by: Cheick Keita <kcheick@gmail.com>

---------

Co-authored-by: Cheick Keita <kcheick@gmail.com>
chkeita added a commit that referenced this pull request Feb 23, 2023
* adding extra container to tasks

* setup expand

* build fix

* generate docs

* build fix

* build fix

* build fix

* format

* format

* build fix

* fix extra container references

* format

* Update "Needs Triage" label to the one we use. (#2845)

* Report extension errors (#2846)

Old failure message:
```
failed to launch extension
```

New failure message:

```
failed to launch extension(s): Errors for extension 'CustomScriptExtension':
:Error: ProvisioningState/failed/3 (Provisioning failed) - Failed to download all specified files. Exiting. Error Message: The remote server returned an error: (400) Bad Request.
```

* Sematically validate notification configs (#2850)

* Add new command

* Update remaining jinja templates and references to use scriban

* Add ado template validation

* Validate ado and github templates

* Remove unnecessary function

* Update src/ApiService/ApiService/OneFuzzTypes/Model.cs

Co-authored-by: Cheick Keita <kcheick@gmail.com>

---------

Co-authored-by: Cheick Keita <kcheick@gmail.com>

* adding extra container to integration tests

* adding doc

* update tests

* format

* build and clippy fix

* Update src/agent/onefuzz-task/src/tasks/report/generic.rs

Co-authored-by: Teo Voinea <58236992+tevoinea@users.noreply.github.com>

---------

Co-authored-by: Marc Greisen <mgreisen@microsoft.com>
Co-authored-by: George Pollard <gpollard@microsoft.com>
Co-authored-by: Teo Voinea <58236992+tevoinea@users.noreply.github.com>
@mgreisen mgreisen mentioned this pull request Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ADO notification configs should be semantically validated
2 participants