Skip to content

fix(seer settings): Fallback to code mappings if seer preferences don't exist#104795

Merged
Mihir-Mavalankar merged 6 commits intomasterfrom
code-mappings-fallback
Dec 11, 2025
Merged

fix(seer settings): Fallback to code mappings if seer preferences don't exist#104795
Mihir-Mavalankar merged 6 commits intomasterfrom
code-mappings-fallback

Conversation

@Mihir-Mavalankar
Copy link
Copy Markdown
Contributor

PR Details

  • The migration function will use code mappings now as a fallback if seer preferences don't exist for a project.
  • Also small change to use ObjectStatus.ACTIVE to get active projects.

@Mihir-Mavalankar Mihir-Mavalankar self-assigned this Dec 11, 2025
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Dec 11, 2025
Copy link
Copy Markdown
Contributor

@roaga roaga left a comment

Choose a reason for hiding this comment

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

what are you doing in case there is no existing_pref in the first place?

@Mihir-Mavalankar
Copy link
Copy Markdown
Contributor Author

Mihir-Mavalankar commented Dec 11, 2025

what are you doing in case there is no existing_pref in the first place?

We will set the preferences with repositories set to []. Assuming code mapping does not exist too.

@roaga
Copy link
Copy Markdown
Contributor

roaga commented Dec 11, 2025

what are you doing in case there is no existing_pref in the first place?

We will set the preferences with repositories set to []. Assuming code mapping does not exist too.

isn't the whole point of the discussion to fallback to code mappings in this case too?

@Mihir-Mavalankar
Copy link
Copy Markdown
Contributor Author

what are you doing in case there is no existing_pref in the first place?

We will set the preferences with repositories set to []. Assuming code mapping does not exist too.

isn't the whole point of the discussion to fallback to code mappings in this case too?

Yes we are falling back. That's this PR. I am calling get_autofix_repos_from_project_code_mappings here as a fallback.

@roaga
Copy link
Copy Markdown
Contributor

roaga commented Dec 11, 2025

what are you doing in case there is no existing_pref in the first place?

We will set the preferences with repositories set to []. Assuming code mapping does not exist too.

isn't the whole point of the discussion to fallback to code mappings in this case too?

Yes we are falling back. That's this PR. I am calling get_autofix_repos_from_project_code_mappings here as a fallback.

but you're only doing it if there is an existing pref and the repos are empty

repositories = existing_pref.get("repositories")
if not repositories:
            repositories = get_autofix_repos_from_project_code_mappings(projects_by_id[project_id])

The case that matters to us is instead if there is no existing pref at all

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #104795    +/-   ##
=========================================
  Coverage   80.47%    80.48%            
=========================================
  Files        9363      9363            
  Lines      401849    401986   +137     
  Branches    25833     25833            
=========================================
+ Hits       323389    323524   +135     
- Misses      78018     78020     +2     
  Partials      442       442            

Copy link
Copy Markdown
Contributor

@roaga roaga left a comment

Choose a reason for hiding this comment

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

a test might be nice as this gets more complicated

@Mihir-Mavalankar Mihir-Mavalankar merged commit 65d347c into master Dec 11, 2025
67 checks passed
@Mihir-Mavalankar Mihir-Mavalankar deleted the code-mappings-fallback branch December 11, 2025 22:06
@Mihir-Mavalankar Mihir-Mavalankar changed the title fix(seer settings): Fallback to code mappings if seer prefernces don'… fix(seer settings): Fallback to code mappings if seer preferences don't exist Dec 11, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants