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

Move JSON/YAML precheck into Documentation target #10952

Merged
merged 3 commits into from Apr 14, 2020

Conversation

joestringer
Copy link
Member

@joestringer joestringer commented Apr 13, 2020

Blocks: #10907

There's no need to run this minimal linting / cilium policy validation
from the runtime VM; replace it with a simple docker run of a bash
script from the docs-builder image.

This will help to avoid out-of-sync issues between dependencies in the
Cilium tree and the Cilium packer ci VMs used to run runtime tests. It
should also speed up the jenkins runs slightly.

Examples failures are easier to debug, too:

JSON:

$ make -C Documentation check                                               
...                                                                         
  CHECK Documentation examples                                              
Error: Validation of policy /src/examples/policies/l3/simple/l3.json has failed: malformed policy, not JSON?
                                                                            
make: *** [Makefile:29: check] Error 1                                      

YAML:

$ make -C Documentation check                                               
...                                                                         
/src/examples/crds/ciliumendpoints.yaml                                     
  56:1      error    too many blank lines (1 > 0)  (empty-lines)            
                                                                            
make: *** [Makefile:29: check] Error 1

Add a flag to "cilium policy validate ..." which allows making the
output less verbose, so that the upcoming test output is less noisy.

Signed-off-by: Joe Stringer <joe@cilium.io>
This allows make to determine when to run this target depending on the
files that change.

Signed-off-by: Joe Stringer <joe@cilium.io>
There's no need to run this minimal linting / cilium policy validation
from the runtime VM; replace it with a simple docker run of a bash
script from the docs-builder image.

This will help to avoid out-of-sync issues between dependencies in the
Cilium tree and the Cilium packer ci VMs used to run runtime tests. It
should also speed up the jenkins runs slightly.

Examples failures are easier to debug, too:

JSON:

    $ make -C Documentation check
    ...
      CHECK Documentation examples
    Error: Validation of policy /src/examples/policies/l3/simple/l3.json has failed: malformed policy, not JSON?

    make: *** [Makefile:29: check] Error 1

YAML:

    $ make -C Documentation check
    ...
    /src/examples/crds/ciliumendpoints.yaml
      56:1      error    too many blank lines (1 > 0)  (empty-lines)

    make: *** [Makefile:29: check] Error 1

Signed-off-by: Joe Stringer <joe@cilium.io>
@joestringer joestringer added area/documentation Impacts the documentation, including textual changes, sphinx, or other doc generation code. release-note/misc This PR makes changes that have no direct user impact. labels Apr 13, 2020
@joestringer joestringer requested review from a team as code owners April 13, 2020 23:21
@maintainer-s-little-helper maintainer-s-little-helper bot added this to In progress in 1.8.0 Apr 13, 2020
@joestringer
Copy link
Member Author

test-me-please

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.008%) to 46.637% when pulling 6e7b97c on joestringer:submit/precheck-yaml into 2845ccd on cilium:master.

@joestringer joestringer merged commit 2cd9a2c into cilium:master Apr 14, 2020
1.8.0 automation moved this from In progress to Merged Apr 14, 2020
@joestringer joestringer deleted the submit/precheck-yaml branch April 14, 2020 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Impacts the documentation, including textual changes, sphinx, or other doc generation code. release-note/misc This PR makes changes that have no direct user impact.
Projects
No open projects
1.8.0
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

4 participants