fix(workflows): minimal-invasive auto-detect integration from project config#1
Merged
markuswondrak merged 2 commits intofix/workflow-integration-auto-detectfrom Apr 30, 2026
Conversation
… config - Add _INTEGRATION_JSON local constant in engine.py - Replace post-processing _resolve_integration_auto() with inline _resolve_default() + _load_project_integration() methods - Revert all Black style-only changes to engine.py, __init__.py - Delete unnecessary constants.py - Add TestIntegrationAutoDetect with 6 tests (no changes to existing tests) - Update workflow.yml: default 'auto', remove static integrations.any list Agent-Logs-Url: https://github.com/markuswondrak/spec-kit/sessions/4cb75741-9272-4a13-a90b-cc6cad486967 Co-authored-by: markuswondrak <245696895+markuswondrak@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor PR #2408 to remove unrelated style changes
fix(workflows): minimal-invasive auto-detect integration from project config
Apr 30, 2026
6727c14
into
fix/workflow-integration-auto-detect
8 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The original PR github#2408 correctly fixed the hardcoded
default: "copilot"integration input (issue github#2406) but was bloated by ~1500 lines of unrelated Black formatting changes, an unnecessaryconstants.py, and a post-processing approach that drew review feedback. This revision keeps only the essential logic.What changed
src/specify_cli/workflows/engine.py_INTEGRATION_JSON = ".specify/integration.json"as a module-level constant (replaces the removedconstants.pyimport)if resolved.get("integration") == "auto"block with an inline hook in_resolve_inputs():_resolve_default()dispatches to_load_project_integration()only forintegration="auto"; all other inputs pass through unchanged_load_project_integration()reads.specify/integration.jsonand falls back to"copilot"for missing/unreadable/invalid files (backwards-compatible)tests/test_workflows.pyTestIntegrationAutoDetect(6 tests) covering: JSON resolution, missing file fallback, explicit input override, malformed JSON,OSError, and whitespace-only value — all as targeted unit tests with no changes to existing testsworkflows/speckit/workflow.ymlintegrationdefault changed from"copilot"→"auto"requires.integrations.anystatic allowlist (incompatible with dynamic resolution)Removed from original PR
src/specify_cli/constants.py(unnecessary new module)src/specify_cli/__init__.pyandengine.pyOriginal prompt
Ziel: PR github#2408 (Branch
fix/workflow-integration-auto-detect) minimal-invasiv überarbeitenDer bestehende PR #2408 auf dem Branch
fix/workflow-integration-auto-detectlöst das Problem aus Issue github#2406 korrekt, ist aber durch unrelated Style-Änderungen (Black-Formatierung) aufgebläht und enthält unnötige Dateien. Bitte überarbeite den Branch so, dass nur die inhaltlich notwendigen Änderungen enthalten sind.Was zu tun ist
1.
src/specify_cli/__init__.py— alle Änderungen rückgängig machenDiese Datei enthält ausschließlich Black-Formatierungsänderungen ohne inhaltlichen Mehrwert. Setze sie auf den Stand von
mainzurück (keine Änderungen an dieser Datei).2.
src/specify_cli/constants.py— Datei entfernenDiese neue Datei ist nicht notwendig und hat eine Kette von Review-Kommentaren über Import-Seiteneffekte ausgelöst. Den Pfad stattdessen als lokale Konstante direkt in
engine.pydefinieren.3.
src/specify_cli/workflows/engine.py— nur die inhaltliche Logik behaltenDie Implementierung soll so aussehen (alle unrelated Style-Fixes entfernen, nur folgende neue Logik hinzufügen):
a) Den Import von
constants.pyentfernen:b) Lokale Konstante am Anfang der Datei (nach den anderen Konstanten) hinzufügen:
c) In
_resolve_inputs()den bestehenden Default-Zweig anpassen (innerhalb der Schleife, kein Post-Processing danach):d) Die Post-Processing-Zeilen entfernen (die nach der Schleife stehen):
e)
_resolve_integration_auto()umbenennen und ersetzen durch zwei Methoden:Wichtig: Alle anderen Style-Fixes in
engine.py(z.B. Zeilenumbrüche in Funktionsaufrufen, Anführungszeichen, etc.) rückgängig machen — die Datei soll abgesehen von den neuen Methoden identisch mitmainsein.4.
tests/test_workflows.py— nur neue Tests, keine Style-FixesAlle Formatierungsänderungen an bestehenden Tests rückgängig machen. Nur die neue Testklasse
TestIntegrationAutoDetectbehalten. Diese Klasse soll folgende Tests enthalten:test_integration_auto_default_uses_project_integration—"auto"löst zu.specify/integration.jsonauftest_integration_auto_default_falls_back_to_copilot_when_no_json— kein JSON → Fallback auf"copilot"test_integration_explicit_input_overrides_auto— expliziter--input integration=Xgewinnttest_integration_auto_ignores_malformed_integration_json— kaputtes JSON → Fallback auf"copilot"test_integration_auto_falls_back_on_oserror— OSError → Fallback auf"copilot"test_integration_auto_ignores_whitespace_only_value— Whitespace-only Value → Fallback auf"copilot"Wichtig: Bestehende Tests in
test_workflows.pysollen exakt wie inmainbleiben — kein Reformat, keine Leerzeilen, keine Importe anpassen.5.
workflows/speckit/workflow.yml— diese Änderungen behaltenUnd die
requires.integrations.any-Liste entfernen (wie in PR github#2421 gemacht), da eine statische Allowlist mit"auto"nicht sinnvoll kombinierbar ist...This pull request was created from Copilot chat.