ref(coding integrations): get current branch from autofix state#111368
ref(coding integrations): get current branch from autofix state#111368
Conversation
| # If branch_name is unset in preferences, resolve it from the autofix run state | ||
| if not repo.branch_name: | ||
| try: | ||
| autofix_state = get_autofix_state(run_id=run_id, organization_id=group.organization.id) |
There was a problem hiding this comment.
Don't have a lot of context on what requires the branch name but if the branch name is missing can it be set in Seer in the preference table updated there? This function get_autofix_state make a call to Seer just to get the state for the branch name.
There was a problem hiding this comment.
If there is no way to know when we should set branch name in Seer I think this is fine in theory.
There was a problem hiding this comment.
Technically the preference table is for someone to say that they explicitly want seer to look at something that isn't the default branch whereas seer handles the logic to resolve to the current head branch if nothing is set, so this covers the edge case of someone who changes their default branch between two runs.
Previously getting branch name from preferences, which can be empty and allow an LLM to hallucinate in a handoff. This PR switches to using the seer-resolved value from autofix-state which gets the head from the github repo. A corresponding PR makes the needed changes in getsentry to use these values in the request.