Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

[BUG] pre-commit hooks seems to ignore custom schema locations #973

Closed
fredleger opened this issue Feb 2, 2024 · 2 comments
Closed

[BUG] pre-commit hooks seems to ignore custom schema locations #973

fredleger opened this issue Feb 2, 2024 · 2 comments
Labels
bug Something isn't working stale issue

Comments

@fredleger
Copy link

Describe the bug
When using pre-commit hooks i had bad time trying to add custom schema locations

To Reproduce
Steps to reproduce the behavior:

  1. Setup the following commit hook config
[...]
  - repo: https://github.com/datreeio/datree
    rev: 1.9.19
    hooks:
      - id: datree-system
        exclude: |
          (?x)^(
            ^\.github/.*|
            ^\.datree/.*|
            ^\.pre-commit-config.yaml
          )$
        args:
          - "test"
          - --no-record
          - --verbose
          - --schema-version=1.23.0
          - --schema-location='https://raw.githubusercontent.com/webofmars/CRDs-catalog/main/crds/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json'
[...]
  1. run pre-commit install
  2. run pre-commit run -a datree-system on a repo with a manifest not known by default to datree (for my case ops.alexellis.io/clusterpullsecret/v1)

image

If i run the same command on pure command line (hence without pre-commit hook implied) :

image

Expected behavior
schema locations should be easy to use with pre-commit hooks

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macos (but i guess it's might be all)

Datree version (run datree version):

  • Version: 1.9.19

Client ID (cat ~/.datree/config.yaml):

  • client_id: [e.g. ETJnw3X3cvv9JaTsEpjsMh]

Additional context

Running in offline mode but i guess this is not an issue here

@fredleger fredleger added the bug Something isn't working label Feb 2, 2024
@fredleger
Copy link
Author

Note: I actually tried running it without mode offline or with a local folder .datree inside the git repo and got the same behavior

ex: --schema-location='.datree/crdSchemas/{{.Group}}/{{ .ResourceKind }}_{{ .ResourceAPIVersion }}.json'

Copy link

github-actions bot commented Mar 4, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working stale issue
Projects
None yet
Development

No branches or pull requests

1 participant