-
Notifications
You must be signed in to change notification settings - Fork 548
Do not include current extension in 'Other popular extensions' #22946
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
Merged
chrstinalin
merged 6 commits into
mozilla:master
from
chrstinalin:#1569-other-extensions
Jan 20, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c0d0c57
Do not include current extension in 'Other popular extensions'
chrstinalin 4d2a12d
include timeout as well
chrstinalin 9057e28
lint
chrstinalin 5fb7e68
comment
chrstinalin 23b3e33
better testing
chrstinalin a4acb49
comment
chrstinalin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,7 @@ def _check(name): | |
'[email protected]', # Tree Style Tab | ||
'[email protected]', # LanguageTool | ||
'{2e5ff8c8-32fe-46d0-9fc8-6b8986621f3c}', # Search by Image | ||
'simple-tab-groups@drive4ik', # Simple Tab Groups | ||
] | ||
|
||
TAAR_LITE_OUTCOME_REAL_SUCCESS = 'recommended' | ||
|
@@ -90,22 +91,29 @@ def get_addon_recommendations(guid_param, taar_enable): | |
else: | ||
outcome = TAAR_LITE_OUTCOME_CURATED | ||
if not guids: | ||
guids = TAAR_LITE_FALLBACKS | ||
guids = get_filtered_fallbacks(guid_param) | ||
return guids, outcome, fail_reason | ||
|
||
|
||
def is_outcome_recommended(outcome): | ||
return outcome == TAAR_LITE_OUTCOME_REAL_SUCCESS | ||
|
||
|
||
def get_addon_recommendations_invalid(): | ||
def get_addon_recommendations_invalid(current_guid=None): | ||
return ( | ||
TAAR_LITE_FALLBACKS, | ||
get_filtered_fallbacks(current_guid), | ||
TAAR_LITE_OUTCOME_REAL_FAIL, | ||
TAAR_LITE_FALLBACK_REASON_INVALID, | ||
) | ||
|
||
|
||
def get_filtered_fallbacks(current_guid=None): | ||
KevinMind marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# Filter out the current_guid from TAAR_LITE_FALLBACKS. | ||
# A maximum of 4 should be returned at a time. | ||
# See https://mozilla.github.io/addons-server/topics/api/addons.html#recommendations | ||
return [guid for guid in TAAR_LITE_FALLBACKS if guid != current_guid][:4] | ||
|
||
|
||
def compute_last_updated(addon): | ||
"""Compute the value of last_updated for a single add-on.""" | ||
from olympia.addons.models import Addon | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.