Skip to content

feat: implement a permission deprecation tool to audit and identify m…#26

Merged
bwebs merged 3 commits intomainfrom
bryan/adding-permission-deprecation
Feb 14, 2026
Merged

feat: implement a permission deprecation tool to audit and identify m…#26
bwebs merged 3 commits intomainfrom
bryan/adding-permission-deprecation

Conversation

@bwebs
Copy link
Contributor

@bwebs bwebs commented Feb 14, 2026

…issing model-specific scheduling and downloading permissions.

…issing model-specific scheduling and downloading permissions.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @bwebs, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant new feature to the lkr CLI: a permission deprecation tool. This tool is designed to assist Looker administrators in proactively identifying and addressing permission discrepancies that may arise as Looker transitions to more granular, model-specific permissions for scheduling and downloading. By auditing users who have broad instance-wide permissions but might be missing equivalent model-level access, the tool helps ensure a smooth transition and prevents unexpected loss of functionality for end-users.

Highlights

  • New CLI Tool: Implemented a schedule-download-deprecation tool to audit Looker user permissions, helping identify potential permission gaps.
  • Permission Gap Identification: The new tool identifies users who possess instance-wide scheduling and downloading permissions but lack the corresponding model-specific permissions, which is crucial for future granular permission management.
  • README Documentation: Added comprehensive documentation for the new permission deprecation tool in the README, detailing its purpose, benefits, usage, and available options.
  • CLI Command Update: Updated uv command examples in the README from uv run --with to uvx --from for improved consistency and modern usage.
  • Dependency Refactoring: Refactored pyproject.toml to move common CLI dependencies into the main dependencies section, streamlining dependency management.
  • Testing Enhancements: Added dedicated unit tests for the new permission deprecation logic and removed an old, unused test file to improve test coverage and maintainability.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • README.md
    • Updated uv command usage examples.
    • Added a new section detailing the 'Permission Deprecation Tool', its purpose, benefits, usage, and options.
  • lkr/tools/main.py
    • Imported csv, sys, Annotated, Optional from typing, and schedule_download_deprecation from the new module.
    • Defined PERMISSION_MAP for permission abbreviations.
    • Added get_visual_length and visual_ljust helper functions for table formatting.
    • Implemented the schedule_download_deprecation_command Typer command, handling argument parsing, CSV output, and formatted table display.
  • lkr/tools/permission_deprecation.py
    • Added a new file containing the core logic for auditing permissions.
    • Defined target_permissions list.
    • Implemented AuditRow and DeprecationAuditResult Pydantic models for data structuring.
    • Developed the schedule_download_deprecation function to fetch models, roles, and users, then process their permissions to identify gaps.
    • Included logic for filtering results based on missing permissions.
  • pyproject.toml
    • Moved typer, requests, cryptography, structlog, and questionary from [project.optional-dependencies.cli] to dependencies.
    • Removed these dependencies from [project.optional-dependencies.all].
  • test.py
    • Removed an old, unused test file.
  • tests/test_permission_deprecation.py
    • Added a new test file with unit tests for the schedule_download_deprecation function, covering user scenarios with access data, admin roles, and filtering logic.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new schedule-download-deprecation tool to audit user permissions for scheduling and downloading. The implementation is well-structured, with the core logic separated into lkr/tools/permission_deprecation.py and the command-line interface in lkr/tools/main.py. The addition of unit tests is also a great practice.

My review has identified a critical issue: a hardcoded email filter that needs to be removed for the tool to function correctly for all users. I've also included some suggestions to improve code clarity, consistency in documentation, and performance.

… option help; refactor: remove hardcoded email filter from user search in permission deprecation tool.
@bwebs bwebs merged commit 6db30bc into main Feb 14, 2026
1 check passed
@bwebs bwebs deleted the bryan/adding-permission-deprecation branch February 14, 2026 00:22
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.

1 participant