Skip to content

Workflow schema validation to the validate script#1014

Closed
aparna-ravindra wants to merge 27 commits intoactions:mainfrom
aparna-ravindra:workflow-schema-validation
Closed

Workflow schema validation to the validate script#1014
aparna-ravindra wants to merge 27 commits intoactions:mainfrom
aparna-ravindra:workflow-schema-validation

Conversation

@aparna-ravindra
Copy link
Copy Markdown
Contributor

The current "validate" script that runs on PR and Push validates the .properties.json files. This PR adds an additional validation to check the schema of the .yaml file.

@aparna-ravindra aparna-ravindra requested a review from a team as a code owner July 22, 2021 10:29
Comment thread ci/npm-publish.yml Outdated
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there's no difference between the above lines, you can skip this file from the PR.

Comment thread ci/python-publish.yml Outdated
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.PYPI_API_TOKEN }} No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above.

aparna-ravindra added 2 commits July 26, 2021 14:26
Comment on lines +106 to +107
const workflowValidationErrors = workflowValidationResult.errors.map(e => e.toString())
workflowErrors.errors = workflowErrors.errors.concat(workflowValidationErrors)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these two statements can be clubbed together.

const workflow = safeLoad(workflowFileContent); // Validate yaml parses without error

let workflowValidator = new validator();
const workflowSchema = require("./workflow-schema.json");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will this schema file be maintained and updated? If the schema goes out of date with what in production, then we will get false negatives. Hence it is very important to define the clear path for maintenance of this file.

cc @andymckay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants