Skip to content

Conversation

@rtibbles
Copy link
Member

@rtibbles rtibbles commented Dec 17, 2025

Summary

  • Calls add_channel() before DOWNLOAD_FILES stage to fail fast if unauthorized
  • Caches root_id and channel_id to avoid duplicate API calls

References

Fixes #95
Fixes #434

Reviewer guidance

Probably the best way to test this would be to edit the tests/test_chef_integration.py to use a static channel domain and channel source id.
Then run with one Studio user token, then run it again with another (non-admin) Studio user token.
When I did this, it gave me a properly semantic error message before downloading any files telling me I didn't have permission to edit the channel

🤖 This was created by Claude Code. @rtibbles then reviewed the generated output, and did iterative rounds of updates before making it ready for review 🤖

This commit addresses two related issues:
- Issue #95: Unhelpful error messages when user lacks channel edit permissions
- Issue #434: Files downloaded/uploaded before checking permissions

Changes:
- Added early permission check in commands.py after channel construction
- Calls add_channel() before DOWNLOAD_FILES stage to fail fast if unauthorized
- Caches root_id and channel_id to avoid duplicate API calls
- Prevents wasted bandwidth and processing time

Benefits:
- Users get immediate feedback on authorization issues
- No wasted resources downloading/uploading files when unauthorized
- No Studio API changes required - uses existing endpoints
- Backward compatible with existing chef scripts
@rtibbles rtibbles force-pushed the claude/test-fix-related-issues-01FwwYDNaQ7wwQY7MNKJsyur branch from 0bfc64a to 90b72d9 Compare December 17, 2025 01:21
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.

Check access to channel before downloading and starting upload Provide more meaningful message when user is not authorized to edit channel

3 participants