217 lines
6.2 KiB
Markdown
217 lines
6.2 KiB
Markdown
# scripts/
|
|
|
|
Dieses Verzeichnis enthält Hilfsskripte für den Demo- und Benchmark-Workflow rund um:
|
|
|
|
- **Qt5 → Qt6**
|
|
- **C++11 → C++23**
|
|
- **Copilot CLI**
|
|
- **Entire CLI**
|
|
- **Scaleway BYOK / OpenAI-kompatibler Provider**
|
|
- **lokale Reproduzierbarkeit der Migration**
|
|
|
|
## Übersicht
|
|
|
|
### `create-qt5-legacy-benchmark.sh`
|
|
Erzeugt das Legacy-Beispielprojekt unter:
|
|
|
|
```text
|
|
qt5-before/qt5-legacy-migration-benchmark
|
|
```
|
|
|
|
Das Projekt ist absichtlich veraltet aufgebaut, um eine realistische Migration zu erzwingen, z. B. mit:
|
|
|
|
- `QRegExp`
|
|
- `QDesktopWidget`
|
|
- `QTextCodec`
|
|
- alter `SIGNAL/SLOT`-Syntax
|
|
- `Qt5::Core`, `Qt5::Gui`, `Qt5::Widgets`
|
|
- `C++11`
|
|
|
|
### `run-entire-copilot-migration.sh`
|
|
Standard-Workflow für eine Copilot-CLI-Migration mit Entire:
|
|
|
|
1. Entire für Copilot CLI aktivieren
|
|
2. Baseline committen
|
|
3. Copilot-Session starten
|
|
4. Ergebnis committen
|
|
5. Checkpoints anzeigen
|
|
6. letzten Stand mit Entire erklären
|
|
|
|
Dieses Skript ist für den normalen Migrationslauf gedacht.
|
|
|
|
### `run-entire-copilot-migration-with-optional-rewind-resume.sh`
|
|
Wie das Standardskript, aber zusätzlich mit optionalem:
|
|
|
|
- `entire checkpoint rewind`
|
|
- `entire session resume <branch>`
|
|
|
|
**Wichtig:**
|
|
Die Entire-Dokumentation ist bei Copilot CLI in Bezug auf Rewind/Resume nicht ganz konsistent.
|
|
Die Copilot-CLI-Seite beschreibt Rewind und Resume, während die allgemeine Agent-Übersicht teils eingeschränkte Aussagen macht. Entire installiert Copilot-CLI-Hooks mit `entire agent add copilot-cli`, erstellt Checkpoints bei Commits und speichert die Daten auf `entire/checkpoints/v1`. ([docs.entire.io](https://docs.entire.io/agents/copilot-cli?utm_source=openai))
|
|
|
|
Darum behandelt dieses Skript Rewind/Resume bewusst als **optional** und **fehlertolerant**. Diese Vorsicht ist eine Schlussfolgerung aus den widersprüchlichen Entire-Seiten. ([docs.entire.io](https://docs.entire.io/agents/copilot-cli?utm_source=openai))
|
|
|
|
### `use-scaleway-copilot-debug.sh`
|
|
Hilfsskript zum Setzen einer **Scaleway OpenAI-kompatiblen BYOK-Konfiguration** für Copilot CLI.
|
|
|
|
Typischer Zweck:
|
|
|
|
- Provider-Umgebungsvariablen setzen
|
|
- Copilot CLI mit Scaleway testen
|
|
- Modellname konfigurieren
|
|
- Token-Limits für nicht im Copilot-Katalog enthaltene Modelle explizit setzen
|
|
- Debugging eines externen Providers vereinfachen
|
|
|
|
Ein typischer Inhalt wäre z. B.:
|
|
|
|
- `COPILOT_PROVIDER_TYPE=openai`
|
|
- `COPILOT_PROVIDER_BASE_URL=https://api.scaleway.ai/v1`
|
|
- `COPILOT_PROVIDER_API_KEY=...`
|
|
- `COPILOT_MODEL=qwen3.5-397b-a17b`
|
|
- `COPILOT_PROVIDER_MAX_PROMPT_TOKENS=...`
|
|
- `COPILOT_PROVIDER_MAX_OUTPUT_TOKENS=...`
|
|
|
|
GitHub Copilot CLI BYOK verwendet für OpenAI-kompatible Provider genau dieses Muster aus Base-URL, API-Key und Modell. ([docs.entire.io](https://docs.entire.io/agents/copilot-cli?utm_source=openai))
|
|
|
|
---
|
|
|
|
## Empfohlene Reihenfolge
|
|
|
|
### 1. Legacy-Projekt erzeugen
|
|
|
|
```bash
|
|
./scripts/create-qt5-legacy-benchmark.sh
|
|
```
|
|
|
|
### 2. Optional: Copilot mit Scaleway konfigurieren
|
|
|
|
```bash
|
|
source ./scripts/use-scaleway-copilot-debug.sh
|
|
```
|
|
|
|
Danach kannst du prüfen, ob die Variablen gesetzt sind:
|
|
|
|
```bash
|
|
echo "$COPILOT_PROVIDER_BASE_URL"
|
|
echo "$COPILOT_MODEL"
|
|
```
|
|
|
|
### 3. Migration mit Entire + Copilot starten
|
|
|
|
Standard:
|
|
|
|
```bash
|
|
./scripts/run-entire-copilot-migration.sh qt5-before/qt5-legacy-migration-benchmark
|
|
```
|
|
|
|
Mit optionalem Rewind/Resume:
|
|
|
|
```bash
|
|
./scripts/run-entire-copilot-migration-with-optional-rewind-resume.sh qt5-before/qt5-legacy-migration-benchmark
|
|
```
|
|
|
|
---
|
|
|
|
## Copilot-Prompt für die Migration
|
|
|
|
Die Migrationsskripte verwenden sinngemäß einen Prompt in dieser Richtung:
|
|
|
|
```text
|
|
Migrate the legacy Qt5/C++11 desktop application to Qt6/C++23.
|
|
|
|
Requirements:
|
|
- Read the legacy source project from qt5-before/qt5-legacy-migration-benchmark
|
|
- Write the migrated project into qt6-after/qt6-migrated-benchmark
|
|
- Do not modify the legacy source tree in place
|
|
- Update CMake from Qt5 to Qt6
|
|
- Keep Core, Gui, and Widgets explicitly linked
|
|
- Replace QRegExp with QRegularExpression
|
|
- Replace QDesktopWidget / QApplication::desktop() usage with QScreen-based Qt6 APIs
|
|
- Remove legacy QTextCodec usage and use modern Qt6-safe text handling
|
|
- Modernize old SIGNAL/SLOT syntax to function-pointer connect syntax
|
|
- Replace legacy null pointer literals with nullptr
|
|
- Preserve the .ui and .qrc integration
|
|
- Preserve application behavior
|
|
- Upgrade the project from C++11 to C++23
|
|
- For every code change inside a method, add at least three tests covering the changed behavior
|
|
- Place all generated tests in qt6-after/qt6-migrated-benchmark/tests
|
|
- Update CMake so the migrated application and all tests build successfully with CTest
|
|
- Keep the test file naming compatible with repository policy checks
|
|
- Briefly explain each migration change
|
|
```
|
|
|
|
---
|
|
|
|
## Entire-Hinweise
|
|
|
|
Entire erfasst bei unterstützten Agenten u. a.:
|
|
|
|
- Gesprächsverlauf
|
|
- Dateiveränderungen
|
|
- Zeitstempel
|
|
- Checkpoints bei Commits
|
|
- Session-Kontext auf dem Branch `entire/checkpoints/v1` ([docs.entire.io](https://docs.entire.io/agents/copilot-cli?utm_source=openai))
|
|
|
|
Typischer Entire-Grundablauf:
|
|
|
|
```bash
|
|
entire agent add copilot-cli
|
|
copilot
|
|
git add .
|
|
git commit -m "..."
|
|
entire checkpoint list
|
|
```
|
|
|
|
Dieser Ablauf ist direkt in der Copilot-CLI- und Quickstart-Dokumentation beschrieben. ([docs.entire.io](https://docs.entire.io/agents/copilot-cli?utm_source=openai))
|
|
|
|
---
|
|
|
|
## Hinweise zu `use-scaleway-copilot-debug.sh`
|
|
|
|
Das Skript sollte **gesourct** werden, nicht als eigener Prozess laufen, damit exportierte Variablen in deiner aktuellen Shell erhalten bleiben:
|
|
|
|
```bash
|
|
source ./scripts/use-scaleway-copilot-debug.sh
|
|
```
|
|
|
|
oder kurz:
|
|
|
|
```bash
|
|
. ./scripts/use-scaleway-copilot-debug.sh
|
|
```
|
|
|
|
Außerdem:
|
|
|
|
- keine echten Secrets committen
|
|
- API-Keys nicht im Repo speichern
|
|
- sensible Werte besser aus bereits gesetzten Umgebungsvariablen übernehmen
|
|
|
|
Beispiel:
|
|
|
|
```bash
|
|
export SCW_SECRET_KEY="..."
|
|
source ./scripts/use-scaleway-copilot-debug.sh
|
|
```
|
|
|
|
---
|
|
|
|
## Empfohlene Erweiterungen
|
|
|
|
Optional kannst du später noch ergänzen:
|
|
|
|
- `build-qt6-after.sh`
|
|
- `run-ctest-qt6-after.sh`
|
|
- `compare-before-after.sh`
|
|
- `capture-copilot-env.sh`
|
|
|
|
---
|
|
|
|
## Kurzfassung
|
|
|
|
Der `scripts/`-Ordner enthält alles, um:
|
|
|
|
1. ein Legacy-Qt5-Projekt zu erzeugen,
|
|
2. Copilot CLI optional mit Scaleway zu konfigurieren,
|
|
3. eine Qt6/C++23-Migration mit Entire zu dokumentieren,
|
|
4. und den Migrationslauf reproduzierbar zu machen.
|