Skip to content

SG-38266 Remove useless _is_running_in_desktop #1036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

julien-lang
Copy link
Contributor

@julien-lang julien-lang commented Jun 24, 2025

This was introiduced by #811 and tweaked in
shotgunsoftware/tk-framework-desktopstartup#71 but I believe this is no longer useful since we now have an authentication UI selector

Related to shotgunsoftware/tk-framework-desktopstartup#140

This was introiduced by #811 and tweaked in
shotgunsoftware/tk-framework-desktopstartup#71 but I believe this
is no longer useful since we now have an authentication UI selector
Copy link

@Copilot Copilot AI left a comment

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 removes the obsolete _is_running_in_desktop helper and its related mocks now that the authentication UI selector handles desktop vs. web logic. It also cleans up conditional logic in login_dialog._toggle_web and strips out redundant test patches.

  • Drop the _is_running_in_desktop function and its single use in web-toggle logic
  • Update _toggle_web to always consider autodesk_identity_enabled
  • Remove all mocks of _is_running_in_desktop from interactive authentication tests

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/authentication_tests/test_interactive_authentication.py Removed redundant mock.patch calls for _is_running_in_desktop
python/tank/authentication/login_dialog.py Deleted _is_running_in_desktop and simplified _toggle_web logic
Comments suppressed due to low confidence (2)

python/tank/authentication/login_dialog.py:483

  • The behavior now always enables web login when autodesk_identity_enabled is true; consider adding unit tests for this code path outside of a desktop context to ensure it works as expected.
                can_use_web = can_use_web or self.site_info.autodesk_identity_enabled

python/tank/authentication/login_dialog.py:1

  • [nitpick] After removing _is_running_in_desktop, the sys import may now be unused. Consider removing any imports that are no longer needed.
# Copyright (c) 2013 Shotgun Software Inc.

Copy link

codecov bot commented Jun 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.79%. Comparing base (0158a91) to head (e648124).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1036   +/-   ##
=======================================
  Coverage   79.78%   79.79%           
=======================================
  Files         198      198           
  Lines       20773    20769    -4     
=======================================
- Hits        16574    16572    -2     
+ Misses       4199     4197    -2     

☔ 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.

1 participant