apiops
apiops copied to clipboard
[BUG] Spectral linting not working
Release version
APIOps Toolkit for Azure APIM v5.1.4
Describe the bug
I believe the following line in the GitHub workflow does not work as expected, Spectral does not find any file to lint as it search for JSON/YAML files at the root of the apis folder rather than in any subfolder:
- run: spectral lint "${{ GITHUB.WORKSPACE }}/${{ inputs.API_MANAGEMENT_SERVICE_OUTPUT_FOLDER_PATH }}\apis\*.{json,yml,yaml}" --ruleset https://raw.githubusercontent.com/connectedcircuits/devops-api-linter/main/rules.yaml
To execute tests on all subfolders, the code should include \**\ in the file path, such as:
- run: spectral lint "${{ GITHUB.WORKSPACE }}/${{ inputs.API_MANAGEMENT_SERVICE_OUTPUT_FOLDER_PATH }}\apis\**\*.{json,yml,yaml}" --ruleset https://raw.githubusercontent.com/connectedcircuits/devops-api-linter/main/rules.yaml
Expected behavior
Spectral lint all files with the apis subfolders
Actual behavior
no linting is occuring
Reproduction Steps
create an invalid spec file in the apis folder and see if Spectral find the error.
Thank you for opening this issue! Please be patient while we will look into it and get back to you as this is an open source project. In the meantime make sure you take a look at the [closed issues](https://github.com/Azure/apiops/issues?q=is%3Aissue+is%3Aclosed) in case your question has already been answered. Don't forget to provide any additional information if needed (e.g. scrubbed logs, detailed feature requests,etc.).
Whenever it's feasible, please don't hesitate to send a Pull Request (PR) our way. We'd greatly appreciate it, and we'll gladly assess and incorporate your changes.
This should be fixed by #568 , thanks!
@fabienmazieres the issue reappeared in 6.0.1.3 as well as another syntax error of using backslash instead of forward slash https://github.com/Azure/apiops/issues/701