Skip to content

Try to fix CONFLICT on pop - #111

Open
ecarreras wants to merge 5 commits into
masterfrom
fix_pop_confict
Open

Try to fix CONFLICT on pop#111
ecarreras wants to merge 5 commits into
masterfrom
fix_pop_confict

Conversation

@ecarreras

@ecarreras ecarreras commented Nov 5, 2021

Copy link
Copy Markdown
Member
  • Restore dirty working-tree changes after applying a patch.
  • Capture git stash pop failures without letting Fabric abort before cleanup.
  • Detect unmerged index entries explicitly and reset a conflicting pop while preserving the stash.
  • Keep compatibility with the current PatchApplier.apply(..., sudo_user=...) API.

Validation

  • Python 2.7: pytest -q — 17 passed.

@ecarreras ecarreras self-assigned this Nov 5, 2021
@guilleJB

guilleJB commented Nov 9, 2021

Copy link
Copy Markdown
Member

Could generate a git diff file before to stash dirty code and delete it when all runs well?

@ecarreras

Copy link
Copy Markdown
Member Author

Could generate a git diff file before to stash dirty code and delete it when all runs well?

Why? the stash doesn't get deleted if we do a git reset --merge

@guilleJB

guilleJB commented Nov 9, 2021

Copy link
Copy Markdown
Member

Why? the stash doesn't get deleted if we do a git reset --merge

Sorry, I'm read git merge --reset not git reset --merge

@ecarreras ecarreras added the minor Minor auto version V_.X._ label Feb 3, 2023
@ecarreras
ecarreras requested review from giscebot and removed request for eberloso July 24, 2026 18:29

@giscebot giscebot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes because the conflict detector is incorrect for the normal case and the actual conflict path is not reliably handled. I reviewed the full PR discussion and diff, traced Fabric command behavior, checked the current branch state, ran git diff --check, and reproduced the detector after a successful git stash pop in a temporary repository. The PR also has no CI checks and currently conflicts with master.

Comment thread apply_pr/fabfile.py Outdated
@ecarreras

Copy link
Copy Markdown
Member Author

@giscebot please fix this with

giscebot and others added 2 commits July 24, 2026 18:42
Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com>
Resolve the stash-pop handling against the current PatchApplier API and keep the regression tests isolated from the legacy Fabric test doubles.

Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com>
@giscebot

Copy link
Copy Markdown
Contributor

Fixed and pushed in 04f7e5f.

  • corrected successful/conflicting git stash pop handling;
  • added regression coverage for both paths;
  • merged current master and resolved the PR conflict;
  • Python 2.7 suite: 17 passed.

The PR is now mergeable (CLEAN). There are currently no configured GitHub checks on this PR.

@ecarreras

Copy link
Copy Markdown
Member Author

@giscebot tingues en compte el mode "local"

@giscebot

giscebot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Sí, revisat tenint en compte el mode --local.

En local aquest cas no pot arribar a stash pop: apply_pr/local.py::validate_repository() rebutja el checkout si git status --porcelain no és buit, abans de registrar ni aplicar el desplegament. L’invariant ja està cobert per test_rejects_dirty_checkout_before_registering_deployment.

Per tant, la gestió de conflictes de restauració d’aquesta PR ha de continuar limitada al backend Fabric/remot (PatchApplier); afegir un stash implícit al mode local canviaria deliberadament el seu contracte de seguretat. Els conflictes de git am locals ja segueixen el seu flux propi (--abort amb auto_exit o resolució manual). No veig cap canvi addicional necessari a la PR pel mode local.

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

Labels

enhancement minor Minor auto version V_.X._

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants