microcks / microcks/microcks-cli

feat: Automatically open Microcks Dashboard in the browser for better DX

Offen
#423 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Go
Sterne
52
Forks
68
Ø Merge
6 Std. 54 Min.
Gemergte PRs (30 T.)
10

Beschreibung

### 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:

- 1. Centralized Browser Utility: A new package pkg/util to handle cross-platform browser launching with safety
checks.
- 2. 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).
- 3. Command Updates:
* microcks start will open the main dashboard.
* microcks test will open the specific Test Result page.
- 4. User Control: A new flag --launch-browser (defaulting to true) will be added to relevant commands to allow
manual overrides.

### Implementation ideas

* Use the `github.com/skratchdot/open-golang/open `library (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:
1. Core utility + microcks start integration.
2. microcks test integration for direct Test Result links.
3. Refactor existing login --sso logic and add permanent configuration settings in config.yaml.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne in den CLI-Implementierungen für `microcks start` und `microcks test` und untersuche dann die bestehende Abhängigkeit `github.com/skratchdot/open-golang/open` sowie den vorgeschlagenen Speicherort `pkg/util`. Prüfe, wie Flags und Umgebungsvariablen behandelt werden, einschließlich `CI` und `MICROCKS_NO_BROWSER`; als erledigt gilt die Aufgabe, wenn die relevanten Befehle standardmäßig die korrekten UI-Links öffnen, Überschreibungen berücksichtigen und in CI nichts öffnen. Das Issue erwähnt außerdem `login --sso` und `config.yaml` als separate nachgelagerte Arbeit.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
go
Bereich
cli, developer-experience
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.