Skip to content

fix: default language mapping name + projection key for translations#169

Merged
Ruari-Phipps merged 2 commits into
mainfrom
fix/resource-mapping-name-refresh
Jun 3, 2026
Merged

fix: default language mapping name + projection key for translations#169
Ruari-Phipps merged 2 commits into
mainfrom
fix/resource-mapping-name-refresh

Conversation

@Ruari-Phipps
Copy link
Copy Markdown
Collaborator

@Ruari-Phipps Ruari-Phipps commented Jun 3, 2026

Summary

Fixes two bugs that broke translation validation when the default language is changed locally.

Motivation

Translation validation cross-references configured languages via ResourceMappings. When the default language was changed locally, the ResourceMapping still had the old language code (cached from pull), so translations appeared to be missing entries for the new language. Separately, the projection reader used the wrong key to extract the default language code from the API response.

Changes

  • Re-read default language name from disk for kept resources so the ResourceMapping reflects the current value
  • Fix projection key defaultLanguagedefaultLanguageCode in SyncClientHandler._read_languages_from_projection

Test strategy

  • ruff check . and ruff format --check . pass
  • pytest passes (662 tests)
  • Manual CLI testing (poly <command>)
  • Tested against a live Agent Studio project

Checklist

  • ruff check . and ruff format --check . pass
  • pytest passes
  • No breaking changes to the poly CLI interface (or migration path documented)
  • Commit messages follow conventional commits

🤖 Generated with Claude Code

@Ruari-Phipps Ruari-Phipps requested a review from a team June 3, 2026 08:58
@github-actions

This comment has been minimized.

… key

When the default language is changed locally, the ResourceMapping name
was stale because it came from file_structure_info cached at pull time.
Now re-reads the name from disk for DefaultLanguage kept resources.

Also fixes the projection key from defaultLanguage to defaultLanguageCode
in SyncClientHandler._read_languages_from_projection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Ruari-Phipps Ruari-Phipps force-pushed the fix/resource-mapping-name-refresh branch from e52bba5 to d84b669 Compare June 3, 2026 09:08
@Ruari-Phipps Ruari-Phipps changed the title fix: refresh resource mapping name for kept multi-resource types fix: default language mapping name + projection key for translations Jun 3, 2026
@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

Coverage Report

Base (main) PR Change
69.6% 69.6% +0.0% ✅

Changed file coverage

File Coverage Change
poly/project.py 67.7% +0.1% ✅

@Ruari-Phipps Ruari-Phipps merged commit 15526b1 into main Jun 3, 2026
5 checks passed
@Ruari-Phipps Ruari-Phipps deleted the fix/resource-mapping-name-refresh branch June 3, 2026 09:56
bplevin36 added a commit to polyai/adk-rs that referenced this pull request Jun 3, 2026
## Summary
- add DefaultLanguage, AdditionalLanguage, and Translation resource
discovery/materialization/status support
- generate language and translation push commands, including
defaultLanguageCode projection handling
- validate translation coverage against locally configured languages and
update the parity audit doc

## Ported from
- polyai/adk#152
- polyai/adk#169

## Tests
- cargo test
- cargo clippy --workspace --all-targets -- -D warnings
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.

2 participants