From 02df4d4da1f88c71118bb9dcefdddd8ba5f76345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Acosta?= <96029181+tomas2305@users.noreply.github.com> Date: Thu, 11 Dec 2025 22:04:03 -0300 Subject: [PATCH 01/11] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09ae0d4..50f606d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.3.0] - 2024-12-11 + ### Added - Enhanced transaction notifications with detailed information - Shows amount, currency, category, and date in success notifications From e97d82bb3fc017be3f6396b566d87ed915582eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Acosta?= <96029181+tomas2305@users.noreply.github.com> Date: Thu, 11 Dec 2025 22:05:30 -0300 Subject: [PATCH 02/11] Update backport.yml --- .github/workflows/backport.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 767b8b7..447c10a 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -41,7 +41,33 @@ jobs: git checkout -b ${BACKPORT_BRANCH} origin/${TARGET_BRANCH} # Cherry-pick del merge de main - git cherry-pick -m 1 -x ${MERGE_SHA} + if ! git cherry-pick -m 1 -x ${MERGE_SHA}; then + echo "Cherry-pick failed, attempting to auto-resolve conflicts" + + # Check if CHANGELOG.md has conflicts + if git status | grep -q "CHANGELOG.md"; then + echo "CHANGELOG.md has conflicts, auto-resolving..." + + # Accept both changes for CHANGELOG (ours + theirs) + git show HEAD:CHANGELOG.md > /tmp/changelog_ours.md || true + git show ${MERGE_SHA}:CHANGELOG.md > /tmp/changelog_theirs.md || true + + # Merge CHANGELOG sections manually (keep unreleased from theirs, rest from ours) + # For now, accept theirs (incoming changes from main) + git checkout --theirs CHANGELOG.md + git add CHANGELOG.md + fi + + # Check if there are still conflicts + if git diff --name-only --diff-filter=U | grep -q .; then + echo "Unable to auto-resolve all conflicts" + git cherry-pick --abort + exit 1 + fi + + # Continue cherry-pick + git cherry-pick --continue --no-edit + fi git push origin ${BACKPORT_BRANCH} From 9d0a5406e9c4d1d9ce2617513d096e279621cd3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Acosta?= <96029181+tomas2305@users.noreply.github.com> Date: Thu, 11 Dec 2025 22:07:48 -0300 Subject: [PATCH 03/11] Update backport.yml --- .github/workflows/backport.yml | 81 +++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 31 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 447c10a..4f857c5 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -44,47 +44,66 @@ jobs: if ! git cherry-pick -m 1 -x ${MERGE_SHA}; then echo "Cherry-pick failed, attempting to auto-resolve conflicts" - # Check if CHANGELOG.md has conflicts - if git status | grep -q "CHANGELOG.md"; then - echo "CHANGELOG.md has conflicts, auto-resolving..." - - # Accept both changes for CHANGELOG (ours + theirs) - git show HEAD:CHANGELOG.md > /tmp/changelog_ours.md || true - git show ${MERGE_SHA}:CHANGELOG.md > /tmp/changelog_theirs.md || true - - # Merge CHANGELOG sections manually (keep unreleased from theirs, rest from ours) - # For now, accept theirs (incoming changes from main) + # Auto-resolve CHANGELOG.md conflicts (accept incoming from main) + if git status --porcelain | grep -q "^UU CHANGELOG.md"; then + echo "CHANGELOG.md has conflicts, accepting version from main..." git checkout --theirs CHANGELOG.md git add CHANGELOG.md fi - # Check if there are still conflicts - if git diff --name-only --diff-filter=U | grep -q .; then - echo "Unable to auto-resolve all conflicts" + # Auto-resolve package.json conflicts (accept incoming from main) + if git status --porcelain | grep -q "^UU package.json"; then + echo "package.json has conflicts, accepting version from main..." + git checkout --theirs package.json + git add package.json + fi + + # Check for remaining unresolved conflicts + CONFLICTS=$(git diff --name-only --diff-filter=U) + if [ -n "$CONFLICTS" ]; then + echo "Unable to auto-resolve conflicts in: $CONFLICTS" + echo "Please resolve manually on branch: ${BACKPORT_BRANCH}" git cherry-pick --abort exit 1 fi - # Continue cherry-pick - git cherry-pick --continue --no-edit + # Continue cherry-pick with auto-resolved conflicts + git -c core.editor=true cherry-pick --continue fi git push origin ${BACKPORT_BRANCH} - name: Crear PR hacia develop - uses: peter-evans/create-pull-request@v7 - with: - token: ${{ secrets.GITHUB_TOKEN }} - base: develop - branch: backport/pr-${{ github.event.pull_request.number }}-to-develop - title: "Backport #${{ github.event.pull_request.number }} to develop" - body: | - 🔄 Backport automático de #${{ github.event.pull_request.number }} a `develop`. - - **PR original:** #${{ github.event.pull_request.number }} - **Commit:** ${{ github.event.pull_request.merge_commit_sha }} - - --- - _Este PR fue creado automáticamente por el workflow de backport._ - labels: backport - delete-branch: true + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} + MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }} + PR_TITLE: ${{ github.event.pull_request.title }} + run: | + BACKPORT_BRANCH=backport/pr-${PR_NUMBER}-to-develop + + PR_BODY="🔄 Backport automático de #${PR_NUMBER} a \`develop\`. + + **PR original:** #${PR_NUMBER} + **Título:** ${PR_TITLE} + **Commit:** ${MERGE_SHA} + + --- + _Este PR fue creado automáticamente por el workflow de backport._" + + # Create PR, with or without label depending on if it exists + if gh label list | grep -q "^backport"; then + gh pr create \ + --base develop \ + --head ${BACKPORT_BRANCH} \ + --title "Backport #${PR_NUMBER} to develop" \ + --body "${PR_BODY}" \ + --label backport + else + echo "Warning: 'backport' label not found, creating PR without label" + gh pr create \ + --base develop \ + --head ${BACKPORT_BRANCH} \ + --title "Backport #${PR_NUMBER} to develop" \ + --body "${PR_BODY}" + fi From a838e528a12e47e7fd11e1456e130024878b7d9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Acosta?= <96029181+tomas2305@users.noreply.github.com> Date: Thu, 11 Dec 2025 22:11:56 -0300 Subject: [PATCH 04/11] Update backport --- .github/workflows/backport.yml | 7 +++++++ CHANGELOG.md | 26 +++++++++++++++++++++++++- package.json | 2 +- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 4f857c5..56d5a14 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -58,6 +58,13 @@ jobs: git add package.json fi + # Auto-resolve backport.yml conflicts (accept incoming from main) + if git status --porcelain | grep -q "^UU .github/workflows/backport.yml"; then + echo "backport.yml has conflicts, accepting version from main..." + git checkout --theirs .github/workflows/backport.yml + git add .github/workflows/backport.yml + fi + # Check for remaining unresolved conflicts CONFLICTS=$(git diff --name-only --diff-filter=U) if [ -n "$CONFLICTS" ]; then diff --git a/CHANGELOG.md b/CHANGELOG.md index 950f49f..4022ca9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.3.3] - 2024-12-11 + +### Fixed +- Backport workflow now handles merge conflicts automatically + - Auto-resolves conflicts in CHANGELOG.md, package.json, and backport.yml + - Accepts incoming changes from main during backport + - Gracefully handles missing 'backport' label + - Provides clear error messages for unresolvable conflicts + +## [1.3.0] - 2024-12-11 + +### Added +- Enhanced transaction notifications with detailed information + - Shows amount, currency, category, and date in success notifications + - Bold formatting for amount and category for better visibility + - Notifications appear when creating or updating transactions + +### Changed +- Transactions within same date group now sorted by creation order + - Most recently created transactions appear first within each date + - Uses transaction ID for consistent ordering + ## [1.2.0] - 2024-12-11 ### Added @@ -91,7 +113,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - React Router for navigation - Recharts for data visualization -[Unreleased]: https://github.com/tomas2305/platito/compare/1.2.0...HEAD +[Unreleased]: https://github.com/tomas2305/platito/compare/1.3.3...HEAD +[1.3.3]: https://github.com/tomas2305/platito/compare/1.3.0...1.3.3 +[1.3.0]: https://github.com/tomas2305/platito/compare/1.2.0...1.3.0 [1.2.0]: https://github.com/tomas2305/platito/compare/1.1.1...1.2.0 [1.1.1]: https://github.com/tomas2305/platito/compare/1.1.0...1.1.1 [1.1.0]: https://github.com/tomas2305/platito/compare/1.0.0...1.1.0 diff --git a/package.json b/package.json index b3cd988..ef62949 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "platito", "private": true, - "version": "1.2.0", + "version": "1.3.3", "type": "module", "scripts": { "dev": "vite", From bad37aa850a03ffcf634ee1ec8ffb6b59ba11b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Acosta?= <96029181+tomas2305@users.noreply.github.com> Date: Fri, 12 Dec 2025 19:27:22 -0300 Subject: [PATCH 05/11] Update TransactionList.tsx --- src/components/TransactionList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TransactionList.tsx b/src/components/TransactionList.tsx index 8526a82..9a8bd06 100644 --- a/src/components/TransactionList.tsx +++ b/src/components/TransactionList.tsx @@ -244,7 +244,7 @@ export const TransactionList = ({ {groupKeys.map((dateKey) => ( - {formatDateHeader(dateKey)} + {formatDateHeader(dateKey)} {grouped[dateKey].map((tx) => { const account = accountMap.get(tx.accountId); const category = categoryMap.get(tx.categoryId); From ceab06768b6267bd2d0125ec42aa9025fd7fbc3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Acosta?= <96029181+tomas2305@users.noreply.github.com> Date: Sat, 13 Dec 2025 00:51:41 -0300 Subject: [PATCH 06/11] Update backport --- .github/workflows/backport.yml | 6 +++--- CHANGELOG.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 56d5a14..fb74a19 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -47,21 +47,21 @@ jobs: # Auto-resolve CHANGELOG.md conflicts (accept incoming from main) if git status --porcelain | grep -q "^UU CHANGELOG.md"; then echo "CHANGELOG.md has conflicts, accepting version from main..." - git checkout --theirs CHANGELOG.md + git checkout --ours CHANGELOG.md git add CHANGELOG.md fi # Auto-resolve package.json conflicts (accept incoming from main) if git status --porcelain | grep -q "^UU package.json"; then echo "package.json has conflicts, accepting version from main..." - git checkout --theirs package.json + git checkout --ours package.json git add package.json fi # Auto-resolve backport.yml conflicts (accept incoming from main) if git status --porcelain | grep -q "^UU .github/workflows/backport.yml"; then echo "backport.yml has conflicts, accepting version from main..." - git checkout --theirs .github/workflows/backport.yml + git checkout --ours .github/workflows/backport.yml git add .github/workflows/backport.yml fi diff --git a/CHANGELOG.md b/CHANGELOG.md index 4022ca9..808fc22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [1.3.3] - 2024-12-11 +## [1.3.1] - 2024-12-11 ### Fixed - Backport workflow now handles merge conflicts automatically @@ -113,8 +113,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - React Router for navigation - Recharts for data visualization -[Unreleased]: https://github.com/tomas2305/platito/compare/1.3.3...HEAD -[1.3.3]: https://github.com/tomas2305/platito/compare/1.3.0...1.3.3 +[Unreleased]: https://github.com/tomas2305/platito/compare/1.3.1...HEAD +[1.3.1]: https://github.com/tomas2305/platito/compare/1.3.0...1.3.1 [1.3.0]: https://github.com/tomas2305/platito/compare/1.2.0...1.3.0 [1.2.0]: https://github.com/tomas2305/platito/compare/1.1.1...1.2.0 [1.1.1]: https://github.com/tomas2305/platito/compare/1.1.0...1.1.1 From f162fbc55c6f9268c62529cebe49fd9d8dbb184b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Acosta?= <96029181+tomas2305@users.noreply.github.com> Date: Sat, 13 Dec 2025 00:54:48 -0300 Subject: [PATCH 07/11] Update backport.yml --- .github/workflows/backport.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index fb74a19..914b3e6 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -44,24 +44,28 @@ jobs: if ! git cherry-pick -m 1 -x ${MERGE_SHA}; then echo "Cherry-pick failed, attempting to auto-resolve conflicts" + # List all conflicted files + echo "Conflicted files:" + git status --porcelain | grep "^UU" + # Auto-resolve CHANGELOG.md conflicts (accept incoming from main) if git status --porcelain | grep -q "^UU CHANGELOG.md"; then echo "CHANGELOG.md has conflicts, accepting version from main..." - git checkout --ours CHANGELOG.md + git show :3:CHANGELOG.md > CHANGELOG.md git add CHANGELOG.md fi # Auto-resolve package.json conflicts (accept incoming from main) if git status --porcelain | grep -q "^UU package.json"; then echo "package.json has conflicts, accepting version from main..." - git checkout --ours package.json + git show :3:package.json > package.json git add package.json fi # Auto-resolve backport.yml conflicts (accept incoming from main) if git status --porcelain | grep -q "^UU .github/workflows/backport.yml"; then echo "backport.yml has conflicts, accepting version from main..." - git checkout --ours .github/workflows/backport.yml + git show :3:.github/workflows/backport.yml > .github/workflows/backport.yml git add .github/workflows/backport.yml fi From 482fe59d675236bfa97805279cbf200853383751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Acosta?= <96029181+tomas2305@users.noreply.github.com> Date: Sat, 13 Dec 2025 01:01:51 -0300 Subject: [PATCH 08/11] Update backport.yml --- .github/workflows/backport.yml | 134 ++++++++++++++++++++++++--------- 1 file changed, 97 insertions(+), 37 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 914b3e6..00f0906 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -34,6 +34,7 @@ jobs: PR_NUMBER: ${{ github.event.pull_request.number }} MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }} run: | + set -e # Exit on error BACKPORT_BRANCH=backport/pr-${PR_NUMBER}-to-${TARGET_BRANCH} # Traer develop @@ -41,48 +42,83 @@ jobs: git checkout -b ${BACKPORT_BRANCH} origin/${TARGET_BRANCH} # Cherry-pick del merge de main + HAS_CONFLICTS=false + CONFLICT_FILES="" + if ! git cherry-pick -m 1 -x ${MERGE_SHA}; then echo "Cherry-pick failed, attempting to auto-resolve conflicts" - # List all conflicted files - echo "Conflicted files:" - git status --porcelain | grep "^UU" + # List all conflicted files for debugging + echo "=== Conflicted files ===" + git status --porcelain | grep "^UU" || echo "No UU conflicts detected" + echo "========================" - # Auto-resolve CHANGELOG.md conflicts (accept incoming from main) - if git status --porcelain | grep -q "^UU CHANGELOG.md"; then - echo "CHANGELOG.md has conflicts, accepting version from main..." - git show :3:CHANGELOG.md > CHANGELOG.md - git add CHANGELOG.md - fi + # Function to auto-resolve a file + auto_resolve() { + local file="$1" + echo "Auto-resolving: $file" + + # Extract the version from main (being cherry-picked) + if git show :3:"$file" > "$file" 2>/dev/null; then + git add "$file" + echo "✓ Successfully resolved: $file" + return 0 + else + echo "✗ Failed to extract :3 version for: $file" + return 1 + fi + } - # Auto-resolve package.json conflicts (accept incoming from main) - if git status --porcelain | grep -q "^UU package.json"; then - echo "package.json has conflicts, accepting version from main..." - git show :3:package.json > package.json - git add package.json - fi + # Auto-resolve known conflict files + FILES_TO_RESOLVE=( + "CHANGELOG.md" + "package.json" + ".github/workflows/backport.yml" + ) - # Auto-resolve backport.yml conflicts (accept incoming from main) - if git status --porcelain | grep -q "^UU .github/workflows/backport.yml"; then - echo "backport.yml has conflicts, accepting version from main..." - git show :3:.github/workflows/backport.yml > .github/workflows/backport.yml - git add .github/workflows/backport.yml - fi + for file in "${FILES_TO_RESOLVE[@]}"; do + if git status --porcelain | grep -q "^UU $file"; then + auto_resolve "$file" || true + fi + done # Check for remaining unresolved conflicts - CONFLICTS=$(git diff --name-only --diff-filter=U) - if [ -n "$CONFLICTS" ]; then - echo "Unable to auto-resolve conflicts in: $CONFLICTS" - echo "Please resolve manually on branch: ${BACKPORT_BRANCH}" - git cherry-pick --abort - exit 1 - fi + echo "=== Checking for remaining conflicts ===" + REMAINING_CONFLICTS=$(git diff --name-only --diff-filter=U) - # Continue cherry-pick with auto-resolved conflicts - git -c core.editor=true cherry-pick --continue + if [ -n "$REMAINING_CONFLICTS" ]; then + echo "⚠️ Unresolved conflicts remain in:" + echo "$REMAINING_CONFLICTS" + HAS_CONFLICTS=true + CONFLICT_FILES="$REMAINING_CONFLICTS" + + # Add all files (including those with conflict markers) and commit + echo "Creating commit with conflict markers for manual resolution..." + git add -A + git -c core.editor=true cherry-pick --continue || { + # If continue fails, commit manually + git commit -m "Cherry-pick $MERGE_SHA with conflicts + +⚠️ This commit contains unresolved conflicts in: +$REMAINING_CONFLICTS + +Please resolve these conflicts manually." --no-edit + } + else + echo "✓ All conflicts auto-resolved successfully" + # Continue cherry-pick with auto-resolved conflicts + git -c core.editor=true cherry-pick --continue + fi fi + echo "✓ Cherry-pick completed" git push origin ${BACKPORT_BRANCH} + + # Export conflict info for PR creation + echo "HAS_CONFLICTS=$HAS_CONFLICTS" >> $GITHUB_ENV + echo "CONFLICT_FILES<> $GITHUB_ENV + echo "$CONFLICT_FILES" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV - name: Crear PR hacia develop env: @@ -93,14 +129,38 @@ jobs: run: | BACKPORT_BRANCH=backport/pr-${PR_NUMBER}-to-develop - PR_BODY="🔄 Backport automático de #${PR_NUMBER} a \`develop\`. + # Build PR body based on conflict status + if [ "$HAS_CONFLICTS" = "true" ]; then + PR_BODY="🔄 Backport automático de #${PR_NUMBER} a \`develop\`. - **PR original:** #${PR_NUMBER} - **Título:** ${PR_TITLE} - **Commit:** ${MERGE_SHA} - - --- - _Este PR fue creado automáticamente por el workflow de backport._" +**⚠️ CONFLICTOS DETECTADOS** + +Los siguientes archivos tienen conflictos que necesitan resolución manual: +\`\`\` +${CONFLICT_FILES} +\`\`\` + +Por favor, revisa y resuelve los conflictos antes de mergear este PR. + +--- + +**PR original:** #${PR_NUMBER} +**Título:** ${PR_TITLE} +**Commit:** ${MERGE_SHA} + +_Este PR fue creado automáticamente por el workflow de backport._" + else + PR_BODY="🔄 Backport automático de #${PR_NUMBER} a \`develop\`. + +✅ Todos los conflictos fueron resueltos automáticamente. + +**PR original:** #${PR_NUMBER} +**Título:** ${PR_TITLE} +**Commit:** ${MERGE_SHA} + +--- +_Este PR fue creado automáticamente por el workflow de backport._" + fi # Create PR, with or without label depending on if it exists if gh label list | grep -q "^backport"; then From 6a60f2c6fb423f6c258bbb580f8a1af87f09dd88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Acosta?= <96029181+tomas2305@users.noreply.github.com> Date: Sat, 13 Dec 2025 01:04:06 -0300 Subject: [PATCH 09/11] Update backport.yml --- .github/workflows/backport.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 00f0906..aa5f3c9 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -97,12 +97,13 @@ jobs: git add -A git -c core.editor=true cherry-pick --continue || { # If continue fails, commit manually - git commit -m "Cherry-pick $MERGE_SHA with conflicts - -⚠️ This commit contains unresolved conflicts in: -$REMAINING_CONFLICTS - -Please resolve these conflicts manually." --no-edit + git commit -m "Cherry-pick $MERGE_SHA with conflicts" \ + -m "" \ + -m "⚠️ This commit contains unresolved conflicts in:" \ + -m "$REMAINING_CONFLICTS" \ + -m "" \ + -m "Please resolve these conflicts manually." \ + --no-edit } else echo "✓ All conflicts auto-resolved successfully" From 589a84669c71f4f85762ea154046bf7ff5050eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Acosta?= <96029181+tomas2305@users.noreply.github.com> Date: Sat, 13 Dec 2025 01:07:07 -0300 Subject: [PATCH 10/11] Update backport.yml --- .github/workflows/backport.yml | 64 ++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index aa5f3c9..cee1d5c 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -132,35 +132,39 @@ jobs: # Build PR body based on conflict status if [ "$HAS_CONFLICTS" = "true" ]; then - PR_BODY="🔄 Backport automático de #${PR_NUMBER} a \`develop\`. - -**⚠️ CONFLICTOS DETECTADOS** - -Los siguientes archivos tienen conflictos que necesitan resolución manual: -\`\`\` -${CONFLICT_FILES} -\`\`\` - -Por favor, revisa y resuelve los conflictos antes de mergear este PR. - ---- - -**PR original:** #${PR_NUMBER} -**Título:** ${PR_TITLE} -**Commit:** ${MERGE_SHA} - -_Este PR fue creado automáticamente por el workflow de backport._" + { + echo "🔄 Backport automático de #${PR_NUMBER} a \`develop\`." + echo "" + echo "**⚠️ CONFLICTOS DETECTADOS**" + echo "" + echo "Los siguientes archivos tienen conflictos que necesitan resolución manual:" + echo '```' + echo "${CONFLICT_FILES}" + echo '```' + echo "" + echo "Por favor, revisa y resuelve los conflictos antes de mergear este PR." + echo "" + echo "---" + echo "" + echo "**PR original:** #${PR_NUMBER}" + echo "**Título:** ${PR_TITLE}" + echo "**Commit:** ${MERGE_SHA}" + echo "" + echo "_Este PR fue creado automáticamente por el workflow de backport._" + } > pr_body.txt else - PR_BODY="🔄 Backport automático de #${PR_NUMBER} a \`develop\`. - -✅ Todos los conflictos fueron resueltos automáticamente. - -**PR original:** #${PR_NUMBER} -**Título:** ${PR_TITLE} -**Commit:** ${MERGE_SHA} - ---- -_Este PR fue creado automáticamente por el workflow de backport._" + { + echo "🔄 Backport automático de #${PR_NUMBER} a \`develop\`." + echo "" + echo "✅ Todos los conflictos fueron resueltos automáticamente." + echo "" + echo "**PR original:** #${PR_NUMBER}" + echo "**Título:** ${PR_TITLE}" + echo "**Commit:** ${MERGE_SHA}" + echo "" + echo "---" + echo "_Este PR fue creado automáticamente por el workflow de backport._" + } > pr_body.txt fi # Create PR, with or without label depending on if it exists @@ -169,7 +173,7 @@ _Este PR fue creado automáticamente por el workflow de backport._" --base develop \ --head ${BACKPORT_BRANCH} \ --title "Backport #${PR_NUMBER} to develop" \ - --body "${PR_BODY}" \ + --body-file pr_body.txt \ --label backport else echo "Warning: 'backport' label not found, creating PR without label" @@ -177,5 +181,5 @@ _Este PR fue creado automáticamente por el workflow de backport._" --base develop \ --head ${BACKPORT_BRANCH} \ --title "Backport #${PR_NUMBER} to develop" \ - --body "${PR_BODY}" + --body-file pr_body.txt fi From 636690e3c9263a3f2b760e05962ecfdfcfe3c066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Acosta?= <96029181+tomas2305@users.noreply.github.com> Date: Sat, 13 Dec 2025 01:10:24 -0300 Subject: [PATCH 11/11] Remove backport --- .github/workflows/backport.yml | 185 --------------------------------- CHANGELOG.md | 10 +- 2 files changed, 4 insertions(+), 191 deletions(-) delete mode 100644 .github/workflows/backport.yml diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml deleted file mode 100644 index cee1d5c..0000000 --- a/.github/workflows/backport.yml +++ /dev/null @@ -1,185 +0,0 @@ -name: Backport to develop - -on: - pull_request: - types: [closed] - branches: - - main - -jobs: - backport: - runs-on: ubuntu-latest - # Solo si el PR fue mergeado - if: github.event.pull_request.merged == true - - permissions: - contents: write - pull-requests: write - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Config git - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - - - name: Crear branch de backport y cherry-pick - env: - TARGET_BRANCH: develop - PR_NUMBER: ${{ github.event.pull_request.number }} - MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }} - run: | - set -e # Exit on error - BACKPORT_BRANCH=backport/pr-${PR_NUMBER}-to-${TARGET_BRANCH} - - # Traer develop - git fetch origin ${TARGET_BRANCH} - git checkout -b ${BACKPORT_BRANCH} origin/${TARGET_BRANCH} - - # Cherry-pick del merge de main - HAS_CONFLICTS=false - CONFLICT_FILES="" - - if ! git cherry-pick -m 1 -x ${MERGE_SHA}; then - echo "Cherry-pick failed, attempting to auto-resolve conflicts" - - # List all conflicted files for debugging - echo "=== Conflicted files ===" - git status --porcelain | grep "^UU" || echo "No UU conflicts detected" - echo "========================" - - # Function to auto-resolve a file - auto_resolve() { - local file="$1" - echo "Auto-resolving: $file" - - # Extract the version from main (being cherry-picked) - if git show :3:"$file" > "$file" 2>/dev/null; then - git add "$file" - echo "✓ Successfully resolved: $file" - return 0 - else - echo "✗ Failed to extract :3 version for: $file" - return 1 - fi - } - - # Auto-resolve known conflict files - FILES_TO_RESOLVE=( - "CHANGELOG.md" - "package.json" - ".github/workflows/backport.yml" - ) - - for file in "${FILES_TO_RESOLVE[@]}"; do - if git status --porcelain | grep -q "^UU $file"; then - auto_resolve "$file" || true - fi - done - - # Check for remaining unresolved conflicts - echo "=== Checking for remaining conflicts ===" - REMAINING_CONFLICTS=$(git diff --name-only --diff-filter=U) - - if [ -n "$REMAINING_CONFLICTS" ]; then - echo "⚠️ Unresolved conflicts remain in:" - echo "$REMAINING_CONFLICTS" - HAS_CONFLICTS=true - CONFLICT_FILES="$REMAINING_CONFLICTS" - - # Add all files (including those with conflict markers) and commit - echo "Creating commit with conflict markers for manual resolution..." - git add -A - git -c core.editor=true cherry-pick --continue || { - # If continue fails, commit manually - git commit -m "Cherry-pick $MERGE_SHA with conflicts" \ - -m "" \ - -m "⚠️ This commit contains unresolved conflicts in:" \ - -m "$REMAINING_CONFLICTS" \ - -m "" \ - -m "Please resolve these conflicts manually." \ - --no-edit - } - else - echo "✓ All conflicts auto-resolved successfully" - # Continue cherry-pick with auto-resolved conflicts - git -c core.editor=true cherry-pick --continue - fi - fi - - echo "✓ Cherry-pick completed" - git push origin ${BACKPORT_BRANCH} - - # Export conflict info for PR creation - echo "HAS_CONFLICTS=$HAS_CONFLICTS" >> $GITHUB_ENV - echo "CONFLICT_FILES<> $GITHUB_ENV - echo "$CONFLICT_FILES" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - - name: Crear PR hacia develop - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ github.event.pull_request.number }} - MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }} - PR_TITLE: ${{ github.event.pull_request.title }} - run: | - BACKPORT_BRANCH=backport/pr-${PR_NUMBER}-to-develop - - # Build PR body based on conflict status - if [ "$HAS_CONFLICTS" = "true" ]; then - { - echo "🔄 Backport automático de #${PR_NUMBER} a \`develop\`." - echo "" - echo "**⚠️ CONFLICTOS DETECTADOS**" - echo "" - echo "Los siguientes archivos tienen conflictos que necesitan resolución manual:" - echo '```' - echo "${CONFLICT_FILES}" - echo '```' - echo "" - echo "Por favor, revisa y resuelve los conflictos antes de mergear este PR." - echo "" - echo "---" - echo "" - echo "**PR original:** #${PR_NUMBER}" - echo "**Título:** ${PR_TITLE}" - echo "**Commit:** ${MERGE_SHA}" - echo "" - echo "_Este PR fue creado automáticamente por el workflow de backport._" - } > pr_body.txt - else - { - echo "🔄 Backport automático de #${PR_NUMBER} a \`develop\`." - echo "" - echo "✅ Todos los conflictos fueron resueltos automáticamente." - echo "" - echo "**PR original:** #${PR_NUMBER}" - echo "**Título:** ${PR_TITLE}" - echo "**Commit:** ${MERGE_SHA}" - echo "" - echo "---" - echo "_Este PR fue creado automáticamente por el workflow de backport._" - } > pr_body.txt - fi - - # Create PR, with or without label depending on if it exists - if gh label list | grep -q "^backport"; then - gh pr create \ - --base develop \ - --head ${BACKPORT_BRANCH} \ - --title "Backport #${PR_NUMBER} to develop" \ - --body-file pr_body.txt \ - --label backport - else - echo "Warning: 'backport' label not found, creating PR without label" - gh pr create \ - --base develop \ - --head ${BACKPORT_BRANCH} \ - --title "Backport #${PR_NUMBER} to develop" \ - --body-file pr_body.txt - fi diff --git a/CHANGELOG.md b/CHANGELOG.md index 808fc22..dfc3c02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,14 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [1.3.1] - 2024-12-11 +## [1.3.1] - 2024-12-13 ### Fixed -- Backport workflow now handles merge conflicts automatically - - Auto-resolves conflicts in CHANGELOG.md, package.json, and backport.yml - - Accepts incoming changes from main during backport - - Gracefully handles missing 'backport' label - - Provides clear error messages for unresolvable conflicts +- Hotfix: Removed problematic backport workflow that was causing deployment failures + - Backport action had recurring merge conflict issues + - Workflow temporarily disabled until a more robust solution is implemented ## [1.3.0] - 2024-12-11