Test utility for validating blocks
Description
It would be very convenient if this library including a utility for validating blocks. Inside of our tests, we could produce blocks and run them through this utility, which would return true if the block is valid or false otherwise. Currently, blocks are a bit brittle in that changes to block structure can produce errors which can only be debugged interactively through a dummy Slack channel. I don't know what this would involve, but it would be a great feature.
What type of issue is this? (place an x in one of the [ ])
- [ ] bug
- [ ] enhancement (feature request)
- [ ] question
- [ ] documentation related
- [ ] example code related
- [ ] testing related
- [x] discussion
Requirements (place an x in each of the [ ])
- [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
- [x] I've read and agree to the Code of Conduct.
- [x] I've searched for any related issues and avoided creating a duplicate issue.
What you expected to happen
Actual result:
What actually happened
Attachments:
Logs, screenshots, screencast, sample project, funny gif, etc.
Hi @kronosapiens 👋🏻
Thanks for taking the time to share this idea 💡 I agree, Block Kit is essential for Slack apps but challenging to design and more difficult once interactivity is layered on.
I've shared your idea with the Block Kit team, so it's on their radar. 🙌🏻
A future feature of the Slack API is the App Manifest, where you can define your app's metadata using JSON (e.g. app name, description, scopes, events, request URLs, etc). Along with this feature, there is a manifest validation API endpoint. It'll tell you whether the manifest has validate properties, but it'll also notify you about breaking changes (e.g. removing a scope that is currently used by the app).
☝🏻 When you're describing a test utility to validate blocks, this type of API endpoint immediately came to mind.
While not as helpful, I imagine you've already seen the Block Kit Builder web page? Right now, a common practice is to copy & paste your blocks into it but I know that this has limited functionality for real-world blocks.
👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.
Marking this issue as unstaleable, to keep the issue open for further community and commenting ➕ that I would like to see some sort of improved officially maintained utility for helping validate or author Block Kit.
Would also love this
Would also love this
+1
+1
A minimum solution here could be some sort of utility which validates a block and returns true/false, which we could then incorporate into some sort of testing framework. E.g.
const block = createBlock();
expect(bolt.isValid(block)).to.be.true;
This would really cut down on the time spent in development debugging through test workspaces.
+1