942 new variable user permission team - #1070
Conversation
|
Queue triage (2026-07-27)
GitHub is the status record; update this PR rather than the external spreadsheet. |
There was a problem hiding this comment.
Pull request overview
Adds user_permission_team as an automatic recipe variable sourced from authentication claims or remote recipe metadata.
Changes:
- Adds token and metadata permission-team extraction.
- Preserves explicit variable overrides and adds recipe tests.
- Isolates training tests from backend model creation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
wrangles/recipe.py |
Injects the permission-team variable. |
wrangles/auth.py |
Extracts permission teams from tokens. |
tests/recipes/test_variables.py |
Tests recipe variable behavior. |
tests/connectors/test_train.py |
Replaces backend-dependent test operations with mocks. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: ebhills <53243273+ebhills@users.noreply.github.com>
|
@copilot - 2 things:
|
Co-authored-by: ebhills <53243273+ebhills@users.noreply.github.com>
Updated the canonical permission-group variable to |
|
@mborodii-prog - please see my recent comments about the name for this variable. I have decided to call it: Please review this here and in |
Summary
Adds a recipe variable named
user_permission_team.This variable is intended to expose the permission-driving team for the current recipe run, so recipes can branch behavior based on the user's effective permission team.
Problem
Some recipes need to apply different limits depending on the user running them.
For example, a web research recipe may allow one group to process more rows than another group. The row limits themselves should remain recipe logic, but the recipe needs access to the current user's effective permission group.
Changes
user_permission_teamas an automatic recipe variable.user_permission_teamis read from recipe metadata when the backend provides it.user_permission_teamfalls back to the authenticated token claim nameduser_permission_team.ifconditions, explicit overrides, and remote recipe metadata.Backend Contract
WranglesPY expects the effective permission group to be provided as:
The same name is exposed inside recipes.
Usage Examples
Use in an
ifcondition:Use as a templated value:
Use to choose a row limit in recipe variables: