Skip to content

feat: mark exportMode and fileIds as deprecated in add_distribution()#244

Merged
andrii-bodnar merged 2 commits intomainfrom
copilot/mark-deprecated-create-params
Mar 3, 2026
Merged

feat: mark exportMode and fileIds as deprecated in add_distribution()#244
andrii-bodnar merged 2 commits intomainfrom
copilot/mark-deprecated-create-params

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

The Crowdin API has deprecated exportMode and fileIds parameters on the Add Distribution endpoint. This updates the Python client to surface those deprecations via DeprecationWarning while preserving full backward compatibility.

Changes

  • resource.py: Emit DeprecationWarning when exportMode or fileIds are passed to add_distribution(); change exportMode default from ExportMode.DEFAULTNone so it is omitted from the request body when not explicitly set
  • tests/: Wrap existing test cases using deprecated params with pytest.warns(DeprecationWarning); update expected request_data to reflect new exportMode default; add a test covering the no-deprecated-params path

Example

# These now emit DeprecationWarning but continue to work
resource.add_distribution(name="dist", projectId=1, fileIds=[1, 2, 3])
resource.add_distribution(name="dist", projectId=1, exportMode=ExportMode.BUNDLE)

# Recommended going forward
resource.add_distribution(name="dist", projectId=1, bundleIds=[42])
Original prompt

This section details on the original issue you should resolve

<issue_title>Mark deprecated Distribution create params</issue_title>
<issue_description>The Crowdin API marks exportMode and fileIds request parameters in the Add Distribution method as deprecated.

The Crowdin API client libraries should be updated to mark these parameters as deprecated in SDK method signatures, so developers are clearly guided away from using them while keeping backward compatibility.

References:

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Mark deprecated exportMode and fileIds in Add Distribution feat: mark exportMode and fileIds as deprecated in add_distribution() Mar 3, 2026
@andrii-bodnar andrii-bodnar marked this pull request as ready for review March 3, 2026 15:22
@andrii-bodnar andrii-bodnar merged commit 9bfe556 into main Mar 3, 2026
8 checks passed
@andrii-bodnar andrii-bodnar deleted the copilot/mark-deprecated-create-params branch March 3, 2026 15:24
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.39%. Comparing base (63114e5) to head (d8f173d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #244      +/-   ##
==========================================
+ Coverage   99.39%   99.39%   +0.01%     
==========================================
  Files         182      182              
  Lines        8460     8472      +12     
  Branches      187      189       +2     
==========================================
+ Hits         8408     8420      +12     
  Misses         36       36              
  Partials       16       16              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Mark deprecated Distribution create params

3 participants