Skip to content

Persist profiles before install; save even if installs fail#27

Merged
pablopunk merged 1 commit intomainfrom
feat/persist-profiles-on-failure
Aug 7, 2025
Merged

Persist profiles before install; save even if installs fail#27
pablopunk merged 1 commit intomainfrom
feat/persist-profiles-on-failure

Conversation

@pablopunk
Copy link
Owner

Summary

  • Persist user-specified active profiles to state before starting installation, ensuring dot <profile> is saved even if installs fail or the run exits early
  • Add regression test verifying profiles are saved when an install command fails (e.g., sh: false)

Why

  • Users expect their selected profiles to be remembered immediately; previously profiles were saved late in the run. If anything aborted before saving, the selection could be lost.

Details

  • In App.Run, when profiles are provided by the user and not in dry-run, we persist them to the state file prior to installation
  • Kept existing post-install saves for consistency; the pre-save is additive and safe
  • New unit test: TestProfileSavedEvenIfInstallFails

Test plan

  • go test ./... passes
  • Unit test explicitly checks that the state’s ActiveProfiles includes the chosen profile even if a component install fails

🤖 Generated with opencode

…s are saved even if component installs fail. Add regression test to ensure `dot <profile>` persists profiles on failure.

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
@pablopunk pablopunk merged commit d252766 into main Aug 7, 2025
8 checks passed
@pablopunk
Copy link
Owner Author

This was entirely made by GPT-5 btw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant