Skip to content

Improve migration tool; fix bugs - #184

Merged
sagebree merged 3 commits into
mainfrom
users/sagebree/codmod_fixes
May 27, 2026
Merged

sagebree merged 3 commits into
mainfrom
users/sagebree/codmod_fixes

Conversation

@sagebree

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 26, 2026 20:04
@sagebree
sagebree requested a review from a team as a code owner May 26, 2026 20:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR strengthens the v0→v1 migration experience and tightens security defaults across the SDK. It expands the migration codemod to handle more real-world call shapes, improves operator guidance (manual notes with locations, stable re-run labeling, dry-run diffs), and adds runtime guardrails to prevent common insecure misconfigurations and token/header leakage.

Changes:

  • Migration codemod upgrades: kwarg-aware filter rewrites, import placement/layout preservation, unused filters-import pruning, dry-run unified diffs, manual findings with line/col, and re-run stability via v1 sentinels.
  • Security hardening: enforce HTTPS base URLs, redact cookie headers by default, and redact OAuth access tokens in _TokenPair.__repr__.
  • Runtime UX: add actionable migration hints when accessing removed v0 beta shortcut methods via DataverseClient.__getattr__.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/unit/test_migration_tool.py Extensive new regression coverage for codemod rewrites, manual findings, dry-run diff output, newline fidelity, and re-run stability.
tests/unit/test_client.py Adds tests enforcing HTTPS-only base_url construction behavior.
tests/unit/test_client_deprecations.py Adds tests ensuring removed beta methods raise AttributeError with actionable migration hints and drift-guard vs codemod shortcuts.
tests/unit/core/test_http_logger.py Adds tests locking cookie/set-cookie redaction defaults and behavior.
tests/unit/core/test_auth.py Adds tests ensuring _TokenPair repr/str redacts access tokens.
src/PowerPlatform/Dataverse/models/filters.py Documents that filter_in must not be renamed due to codemod keying.
src/PowerPlatform/Dataverse/migration/migrate_v0_to_v1.py Implements codemod enhancements: kwarg extraction, manual finder positions, import injection fixes, layout-preserving import augmentation, unused-import pruning, dry-run diffs, newline preservation, and stable re-run labeling.
src/PowerPlatform/Dataverse/core/log_config.py Adds set-cookie/cookie to default redacted headers and documents rationale.
src/PowerPlatform/Dataverse/core/_auth.py Redacts _TokenPair token display via @dataclass(repr=False) + custom __repr__.
src/PowerPlatform/Dataverse/client.py Enforces HTTPS base_url, adds removed-beta-method mapping, and emits migration hints in __getattr__.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Samson Gebre and others added 2 commits May 26, 2026 15:38
…f extra args; add tests for arity violations and ensure manual notes are correctly emitted.
@sagebree
sagebree merged commit b940024 into main May 27, 2026
9 checks passed
@sagebree
sagebree deleted the users/sagebree/codmod_fixes branch May 27, 2026 18:20
abelmilash-msft added a commit that referenced this pull request May 29, 2026
Release changelog and version bump for v1.0.0.

## Changes
- Converted `[Unreleased]` to `[1.0.0] - 2026-05-25` in `CHANGELOG.md`
- Incorporated all PRs merged since `v0.1.0b10`: async client (#171),
shorter imports (#165), OperationContext allowlisting (#181),
CreateEntities API (#183), migration tool fixes (#184), SQL guardrails /
error handling / float precision (#185), `QueryResult.__aiter__` (#187),
Python 3.10/3.11 fix (#188)
- Bumped `version` in `pyproject.toml` from `0.1.0b11` → `1.0.0`

---------

Co-authored-by: Abel Milash <abelmilash@microsoft.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants