Skip to content

feat: add deprecation warnings for legacy sync input and output in Job Attachments#991

Merged
godobyte merged 1 commit intoaws-deadline:mainlinefrom
godobyte:cleanup
Feb 5, 2026
Merged

feat: add deprecation warnings for legacy sync input and output in Job Attachments#991
godobyte merged 1 commit intoaws-deadline:mainlinefrom
godobyte:cleanup

Conversation

@godobyte
Copy link
Copy Markdown
Contributor

@godobyte godobyte commented Feb 5, 2026

What was the problem/requirement? (What/Why)

The AssetSync class contains three methods (attachment_sync_inputs, sync_inputs, and sync_outputs) that are no longer used by the worker agent after the ASSET_SYNC_JOB_USER_FEATURE was fully released. These methods represent the legacy approach to attachment synchronization that has been replaced by the OpenJD task-based implementation using AttachmentDownloadAction and AttachmentUploadAction.

While these methods are only used in tests and scripted testing tools, they remain part of the public API and could potentially be used by external consumers. To safely deprecate them without breaking existing code, proper deprecation warnings are needed.

What was the solution? (How)

Added formal deprecation warnings to three methods in asset_sync.py:

  1. attachment_sync_inputs() - Added warnings.warn() with DeprecationWarning
  2. sync_inputs() - Added warnings.warn() with DeprecationWarning
  3. sync_outputs() - Added warnings.warn() with DeprecationWarning

Each method now:

  • Emits a DeprecationWarning when called
  • Includes deprecation notice in docstring using .. deprecated:: format
  • Provides guidance: "Use other public APIs under job attachment instead."
  • Uses stacklevel=2 to show the warning at the caller's location

Added import warnings to the module imports.

What is the impact of this change?

Positive Impacts:

  • Clear migration path: Users are now warned when using deprecated methods
  • Backwards compatible: Methods still work, no breaking changes
  • Better documentation: Docstrings clearly indicate deprecation status
  • Prepares for future cleanup: Enables safe removal in a future major version

User Impact:

  • Users calling these methods will see deprecation warnings in their logs
  • No functional changes - all methods continue to work as before
  • Provides time for users to migrate to alternative APIs

How was this change tested?

See DEVELOPMENT.md for information on running tests.

  • Have you run the unit tests? - Yes, all linting and type checking passes
  • Have you run the integration tests? - Not run yet
  • Have you made changes to the download or asset_sync modules? If so, then it is highly recommended that you ensure that the docker-based unit tests pass. - Yes, changes to asset_sync module. Docker tests should be run.

Testing performed:

  • ✅ All linting checks pass (ruff, mypy)
  • ✅ Syntax validation successful
  • ✅ Type checking passes with no errors

Was this change documented?

  • Are relevant docstrings in the code base updated? - Yes, added .. deprecated:: sections to all three method docstrings
  • Has the README.md been updated? - No changes needed, this is an internal API deprecation

Does this PR introduce new dependencies?

This library is designed to be integrated into third-party applications that have bespoke and customized deployment environments. Adding dependencies will increase the chance of library version conflicts and incompatibilities.

  • This PR adds one or more new dependency Python packages.
  • This PR does not add any new dependencies. - Only uses Python's built-in warnings module

Is this a breaking change?

Not yet - This is not a breaking change. The deprecated methods continue to function exactly as before. The only change is that they now emit DeprecationWarning messages to inform users that these methods will be removed in a future version.

Users can:

  • Continue using the methods (with warnings)
  • Suppress the warnings if needed using warnings.filterwarnings()
  • Migrate to alternative APIs at their convenience

This follows standard Python deprecation practices and provides a graceful migration path.

Does this change impact security?

No, this change only adds deprecation warnings to existing methods without modifying their behavior or file/directory handling.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@godobyte godobyte requested a review from a team as a code owner February 5, 2026 00:24
@github-actions github-actions Bot added the waiting-on-maintainers Waiting on the maintainers to review. label Feb 5, 2026
leongdl
leongdl previously approved these changes Feb 5, 2026
Comment thread src/deadline/job_attachments/asset_sync.py Outdated
…b Attachments

Signed-off-by: Godot Bian <13778003+godobyte@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Feb 5, 2026

@godobyte godobyte changed the title chore: add deprecation warnings for legacy sync input and output in Job Attachments feat: add deprecation warnings for legacy sync input and output in Job Attachments Feb 5, 2026
@godobyte godobyte merged commit 5bba469 into aws-deadline:mainline Feb 5, 2026
27 checks passed
@godobyte godobyte deleted the cleanup branch February 5, 2026 19:58
This was referenced Feb 24, 2026
crowecawcaw added a commit to crowecawcaw/deadline-cloud that referenced this pull request Feb 26, 2026
…b Attachments (aws-deadline#991)

Signed-off-by: Godot Bian <13778003+godobyte@users.noreply.github.com>
Co-authored-by: Godot Bian <13778003+godobyte@users.noreply.github.com>
vinadomi11 pushed a commit to vinadomi11/deadline-cloud that referenced this pull request Mar 5, 2026
…b Attachments (aws-deadline#991)

Signed-off-by: Godot Bian <13778003+godobyte@users.noreply.github.com>
Co-authored-by: Godot Bian <13778003+godobyte@users.noreply.github.com>
Signed-off-by: vinadomi11 <vtubbs@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-on-maintainers Waiting on the maintainers to review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants