Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
76ae6e5
17.0 - Initial setup
legalsylvain Nov 8, 2023
9d08c2c
[INIT] Adapt to V17
legalsylvain Nov 8, 2023
99e52e4
[INIT] Realy disable .github/workflows/test.yml because the openupgra…
legalsylvain Nov 8, 2023
3ab840d
[MIG] openupgrade_scripts: scaffolding the 17.0 module
StefanRijnhart Feb 2, 2024
4c50ce2
[BOT] post-merge updates
OCA-git-bot Feb 27, 2024
15ab0a7
[FIX] define openupgradelib git url in test-requirements.txt
legalsylvain Feb 28, 2024
d2bb4f8
[BOT] post-merge updates
OCA-git-bot Feb 28, 2024
c194c22
[IMP] openupgrade_framework: pre-commit auto fixes and enable
royle-vietnam May 14, 2024
931800c
[MIG] openupgrade_framework v17
daiduongnguyen-odoo May 22, 2024
7b9bfd4
[INIT] 18.0: Replace version numbers.
legalsylvain Sep 30, 2024
f5c787f
[FIX] Don't execute regular tests
pedrobaeza Oct 11, 2024
53f1dab
[OU-ADD] enable tests, add decorator to make them convenient to use
hbrunn Nov 18, 2024
5e13a6d
[OU-FIX] apply doodba's patch to fix building gevent
hbrunn Nov 18, 2024
6fbacaf
[OU-ADD] explicitly disable loading demo data
hbrunn Nov 18, 2024
d20d530
[OU-ADD] enable coverage/codecov
hbrunn Nov 30, 2024
182b169
[ADD] install openupgradelib from github
hbrunn Jan 20, 2025
127fb34
[IMP] copier and github workflows
MiquelRForgeFlow Feb 13, 2025
a1a1f7b
[BOT] post-merge updates
OCA-git-bot Mar 21, 2025
5ab2d73
[ADD] update analysis bot
hbrunn Mar 24, 2025
0c7d80e
[IMP] pin random github actions to their SHA commit
hbrunn Mar 31, 2025
2537be8
[IMP] analysis bot: reword commit message and PR title
hbrunn May 26, 2025
8e80961
[ADD] install phonenumbers in ci as it's a hard dependency for
hbrunn May 26, 2025
ec9adae
[FIX] github workflow: cbor2 issues
MiquelRForgeFlow Aug 11, 2025
0e0223e
[UPD] 19.0: Replace version numbers.
hbrunn Oct 3, 2025
e50d5a6
[FIX] 19.0: pre-commit
hbrunn Oct 3, 2025
53089ef
[IMP] run test migration in the same cases as standard tests
hbrunn Oct 3, 2025
5c60cd8
[IMP] download test database from current repository
hbrunn Oct 3, 2025
9e685a4
[ADD] .prettierignore from v18
hbrunn Oct 3, 2025
dfaf7f7
[IMP] CI: skip tests after test migration if there are no modules
hbrunn Dec 25, 2025
a1ec565
[UPD] README.rst
OCA-git-bot Dec 25, 2025
ab09ac3
[FIX] install dependencies for v18
hbrunn Nov 7, 2025
95fdc1a
[FIX] pin setuptools to v81.0
hbrunn Feb 9, 2026
c22fe77
[FIX] cbor2 patch not necessary any more
hbrunn Mar 30, 2026
a76cf65
[ADD] funding options
thomaspaulb Mar 30, 2026
a469751
[IMP] allow to generate test databases manually
hbrunn Sep 26, 2025
1919e3b
[UPD] add v19 database generation
hbrunn Sep 26, 2025
331e265
[IMP] add a github workflow that generates test databases used in CI
hbrunn Sep 12, 2025
c2cee3f
[IMP] ignore upgrade_general_log.txt when looking for changed modules
hbrunn Sep 26, 2025
0b04fd9
[FIX] generate-{analysis,testdb}: pin version of google-auth
hbrunn Feb 2, 2026
97befb9
[ADD] code import from https://github.com/grap/openupgrade-extra-tools
legalsylvain Jun 23, 2026
85a90d0
[ADD] check dependency action
hbrunn Jun 23, 2026
f617a1b
[IMP] check_dependency: don't set blocked label
hbrunn Jul 7, 2026
4e3b48e
[IMP] point to the v20 crowdfunding
hbrunn Sep 8, 2026
a4c0b4f
[UPD] 20.0: Replace version numbers.
hbrunn Sep 29, 2026
c56c4ee
[INIT] 20.0: Initialize apriori.py file.
hbrunn Sep 29, 2026
b6b9c37
[FIX] : pre-commit
hbrunn Sep 29, 2026
a3b4bab
[INIT] Full refactor of the OpenUpgrade project
legalsylvain Nov 1, 2020
979a031
[DEL] openupgrade_records -> server-tools/14.0
StefanRijnhart Nov 29, 2020
e6618ab
[RFR] OpenUpgrade framework patches
StefanRijnhart Dec 6, 2020
56e072f
[UPD] README.rst
OCA-git-bot Jan 20, 2021
3ff6271
[ADD] icon.png
OCA-git-bot Jan 20, 2021
7ea4374
[FIX] _logger.warn -> _logger.warning
MiquelRForgeFlow Mar 25, 2021
4a26d43
[FIX] doc: base must be included in --load parameter
MiquelRForgeFlow Mar 25, 2021
6c13a6a
[UPD] README.rst
OCA-git-bot Mar 25, 2021
7f9a67a
[FIX] base: Don't fail uninstalling when missing models
MiquelRForgeFlow Apr 8, 2021
029dcd1
[FIX] openupgrade_framework: _drop_column was in wrong class
MiquelRForgeFlow Apr 12, 2021
63c68fa
[DOC] add banner file, to make this module more visible on the app st…
legalsylvain Jun 10, 2021
d657fbc
[UPD] README.rst
OCA-git-bot Jun 10, 2021
dab9fb5
[FIX] Don't break on missing model in selection _process_ondelete
StefanRijnhart Jul 7, 2021
1e69c87
[REF] Add maintainers
legalsylvain Aug 4, 2021
b2a9590
[UPD] README.rst
OCA-git-bot Aug 5, 2021
73106ec
[IMP] openupgrade_framework: avoid AttributeError in view validation
MiquelRForgeFlow Oct 4, 2021
9c525c0
[MIG][15.0] openupgrade_framework
legalsylvain Nov 15, 2021
94a6f41
[REF] adapt framework, due to renaming handle_view_error into _raise_…
legalsylvain Nov 15, 2021
190e77e
fixup! [WIP][15.0] base module
legalsylvain Nov 15, 2021
1ff2997
fixup! fixup! [WIP][15.0] base module
legalsylvain Nov 15, 2021
20f33bf
Update method _postprocess_view of ir_ui_view by removing the input a…
jcdrubay May 10, 2022
7092c7b
[MIG] remove the odoo_patch on function _postprocess_view which becam…
jcdrubay May 11, 2022
202a30a
Adjustements for code style
jcdrubay May 12, 2022
51af030
[UPD] README.rst
OCA-git-bot May 18, 2022
0c15d32
[OU-FIX] Migration scripts were not run during install
StefanRijnhart Feb 27, 2022
ea663ff
[IMP] openupgrade_framework: to not crash, simply not deactivating the
royle-vietnam Jul 11, 2022
35aee25
[IMP] openupgrade_framework: add environ parameter to force demo
MiquelRForgeFlow Jun 20, 2022
fbf0aae
[UPD] README.rst
OCA-git-bot Jul 18, 2022
dae2d3d
[IMP] base: override to not raise an exception
royle-vietnam May 14, 2022
78bf1ef
[FIX] openupgrade_framework: Proper module dependency resolution
pedrobaeza Jul 24, 2022
d1a5b49
[FIX] framework: monkeypatch needs to patch original method
MiquelRForgeFlow Sep 13, 2022
12c2a35
[FIX] framework: monkeypatch needs to patch original method (fixup)
MiquelRForgeFlow Sep 14, 2022
ef7b593
[MIG] openupgrade_framework v16
hbrunn Jan 10, 2023
f961683
[ADD] implement tests of migrations
hbrunn Jan 17, 2023
d06814a
[FIX] Add openupgradelib dependencies in manifest files
legalsylvain Mar 27, 2023
791cfe6
[UPD] README.rst
OCA-git-bot Sep 3, 2023
74d98c8
[OU-FIX] don't fail when there's an unknown field in a view
hbrunn Dec 22, 2023
4fc77e6
[IMP] openupgrade_framework: pre-commit auto fixes and enable
royle-vietnam May 14, 2024
02a6ab7
[FIX] odoo_patch: don't raise or log exceptions in view validation
royle-vietnam May 14, 2024
e7ac198
[MIG] openupgrade_framework v17
daiduongnguyen-odoo May 22, 2024
1ff6d34
[UPD] README.rst
OCA-git-bot May 23, 2024
e057cf3
[IMP] openupgrade_framework: pre-commit stuff
chienandalu Jul 5, 2024
0e10f66
[UPD] README.rst
OCA-git-bot Jul 8, 2024
928a287
[OU-ADD] enable tests, add decorator to make them convenient to use
hbrunn Nov 18, 2024
ae5412f
[MIG] openupgrade_framework: Migration to 18.0
hbrunn Jan 13, 2025
4cf0174
[OU-ADD] exclude analytic 1.2 migration
hbrunn Mar 3, 2025
3c835b6
[BOT] post-merge updates
OCA-git-bot Mar 21, 2025
801ffde
[IMP] openupgrade_framework: install newly available auto_install addons
hbrunn Jun 30, 2025
53a0fcc
[FIX] openupgrade_framework: manipulate versions to actually run scripts
hbrunn Jun 30, 2025
984f9e5
[FIX] openupgrade_framework: force running pre scripts on installation
hbrunn Jun 30, 2025
cbd9cb3
[BOT] post-merge updates
OCA-git-bot Jun 30, 2025
fac8cb1
Revert "[FIX] openupgrade_framework: manipulate versions to actually …
pedrobaeza Jul 4, 2025
365744d
[FIX] openupgrade_framework: fix return value for update_list method …
kafai-lam Jul 11, 2025
9791ef8
[BOT] post-merge updates
OCA-git-bot Jul 12, 2025
0424110
[FIX] openupgrade_framework: _process_ondelete skip fields without at…
zurbaran Aug 2, 2025
e892a0c
[FIX] openupgrade_framework: Add decorator for method update_list()
quoc-pn Aug 23, 2025
193534f
[BOT] post-merge updates
OCA-git-bot Aug 23, 2025
dfe9b56
[MIG] openupgrade_framework to v19
hbrunn Sep 26, 2025
15b8106
[IMP] add tests for openupgrade_framework
hbrunn Oct 3, 2025
1117355
[FIX] don't set install_filename when loading views from openupgrade_…
hbrunn Nov 7, 2025
5fb3144
[FIX]openupgrade_framework: Fix Nonetype Error when install_filenmae …
javierjcf Nov 10, 2025
d713b1a
[FIX] openupgrade_framework: set upgrade_path only if it exists
hbrunn Dec 24, 2025
2d9195f
[UPD] README.rst
OCA-git-bot Dec 25, 2025
e662bd1
[IMP] openupgrade_framework: minor things
MiquelRForgeFlow Jan 21, 2026
10f253d
[MIG] openupgrade_framework to v20
hbrunn Sep 29, 2026
032dd7c
[IMP] openupgrade_framework: log module a column/table would be dropp…
hbrunn Oct 6, 2026
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
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
custom: ["https://www.odoo-community.org/crowdfunding/oca-open-upgrade-v20-8", "https://dir.floss.fund/view/funding/@odoo-community.org"]
17 changes: 17 additions & 0 deletions .github/actions/check-pr-dependency/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Check PR dependencies'
description: 'List PR dependencies in comment, set labels Dependency OK, Blocked by dependency'
inputs:
version:
description: 'OpenUpgrade version'
required: true
branding:
icon: 'git-merge'
color: 'yellow'
runs:
using: "composite"
steps:
- name: 'Run check'
run: |
pip install -r ${{ github.action_path }}/requirements.txt
python ${{ github.action_path }}/check_dependency.py --version ${{ inputs.version }} --repo ${{ github.repository }} --github-login ${{ github.actor }}
shell: sh
162 changes: 162 additions & 0 deletions .github/actions/check-pr-dependency/check_dependency.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
import argparse
import os
import re
from pathlib import Path

from github import Auth, Github
from github.PullRequestReview import PullRequestReview

import tools

parser = argparse.ArgumentParser()
parser.add_argument('--version', nargs='+')
parser.add_argument('--repo', default='OCA/OpenUpgrade')
parser.add_argument('--github-login', default='ocabot')
args = parser.parse_args()

auth = None
if os.environ.get('GITHUB_TOKEN'):
auth = Auth.Token(os.environ.get('GITHUB_TOKEN'))

g = Github(auth=auth)
repo = g.get_repo(args.repo)

# #######################
# Custom Function
# #######################
def module_ok(module_name):
return module_coverage[module_name] in ["nothing_to_do", "done"] or opened_prs.get(module_name) == pr_number

def _extract_migration_comment(migration_message):
if not migration_message:
return "", "", ""
text_reg = (
r"(?P<before>(\r|\n|.)*)"
r"<dependency>"
"(?P<current_text>(\n|.)*)"
r"<\/dependency>"
r"(?P<after>(\r|\n|.)*)"
)
res = re.match(text_reg, migration_message.body)
if not res:
return "", "", ""
groups = res.groupdict()
return groups["before"], groups["current_text"], groups["after"]


def _get_comment_or_review(pr, content):
comments = [x for x in pr.get_issue_comments() if content in x.body]
if comments:
return comments[0]
reviews = [x for x in pr.get_reviews() if content in x.body]
return reviews and reviews[0] or False


# ####################################
# Main Script
# ####################################

for current_version in map(float, args.version):
tools._logger.info(f"*************************************************")
tools._logger.info(f"Update Dependencies for Version {current_version}")
tools._logger.info(f"*************************************************")

# Get Opened PRs
done_prs, opened_prs = tools._get_prs(repo, current_version)

# Get Done modules
module_coverage = tools._get_module_coverage(repo, current_version)


for module_name, pr_number in opened_prs.items():
tools._logger.info(f"Handle PR #{pr_number} for module '{module_name}'")
manifest = tools._get_manifest_module(repo, current_version, module_name)
if not manifest:
tools._logger.info(f"the module {module_name} disappeared in the new version.")
continue

depends = manifest.get("depends")
pr = repo.get_pull(pr_number)

migration_message = _get_comment_or_review(pr, "ocabot migration")
current_labels = [x.name for x in pr.labels]
new_labels = current_labels.copy()

log_message = f"PR #{pr_number} for {module_name}:"
if all([module_ok(x) for x in depends]):
# all dependencies are OK, mark the PR as OK.
label_to_remove = "Blocked by dependency"
label_to_add = "Dependency OK"
else:
# mark the PR as blocked
label_to_remove = "Dependency OK"
label_to_add = "Blocked by dependency"

if label_to_remove in new_labels:
log_message += f" Remove '{label_to_remove}'"
new_labels.remove(label_to_remove)

if label_to_add not in new_labels:
log_message += f" Set '{label_to_add}'"
new_labels.append(label_to_add)

if new_labels != current_labels:
tools._logger.info(log_message)
pr.set_labels(*new_labels)

if not migration_message:
tools._logger.warning(f"Migration message not found in {pr.number}")
continue

before_text, current_text, after_text = _extract_migration_comment(
migration_message
)

dep_modules_ok = [x for x in depends if x in done_prs]
dep_modules_pending = [x for x in depends if x in opened_prs]
dep_modules_ko = [
x for x in depends if x not in dep_modules_ok + dep_modules_pending
]
new_text = ""
for dep_module in dep_modules_ok:
new_text += f"\n- {dep_module} : #{done_prs[dep_module]}"
for dep_module in dep_modules_pending:
new_text += f"\n- {dep_module} : #{opened_prs[dep_module]}"
for dep_module in dep_modules_ko:
new_text += f"\n- {dep_module} : TODO"
if module_ok(dep_module):
tools._logger.error(f"{dep_module} not found in the issue 'Migration to version {current_version}'")


if new_text:
new_text = "Depends on : \n" + new_text

new_body = ""
if not current_text and new_text:
tools._logger.info(
f"PR#{pr.number} - {pr.title}: ADDING Text in migration message."
)
if migration_message.user.login != args.github_login:
tools._logger.warning(
f"The message has been written by @{migration_message.user.login}"
)
new_body = (
migration_message.body + "\n\n<dependency>" + new_text + "</dependency>"
)
elif new_text != current_text:
tools._logger.info(
f"PR#{pr.number} - {pr.title}: Replacing text in migration message."
)
if migration_message.user.login != args.github_login:
tools._logger.warning(
f"The message has been written by @{migration_message.user.login}"
)
new_body = (
before_text + "<dependency>" + new_text + "</dependency>" + after_text
)

if new_body:
if type(migration_message) is PullRequestReview:
tools._logger.warning("Unable to edit the PR due to PyGithub limitation.")
continue
migration_message.edit(new_body)
1 change: 1 addition & 0 deletions .github/actions/check-pr-dependency/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PyGithub
90 changes: 90 additions & 0 deletions .github/actions/check-pr-dependency/tools.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import logging
import re
import sys
import urllib

logging.basicConfig(
level=logging.INFO,
format="[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s - %(message)s",
handlers=[logging.StreamHandler(stream=sys.stdout)],
)

_logger = logging.getLogger()


def _get_prs(repo, version):
opened_prs = {}
done_prs = {}

line_reg = (
r"- \[(?P<done> |x)\] (\(del\) )?(\(new\) )?"
r"(?P<module_name>\w+).*(pull\/|#)(?P<pr_number>\d+)"
)
issue_title = f"Migration to version {version:.1f}"

_logger.info(f"Get PRs referenced in '{issue_title}' ...")
# Get main issue to have PRs numbers
for issue in repo.get_issues():
if issue.title == issue_title:
for line in issue.body.split("\n"):
if not line.startswith("- ["):
continue
res = re.match(line_reg, line)
if not res:
_logger.debug(f"Unable to parse correctly '{line}'")
continue
groups = res.groupdict()
pr_number = int(groups["pr_number"])
if groups["done"] == "x":
done_prs[groups["module_name"]] = pr_number
else:
opened_prs[groups["module_name"]] = pr_number
_logger.info(
f">> found {len(done_prs)} done PRs" f" and {len(opened_prs)} Opened PRs"
)
return done_prs, opened_prs


def _get_module_coverage(repo, version):
file_name = f"modules{(version - 1) * 10:.0f}-{(version) * 10:.0f}.rst"
url = (
f"https://raw.githubusercontent.com/OCA/OpenUpgrade"
f"/{version:.1f}/docsource/"
f"{file_name}"
)
module_coverage = {}
_logger.info(f"Get and parse {file_name} to know coverage state ...")
page = urllib.request.urlopen(url).read().decode()
for line in page.split("\n"):
line = line.replace("|del|", "").replace("|new|", "")
if not line.startswith("|"):
continue
res = line.split("|")
module_name = res[1].strip()
status = res[2].strip()
if module_name == "Module":
continue
if status == "":
module_coverage[module_name] = "to_do"
elif status == "Nothing to do":
module_coverage[module_name] = "nothing_to_do"
elif status.startswith("Done"):
module_coverage[module_name] = "done"
else:
continue
# TODO:fix me
raise Exception("Status '%s' has not been analyzed." % (status))
_logger.info(f">> found {len(module_coverage)} modules.")
return module_coverage


def _get_manifest_module(repo, version, module_name):
url = (
f"https://raw.githubusercontent.com/odoo/"
f"odoo/{version:.1f}/addons/{module_name}/__manifest__.py"
)
try:
page = urllib.request.urlopen(url).read().decode()
except urllib.error.HTTPError:
return
return eval(page)
19 changes: 19 additions & 0 deletions .github/workflows/check_pr_dependency.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Check PR dependencies

on:
issues:
types: [edited]

jobs:
check_dependency:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
if: ${{ github.event.issue.state == 'open' && startsWith( github.event.issue.title, 'Migration to version ' ) }}
- name: Check dependency
if: ${{ github.event.issue.state == 'open' && startsWith( github.event.issue.title, 'Migration to version ' ) }}
uses: ./.github/actions/check-pr-dependency
with:
version: ${{ github.event.issue.milestone.title }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69 changes: 69 additions & 0 deletions .github/workflows/documentation-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# On each push in 20.0 branch,
# AND if the coverage file changed,
# build documentation branch and commit the changes
# so that the changes are visible on the website
# https://oca.github.io/OpenUpgrade/

name: Build and commit documentation

on:
push:
paths: ["docsource/modules190-200.rst"]

jobs:
documentation-commit:
runs-on: ubuntu-latest
steps:
- name: Check out OpenUpgrade Documentation
uses: actions/checkout@v2
with:
ref: "documentation"

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check out Odoo
uses: actions/checkout@v2
with:
repository: odoo/odoo
ref: "20.0"
fetch-depth: 1
path: odoo
- name: Configuration
run: |
sudo apt update
sudo apt install \
expect \
expect-dev \
libevent-dev \
libldap2-dev \
libsasl2-dev \
libxml2-dev \
libxslt1-dev \
nodejs \
python3-lxml \
python3-passlib \
python3-psycopg2 \
python3-serial \
python3-simplejson \
python3-werkzeug \
python3-yaml \
unixodbc-dev
- name: Requirements Installation
run: |
export PIP_CONSTRAINT=pip-constraint.txt
echo 'setuptools < 82.0.0' > pip-constraint.txt
sed -i -E "s/(gevent==)21\.8\.0( ; sys_platform != 'win32' and python_version == '3.10')/\122.10.2\2/;s/(greenlet==)1.1.2( ; sys_platform != 'win32' and python_version == '3.10')/\12.0.2\2/" odoo/requirements.txt
pip install -q -r odoo/requirements.txt
pip install -r ./requirements.txt
- name: OpenUpgrade Docs
run: |
# try to build the documentation
sh ./build_openupgrade_docs
- name: Commit changes
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 #v9
with:
add: "docs"
default_author: github_actions
message: "[UPD] HTML documentation"
Loading
Loading