posit-dev / posit-dev/rsconnect-python

deploy fails to redeploy due to global config

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

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Python
Sterne
37
Forks
28
Ø Merge
1 T. 3 Std.
Gemergte PRs (30 T.)
7

Beschreibung

Replaces https://github.com/posit-dev/connect/issues/30437

System details

OS Version :  OSX Sonoma

Problem Statement

Creating it as a "bug" because it could be perceived as one from the users.

Steps to Reproduce

  1. Deploy an application (I'm using a streamlit dashboard, but shouldn't matter)
    • The application is deployed with an ID, for example: 87a2d580-58fd-4e85-9027-c7946958806c
  2. Delete the application
    • Removed application 87a2d580-58fd-4e85-9027-c7946958806c ("main")
  3. Deploy the same application again
    • The deploy fails with an error: Posit Connect reported an error (calling /__api__/applications/87a2d580-58fd-4e85-9027-c7946958806c): The requested object does not exist.

Actual Behavior

The deploy fails because it tries to reuse an application that was deleted.

This happens even when the user deletes the rsconnect-python directory from the application itself.

That is caused by rsconnect-python saving a global state in /Users/{ME}/Library/Application Support/rsconnect-python where the application ID is stored.

There are 3 problems that I see:

  1. The user is unable to deploy the application again after deleting it
  2. rsconnect-python behaviour is different based on the computer where it gets run as the global state is different
  3. Moving the project directory around causes a mismatch between the global state and the project state (because the global state stores the PATH) even though the project is the same and its state didn't change.

Expected Behavior

  • Doing the deploy again succeeds and creates a new application
  • There is no global state.
    • I think it's perfectly reasonable to store the state in the application itself (as it already does within the $PROJECT_DIR/rsconnect-python subdirectory) so that it can be committed.

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 damit nachzuverfolgen, wie der deploy-Befehl im Verzeichnis rsconnect-python des Projekts und am globalen Speicherort /Users/{ME}/Library/Application Support/rsconnect-python den Zustand liest und schreibt. Reproduziere die Lösch-und-neu-deploy-Sequenz mit der Beispiel-Anwendungs-ID und ermittle anschließend, wie sich der Zustand verhalten sollte, wenn das Projekt verschoben wird. Als erledigt gilt die Aufgabe, wenn ein erneutes Deployment eine neue Anwendung erstellt, ohne auf den globalen Zustand angewiesen zu sein.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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