Skip to content

Support aliases repositories & default org in .gh repo command #1710

@jb3

Description

@jb3

Description

There are some repositories that we frequently want to reference with the .gh repo command, e.g. discord.py, Kubernetes, most PyDis repos.

We should support the following behaviour when the .gh repo command:

flowchart TD
    Start([User Input]) --> CheckFull{Full repo provided?<br/>user/reponame}
    
    CheckFull -->|Yes| UseFull[Use provided repo]
    CheckFull -->|No| CheckStored{Stored repo name?<br/>e.g. kubernetes}
    
    CheckStored -->|Yes| UseStored[Use stored mapping<br/>e.g. kubernetes/kubernetes]
    CheckStored -->|No| CheckPyDiscord{python-discord<br/>has this repo?<br/>e.g. site}
    
    CheckPyDiscord -->|Yes| UsePyDiscord[Use python-discord/reponame<br/>e.g. python-discord/site]
    CheckPyDiscord -->|No| Fail[Fail: Full user/repo<br/>must be provided]
    
    UseFull --> Success([Success])
    UseStored --> Success
    UsePyDiscord --> Success
    Fail --> End([End])
    Success --> End
    
    style Start fill:#e1f5ff,stroke:#0288d1,stroke-width:2px,color:#000
    style CheckFull fill:#fff9c4,stroke:#f57c00,stroke-width:2px,color:#000
    style CheckStored fill:#fff9c4,stroke:#f57c00,stroke-width:2px,color:#000
    style CheckPyDiscord fill:#fff9c4,stroke:#f57c00,stroke-width:2px,color:#000
    style UseFull fill:#c8e6c9,stroke:#388e3c,stroke-width:2px,color:#000
    style UseStored fill:#c8e6c9,stroke:#388e3c,stroke-width:2px,color:#000
    style UsePyDiscord fill:#c8e6c9,stroke:#388e3c,stroke-width:2px,color:#000
    style Success fill:#a5d6a7,stroke:#2e7d32,stroke-width:3px,color:#000
    style Fail fill:#ffcdd2,stroke:#c62828,stroke-width:2px,color:#000
    style End fill:#e1f5ff,stroke:#0288d1,stroke-width:2px,color:#000
Loading

As a set of initial repositories:

  • Popular libraries we get questions about: e.g. discord.py -> Rapptz/discord.py
  • Have a look at some of the other DevOps tooling for other repos to maybe include (kubernetes, ansible)
  • Additionally large projects within Python ecosystem (e.g. numpy, uv, poetry)

We should probably store this in an external resource file rather than embedded into the implementation

One thing I will stipulate is: our aliased version must be the same repo name (e.g. Rapptz/discord.py must be discord.py, not discord, kubernetes must be kubernetes not k8s, etc.)

Would you like to implement this yourself?

  • I'd like to implement this feature myself
  • Anyone can implement this feature

Metadata

Metadata

Assignees

Labels

status: planningDiscussing detailstype: featureRelating to the functionality of the application.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions