Skip to content

Conversation

sfc-gh-daniszewski
Copy link
Collaborator

Pre-review checklist

  • I've confirmed that instructions included in README.md are still correct after my changes in the codebase.
  • I've added or updated automated unit tests to verify correctness of my new code.
  • I've added or updated integration tests to verify correctness of my new code.
  • I've confirmed that my changes are working by executing CLI's commands manually on MacOS.
  • I've confirmed that my changes are working by executing CLI's commands manually on Windows.
  • I've confirmed that my changes are up-to-date with the target branch.
  • I've described my changes in the release notes.
  • I've described my changes in the section below.
  • I've described my changes in the documentation.

Changes description

Grant privileges defined in snowflakey.yml after deploying Streamlit
Closes #2491

- Removes SECURITYADMIN privilege requirement for CI
- Uses existing PUBLIC role to test grants functionality
- Simplifies test flow while maintaining functionality validation
- Remove create_test_role() and cleanup_test_role() methods
- These methods required SECURITYADMIN privileges and were causing CI failures
- No longer needed since tests now use existing PUBLIC role
- test_role is specifically created for integration tests in CI environment
- Avoids potential permission restrictions with PUBLIC role in CI
- Follows standard integration test pattern from account setup
- Remove hardcoded ACCOUNTADMIN role switching in verify_grants_applied
- Simplify verification by not switching back to original role
- Fixes CI error: 'ACCOUNTADMIN role is not assigned to executing user'
- Tests now pass locally with proper role handling
- Remove verify_grants_applied calls from integration tests
- Tests still verify grants are applied during deployment
- Avoids TEST_ROLE assignment issues in CI environment
- More robust approach that focuses on core functionality
- Both grants tests now pass cleanly
- Get current role from session instead of hardcoding role names
- Ensures grants are validated with a role the CI user actually has
- Tests now properly validate grants functionality in any environment
- Both grants tests pass with full validation enabled
- More robust than hardcoded role approaches
- Replace dynamic role discovery with snowflake_session.role
- CI environment uses consistent static role configuration
- Cleaner and more predictable than SQL queries
- Maintains full grants validation functionality
- Both tests still pass with proper validation
- Remove explanatory comments that don't add value
- Code is self-explanatory without extra commentary
- Cleaner and more concise implementation
@sfc-gh-daniszewski sfc-gh-daniszewski marked this pull request as ready for review September 26, 2025 13:30
@sfc-gh-daniszewski sfc-gh-daniszewski requested a review from a team as a code owner September 26, 2025 13:30
@sfc-gh-daniszewski sfc-gh-daniszewski merged commit c69d6d0 into main Sep 26, 2025
22 checks passed
@sfc-gh-daniszewski sfc-gh-daniszewski deleted the daniszewski-SNOW-2206349-fix-streamlit-grants branch September 26, 2025 14:15
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.

SNOW-2206349: Streamlit Entity Grants
2 participants