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

(automated) quality checks #27

Closed
alamers opened this issue Jun 21, 2019 · 6 comments
Closed

(automated) quality checks #27

alamers opened this issue Jun 21, 2019 · 6 comments

Comments

@alamers
Copy link
Collaborator

alamers commented Jun 21, 2019

As the pull request from @Jongmassey has shown, it is easy for errors to slip in. Right now, we more or less have a set of static files and rely on manual checking.

We should have an environment where we can build the documentation and also perform automated quality checks. For example, running
docker run wework/speccy lint https://raw.githubusercontent.com/adewg/ICAR/master/Release%20Candidate%20Messages/exampleUrlScheme.yaml
(on a workstation with Docker installed), will give detailed feedback on things that need improving.

@alamers
Copy link
Collaborator Author

alamers commented Jun 21, 2019

just a hint for working locally: you can mount your local checkout and run speccy against that:

docker run -v /Users/arjanl/ICAR/Release\ Candidate\ Messages/:/project wework/speccy lint exampleUrlScheme.yaml

@Jongmassey
Copy link
Contributor

https://engineering.wework.com/our-api-specification-workflow-9337448d6ee6 This in an interesting medium post about wework's API development/CI workflow - might be useful

@cookeac
Copy link
Collaborator

cookeac commented Jun 27, 2019

Note that natively speccy complains about some JSON-Schema constructs, such as "$schema". That is supposed to be fixed in a later version of OpenAPI, but in the meantime you'll probably have seen you can use the -j switch with speccy to address this (apparently - I haven't tested it myself).

@ahokkonen
Copy link
Contributor

ahokkonen commented Nov 18, 2019

just a hint for working locally: you can mount your local checkout and run speccy against that:

docker run -v /Users/arjanl/ICAR/Release\ Candidate\ Messages/:/project wework/speccy lint exampleUrlScheme.yaml

You can also do that directly in GitHub by creating "Action" for ICAR repo. Simpest one would be create action with such workflow:

name: JSON validation CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: JSON validation by wework/speccy container
      run: |
        docker run wework/speccy lint \
        https://raw.githubusercontent.com/adewg/ICAR/master/Release%20Candidate%20Messages/exampleUrlScheme.json

This will trigger automatic validation on each push commit

@cookeac
Copy link
Collaborator

cookeac commented Nov 21, 2019

I have added this validation to /.github/workflows in Master. At the moment it is failing until an error is corrected in icarConsignmentType.json. I have submitted a patch pull request to fix this.

@cookeac
Copy link
Collaborator

cookeac commented Nov 26, 2019

Error has been corrected, and the Speccy validation now works. Noted that we may wish to consider a change to Stoplight.io in future as Speccy is not being maintained and future changes to the JSON Schema specification might break the validation.

@cookeac cookeac closed this as completed Nov 26, 2019
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

No branches or pull requests

4 participants