Skip to content

Enterprise slug support in Copilot scopes #1

@ewega

Description

@ewega

Summary

Fix scope ID computation to match the incubator-devlake plugin's convention when enterprise is configured.

Changes

  • Add \Enterprise\ field to \CopilotScope\ struct in \internal/devlake/types.go\
  • Implement \copilotScopeID(org, enterprise)\ helper with correct logic:
    • Enterprise + Org -> \�nterprise/org\
    • Enterprise only -> \�nterprise\
    • Org only -> \org\
  • Update \putCopilotScope\ and \scopeCopilot\ to accept and pass enterprise parameter
  • Thread enterprise through all configure commands (scopes, projects, full)
  • Add --enterprise\ flag to \configure scopes\ and \configure projects\ commands
  • Add
    esolveEnterprise()\ helper (flag -> state file -> skip)
  • Add \Organization/\Enterprise\ fields to \Connection\ struct for API responses

Acceptance Criteria

  • \copilotScopeID\ unit tests pass for all edge cases (7 cases)
  • Org-only scope: ID = \my-org\
  • Enterprise+Org scope: ID = \my-enterprise/my-org\
  • Enterprise-only scope: ID = \my-enterprise\
  • State file persists enterprise and auto-resolves on subsequent commands
  • Blueprint references correct scope ID

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions