From 86f1b2fd90d969b61e15b24decda3f09d891e60c Mon Sep 17 00:00:00 2001 From: Pierre Verkest Date: Tue, 22 Jul 2025 13:56:23 +0200 Subject: [PATCH] Remove unrealease dependency step and fix CONTRIBUTING.md --- .github/workflows/test.yml | 17 ------------ CONTRIBUTE.md => CONTRIBUTING.md | 45 ++++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 31 deletions(-) rename CONTRIBUTE.md => CONTRIBUTING.md (64%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f74763a1..dcc8d925 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,23 +10,6 @@ on: - "14.0-ocabot-*" jobs: - unreleased-deps: - runs-on: ubuntu-latest - name: Detect unreleased dependencies - steps: - - uses: actions/checkout@v4 - - run: | - for reqfile in requirements.txt test-requirements.txt ; do - if [ -f ${reqfile} ] ; then - result=0 - # reject non-comment lines that contain a / (i.e. URLs, relative paths) - grep "^[^#].*/" ${reqfile} || result=$? - if [ $result -eq 0 ] ; then - echo "Ignore Unreleased dependencies found in ${reqfile}." - exit 0 - fi - fi - done test: runs-on: ubuntu-22.04 container: ${{ matrix.container }} diff --git a/CONTRIBUTE.md b/CONTRIBUTING.md similarity index 64% rename from CONTRIBUTE.md rename to CONTRIBUTING.md index 06031709..2b3fac69 100644 --- a/CONTRIBUTE.md +++ b/CONTRIBUTING.md @@ -26,20 +26,18 @@ Here we focus on what to do without explaining how to do it. ### Release -- Add a tag to any git commit (prefer a commit in the 14.0 branch even this is not - required which could helps if needs to quickly deliver a bug fix) and push it to the - repo (ie: - `git tag -am "New release 2025-05-24" v14.0-20250524 && git push oca v14.0-20250524`). +While we are building and publishing a docker image the current state is that the image +is build at deploy time on OCA server. -- This will will trigger other flow to create the docker image. Tag must matched - following pattern to trigner the CI `v14.0.*`. +While technicaly speaking there is nothing more than accessing to a public commit to +deploy a new version it's a common practice to merge your work on branch 14.0 before +deploying a new version in production. -- A new docker image should be available in the - [github docker registry](https://github.com/oca/oca-custom/pkgs/container/oca-custom) +> **Note**: in this repository we allow unreleased dependencies. ### deployment -Ask administrator to deploy the given version. +Ask administrator to deploy the given commit. ## HowTos @@ -73,30 +71,49 @@ For addons in other repositories, the procedure is as follows: - check out the repository somewhere, ie /src/\$repo - add the following line to `pyproject.toml` in the `[tool.uv.sources]` section: - odoo14-addon-$youraddon = { path = "/srv/$repo/setup/$youraddon", editable = true } + ```pyproject + odoo14-addon-$youraddon = { path = "/srv/$repo/setup/$youraddon", editable = true } + ``` - run `uv sync` - restart Odoo +### use unreleased dependency + +There is two different goals: + +- making the test CI pass: using regular test-requirements.txt files add a line such as + + ``` + odoo14-addon-membership-delegated-partner-line @ git+https://github.com/OCA/vertical-association@refs/pull/151/head#subdirectory=setup/membership_delegated_partner_line + ``` + +- bring the unreleased dependency in the uv project (and the built docker image), add + the following line to `pyproject.toml` in the `[tool.uv.sources]` section: + + ```pyproject + odoo14-addon-membership-delegated-partner-line = { git = "https://github.com/OCA/vertical-association", rev = "refs/pull/151/head", subdirectory = "setup/membership_delegated_partner_line" } + ``` + ### Setup database and launch tests - setup database with demo data and all oca modules installed ```bash -uv run odoo -d oca-custom -i oca_all --stop-after-init --without-de +uv run odoo -d oca-custom -i oca_all --stop-after-init --without-demo= ``` - run tests using pytest launcher -````bash +```bash uv run pytest --odoo-database oca-custom --cov ./oca_psc_team/ oca_psc_team/ -`` +``` ### Update OCB Branch ```bash uv sync -P odoo -```` +``` ### Update a specific OCA module dependency using the latest pypi release