microcks / microcks/microcks-cli
feat: Automatically open Microcks Dashboard in the browser for better DX
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 52
- Fork
- 68
- Merge medio
- 6h 54m
- PR unite (30g)
- 10
Descrizione
Reason/Context
Currently, when a developer starts Microcks or runs a test, they have to manually click the URL in the console to open the browser. This adds friction to the development loop. It makes the CLI feel more modern and integrated
with the developer's workstation
Description
This enhancement introduces a mechanism to automatically launch the system's default web browser when the CLI
outputs a link to the Microcks UI.
Changes to be introduced:
-
- Centralized Browser Utility: A new package pkg/util to handle cross-platform browser launching with safety
checks.
- Centralized Browser Utility: A new package pkg/util to handle cross-platform browser launching with safety
-
- Environment Awareness: The CLI will detect if it is running in a headless environment (CI/CD) or if the user
has globally disabled browser launching via environment variables (MICROCKS_NO_BROWSER).
- Environment Awareness: The CLI will detect if it is running in a headless environment (CI/CD) or if the user
-
- Command Updates:
- microcks start will open the main dashboard.
- microcks test will open the specific Test Result page.
- Command Updates:
-
- User Control: A new flag --launch-browser (defaulting to true) will be added to relevant commands to allow
manual overrides.
- User Control: A new flag --launch-browser (defaulting to true) will be added to relevant commands to allow
Implementation ideas
- Use the
github.com/skratchdot/open-golang/openlibrary (already present in the project) for cross-platform
support.- Implement a LaunchBrowser(url string, enabled bool) function that checks for os.Getenv("CI") before attempting
to open the browser. - Split the work into three logical PRs:
- Core utility + microcks start integration.
- microcks test integration for direct Test Result links.
- Refactor existing login --sso logic and add permanent configuration settings in config.yaml.
- Implement a LaunchBrowser(url string, enabled bool) function that checks for os.Getenv("CI") before attempting
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dalle implementazioni CLI di microcks start e microcks test, quindi esamina la dipendenza esistente github.com/skratchdot/open-golang/open e il percorso proposto pkg/util. Verifica come vengono gestiti i flag e le variabili d’ambiente, incluse CI e MICROCKS_NO_BROWSER; il lavoro è completato quando i comandi interessati aprono per impostazione predefinita i collegamenti UI corretti, rispettano gli override e non aprono nulla in CI. L’issue menziona inoltre login --sso e config.yaml come attività di follow-up separata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- go
- Ambito
- cli, developer-experience
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100