Skip to content

Footgun: Hardcoded Base Branch Assumption #24

@kitzy

Description

@kitzy

Potential Footgun

Location: Line 1858 in FleetImporter/FleetImporter.py

Issue: Hardcoded assumption that all repos use main branch - will fail for repos using master or custom default branches.

"base": "main",  # TODO: Make this configurable

Impact:

  • PR creation failures for repos not using main
  • Workflow breaks without clear error message
  • Cannot support organizations with different branching strategies

Recommended Fix:

  1. Make base branch configurable via input parameter
  2. Detect default branch via GitHub API:
# Get default branch from repo
repo_info = self._make_github_request(
    "GET",
    f"/repos/{owner}/{repo}",
    github_token
)
default_branch = repo_info.get("default_branch", "main")
  1. Fall back to main only if detection fails

Configuration Option:

Input = {
    "base_branch": {
        "required": False,
        "description": "Base branch for PRs (default: auto-detect)",
    },
}

Priority: Medium - Affects repos with non-standard branching

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfootgunPotential footgun or unexpected behaviorgood first issueGood for newcomersmedium-priorityMedium priority issue

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions