Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions docsource/100_maintain_repository.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The following documentation is for OpenUpgrade Maintainers.
Set up the branch for a new Odoo release
----------------------------------------

Wait until the new branch was created via an entry in https://github.com/OCA/repo-maintainer-conf, then run the following script:

.. literalinclude:: maintainer_scripts/setup_new_branch.sh
:language: shell

Expand All @@ -18,16 +20,12 @@ Manual changes

* Run the module migration, see https://github.com/OCA/OpenUpgrade/wiki/Crude-script-to-create-the-full-analysis-between-two-versions-of-Odoo. Run with Odoo configuration option module_coverage_file_folder = <some folder>.

* On success, propose the migration of ``upgrade_analysis`` into server-tools, and the analysis files into ``openupgrade_scripts``.
* Add the coverage file from the step above (e.g. docsource/modules170-180.rst)

* Add a coverage file (e.g. docsource/modules170-180.rst)
* On success, propose the migration of ``upgrade_analysis`` into server-tools

* In the ``OpenUpgrade``/``documentation`` branch, add a new line in ``build_openupgrade_docs``.
* PR adding a job for the new version in ``.github/workflows/generate-analysis-cron.yml`` on the current default branch of OpenUpgrade

* Push a test database for the old release to GitHub (see https://github.com/OCA/OpenUpgrade/wiki/How-to-create-a-reference-database)
* PR adding a job for the new version in ``.github/workflows/generate-testdb-cron.yml`` on the current default branch of OpenUpgrade

* Execute the technical migration of ``openupgrade_framework``.

* Check files in .github/workflows for any required changes.

* Once development starts on the new edition's migration scripts, change the default branch for new PRs at https://github.com/OCA/OpenUpgrade/settings/branches.
48 changes: 25 additions & 23 deletions docsource/maintainer_scripts/setup_new_branch.sh
Original file line number Diff line number Diff line change
@@ -1,54 +1,52 @@
#!/bin/bash
set -e
# Configuration
export PREV=16.0 OLD=17.0 NEW=18.0
export PREV=17.0 OLD=18.0 NEW=19.0

git clone https://github.com/OCA/OpenUpgrade --single-branch -b $OLD
cd OpenUpgrade
git fetch origin $NEW:$NEW

NODOTPREV=${PREV/\./} # e.g. 16.0 -> 160
NODOTDOLD=${OLD/\./} # e.g. 17.0 -> 170
NODOTNEW=${NEW/\./} # e.g. 18.0 -> 180
ESCAPEDPREV=${PREV/\./\\\.} # e.g. 16.0 -> 16\.0
ESCAPEDOLD=${OLD/\./\\\.} # e.g. 17.0 -> 17\.0

# Create a new empty branch
git checkout --orphan $NEW
git rm -rf .
git commit --allow-empty --no-verify -m "[INIT] $NEW: Initialize branch"
git push origin $NEW

# Create a dedicated branch
git checkout -b $NEW-initialize
git checkout $NEW -b $NEW-initialize

# Recover all the code from the old branch,
# - Remove coverage docsource file from old version
# - openupgrade_framework will be migrated in a future PR.
# - Remove scripts from old version
# Recover code from the old branch:
# - bare openupgrade_scripts
# - openupgrade-specific github actions
git format-patch --keep-subject --stdout $NEW..$OLD -- \
':!docsource' \
':!openupgrade_framework' \
openupgrade_scripts \
':!openupgrade_scripts/scripts' \
':!openupgrade_scripts/apriori.py' \
.github \
':!.github/workflows/pre-commit.yml' \
':!.github/workflows/stale.yml' \
':!.github/workflows/test.yml' \
.prettierignore \
| git am -3 --keep

# Replace No-Dot Syntax (140, 150, ...)
sed -i "s/$NODOTDOLD/$NODOTNEW/g" .github/workflows/*
sed -i "s/$NODOTPREV/$NODOTDOLD/g" .github/workflows/*
sed -i "s/$NODOTDOLD/$NODOTNEW/g" .github/workflows/{documentation-commit.yml,test-migration.yml}
Copy link

@sergiocorato sergiocorato Dec 16, 2025

Choose a reason for hiding this comment

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

test-migration.yml does not exist in the repository, so it raises an error (or is a problem with my environment)

Copy link
Member Author

Choose a reason for hiding this comment

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

did you do the renaming with the commandline as pointed out above?

Copy link
Member Author

Choose a reason for hiding this comment

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

@sergiocorato need any help here? Note this won't work any more now that #5395 is merged, to test this now you'll need to rewind the 19.0 branch on your fork to before this merge, change the remote in the script to use your fork and still add the line from above after line 7

sed -i "s/$NODOTPREV/$NODOTDOLD/g" .github/workflows/{documentation-commit.yml,test-migration.yml}

# Replace Doted Syntax (14.0, 15.0, ...)
# Replace Dotted Syntax (14.0, 15.0, ...)
sed -i "s/$ESCAPEDOLD/$NEW/g" \
.github/workflows/* \
.pylintrc* \
README.md \
.github/workflows/{documentation-commit.yml,test-migration.yml} \
openupgrade_scripts/readme/*

# Reset version in manifest file
sed -i "s/17\.0\(\.[[:digit:]]\)\{3\}/$NEW\.1\.0\.0/g" openupgrade_scripts/__manifest__.py
sed -i "s/$ESCAPEDOLD\(\.[[:digit:]]\)\{3\}/$NEW\.1\.0\.0/g" openupgrade_scripts/__manifest__.py

sed -i "s/$ESCAPEDPREV/$OLD/g" \
.github/workflows/* \
.github/workflows/{documentation-commit.yml,test-migration.yml} \
openupgrade_scripts/readme/*

git commit -am "[INIT] $NEW: Replace version numbers." --no-verify
git commit -am "[UPD] $NEW: Replace version numbers." --no-verify

# Initialize apriori.py file
cat << EOF > ./openupgrade_scripts/apriori.py
Expand Down Expand Up @@ -87,3 +85,7 @@ EOF

git add ./openupgrade_scripts/apriori.py
git commit -am "[INIT] $NEW: Initialize apriori.py file." --no-verify

pre-commit run -a || pre-commit run -a
git add .
git commit -am "[FIX] $NEW: pre-commit"