From f86c403ab2692218cc0f7f3df282c31a19da35a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Sainl=C3=A9ger?= Date: Tue, 10 Mar 2026 17:11:03 +0100 Subject: [PATCH] [IMP] push directly to branches instead of creating PRs CI config changes are low-risk and don't affect business code. Direct push eliminates the need to manually validate 50+ PRs. Changes: - Push commits directly to target branches (no AGit PR flow) - Simplified commit message: '[CI] sync config from odoo-elabore-ci' - Update README to reflect direct push behavior --- .gitea/workflows/deploy-config.yml | 24 ++++++++++-------------- README.md | 9 +++++---- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/.gitea/workflows/deploy-config.yml b/.gitea/workflows/deploy-config.yml index 1f4fa33..4f50022 100644 --- a/.gitea/workflows/deploy-config.yml +++ b/.gitea/workflows/deploy-config.yml @@ -173,22 +173,18 @@ jobs: echo "" if [ "$DRY_RUN" = "true" ]; then - echo "🔍 DRY-RUN: Would create PR for $repo:$VERSION" - echo "[DRY-RUN] $repo:$VERSION - PR would be created" >> ../$SUMMARY_FILE + echo "🔍 DRY-RUN: Would push to $repo:$VERSION" + echo "[DRY-RUN] $repo:$VERSION - would be updated" >> ../$SUMMARY_FILE else - echo "🚀 Creating PR for $repo:$VERSION" + echo "🚀 Pushing to $repo:$VERSION" git config user.name "elabore_bot" git config user.email "gitea.bot@elabore.coop" - git checkout -b "${VERSION}-config_deployment" git add . - git commit -m "Sync config from ${CONFIG_REPO} (version ${VERSION})" + git commit -m "[CI] sync config from ${CONFIG_REPO}" - if git push --quiet origin "${VERSION}-config_deployment":refs/for/"${VERSION}" \ - -o topic="${VERSION}-config_deployment" \ - -o title="Sync config from ${CONFIG_REPO} (version ${VERSION})" \ - -o force-push; then - echo "✅ PR created for $repo:$VERSION" - echo "[CREATED] $repo:$VERSION - PR created" >> ../$SUMMARY_FILE + if git push --quiet origin HEAD:"${VERSION}"; then + echo "✅ Pushed to $repo:$VERSION" + echo "[PUSHED] $repo:$VERSION" >> ../$SUMMARY_FILE pr_created=$((pr_created + 1)) else echo "❌ Push failed for $repo:$VERSION" @@ -210,12 +206,12 @@ jobs: echo " DEPLOYMENT SUMMARY" echo "============================================" if [ "$DRY_RUN" = "true" ]; then - echo "Mode: DRY-RUN (no PRs created)" + echo "Mode: DRY-RUN (no changes pushed)" else - echo "Mode: LIVE" + echo "Mode: LIVE (direct push to branches)" fi echo "" - echo "PRs created: $pr_created" + echo "Branches updated: $pr_created" echo "Skipped (no changes): $pr_skipped_no_changes" echo "Skipped (branch missing): $pr_skipped_no_branch" echo "Errors: $errors" diff --git a/README.md b/README.md index 0256e5f..16d970c 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,8 @@ The deployment is **manually triggered** via Gitea Actions interface, giving you **Features:** - **Version filter**: Deploy to all versions or a specific one (16.0, 18.0) - **Repo filter**: Deploy to all repos or specific ones (comma-separated) -- **Dry-run mode**: Preview changes without creating any PRs +- **Dry-run mode**: Preview changes without pushing anything +- **Direct push**: Commits are pushed directly to target branches (no PR) **Process:** 1. Detects available versions (folders in `config/` other than `common/`) @@ -57,7 +58,7 @@ The deployment is **manually triggered** via Gitea Actions interface, giving you - Attempts to clone the corresponding branch - Copies `config/common/` then `config/{version}/` - In dry-run: shows what would change - - In live mode: creates a Pull Request if changes detected + - In live mode: commits and pushes directly to the branch ### CI Workflow (`pre-commit.yml`) @@ -93,7 +94,7 @@ Deployment is done via the Gitea Actions interface: |-----------|-------------|----------| | **Version** | Odoo version to deploy | `all`, `16.0`, `18.0` | | **Repos** | Target repos (empty = all) | `crm-addons, hr-addons` | -| **Dry-run** | Preview without creating PRs | `true` (recommended first) | +| **Dry-run** | Preview without pushing | `true` (recommended first) | #### Deployment Examples @@ -115,7 +116,7 @@ Deployment is done via the Gitea Actions interface: → Review the logs to see what would change 4. If satisfied, run again WITHOUT dry-run - → PRs are created in target repos + → Changes are pushed directly to target branches ``` ### Modifying CI Configuration