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

Automatically detect kind #345

Merged
merged 2 commits into from Feb 22, 2024
Merged

Automatically detect kind #345

merged 2 commits into from Feb 22, 2024

Conversation

malcolmholmes
Copy link
Collaborator

Currently, using actions that read files, the user needs to tell Grizzly whether a resource
includes an envelope or not, and if it doesn't include an envelope, the user must specify
a kind.

This PR adds in basic kind detection. It will first detect an envelope. If no envelope
present, it will ask each handler to detect its own resource type, hopefully resulting in
a kind that identifies that handler.

@malcolmholmes malcolmholmes requested a review from a team as a code owner February 22, 2024 11:32
Copy link
Member

@julienduchesne julienduchesne left a comment

Choose a reason for hiding this comment

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

Where is the datasource detection coming from?

pkg/grizzly/parsing.go Show resolved Hide resolved
@malcolmholmes
Copy link
Collaborator Author

Where is the datasource detection coming from?

At present, only enveloped and dashboard detection are implemented. Datasource presumably would be simple too.

@julienduchesne
Copy link
Member

Where is the datasource detection coming from?

At present, only enveloped and dashboard detection are implemented. Datasource presumably would be simple too.

There's tests for it though. What am I missing?

@malcolmholmes
Copy link
Collaborator Author

There's tests for it though. What am I missing?

Yes, it either tests (a) that enveloped detection works on a kind that doesn't have its own detection yet or (b) without an envelope it throws an error.

@julienduchesne
Copy link
Member

Yes, it either tests (a) that enveloped detection works on a kind that doesn't have its own detection yet or (b) without an envelope it throws an error.

Oh 🤦 . Indeed

@malcolmholmes malcolmholmes merged commit 6ddfaf4 into main Feb 22, 2024
7 checks passed
@malcolmholmes malcolmholmes deleted the malcolmholmes/detect-kind branch February 22, 2024 13:30
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.

None yet

2 participants