Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ak status - initial commit - proto OK #95

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

ak status - initial commit - proto OK #95

wants to merge 1 commit into from

Conversation

rvalyi
Copy link
Member

@rvalyi rvalyi commented Aug 23, 2023

This is a prototype for ak status: the idea is to get an upgrade status.

Rationale: we often freeze projects to avoid breaking everything and we tend not to upgrade any repo anymore: the more we wait: the more any upgrade is deadly with plenty of changes with unknown danger. This is an explosive situation and this is bad because:

  1. the customer doesn't have the latest features
  2. we also don't help debugging the latest feature/give feedback to the OCA
  3. we only eat it all at once with so many issues that it will be too much work to fix issues quickly enough once all issues are discovered in production... -> angry customer.

This ak status command will show for each installed module if the list of MAJOR and minor upgrade between the current version and the upstream version. It also shows the PRs of these MAJOR or minor changes for further details.
Important: you should first do ak build to converge your work tree to the frozen version.

To upgrade the frozen.yaml file we could typically post this ak status log in the PR and ensure developers in charge of all parts review the MAJOR changes at the very least. We can assume "patch" level changes issues would be easy to fix in production if they produce any regression. Minor changes might deserve some attention too.
The goal is not to replace unit and integration tests, it's just to make things safer, specially if the test coverage is not ideal yet...

The code quality is not very good today an tests are missing. But it kind of work already.

Example on the DualSun project after 6 months without upgrade:

(env) rvalyi@rvalyi-laptop:~/DEV/dualsun/odoo$ ak status

in account-financial-reporing:
  account_financial_report:
    14.0.3.2.0 -> 14.0.3.3.0 (minor) - gh pr view 955 - (43fe570131e715ad8dc814649f8521113acea963)
    14.0.3.3.0 -> 14.0.3.4.0 (minor) - gh pr view 949 - (09249e9ee26dd20288e43d81ed10d7b2a23e49ab)
    14.0.3.4.0 -> 14.0.3.5.0 (minor) - gh pr view 973 - (48766b3f0a9e3c6687ba9cd3f0c872aa700bbc01)
    14.0.3.5.0 -> 14.0.3.6.0 (minor) - gh pr view 992 - (cd308ed5f5d38422cc23f3db7af56744c16cbb42)
    14.0.3.6.0 -> 14.0.3.7.0 (minor) - gh pr view 994 - (c401142ef42ea94db103eeedd33af832b0ac50ec)
    14.0.3.7.0 -> 14.0.3.8.0 (minor) - gh pr view 1033 - (23c49870ad4569d913502aaee071181007966a85)
    14.0.3.8.0 -> 14.0.3.9.0 (minor) - gh pr view 1054 - (2bf53b3b4883ffc46e175992f74ceb04014005c9)
  partner_statement:
    14.0.1.2.1 -> 14.0.1.3.0 (minor) - gh pr view 967 - (de5c93669dadd4c0b54b84276bf3ad10c75e9cd3)
    14.0.1.3.0 -> 14.0.1.4.0 (minor) - gh pr view 988 - (16b189383e797fb5cd4060a6905d07d73fa71603)

in account-payment:
  account_due_list:
    14.0.1.1.0 -> 14.0.1.2.0 (minor) - gh pr view 605 - (6aa00254c5cfcd7543142377581578440b82516c)

in bank-payment:
  account_payment_order:
    14.0.1.11.0 -> 14.0.2.0.0 (MAJOR) - gh pr view 979 - (0e40c5fa6fb6e3d212afa7e56f515865b1a8ec6c)
  account_payment_partner:
    14.0.1.6.0 -> 14.0.1.7.0 (minor) - gh pr view 1020 - (ed963cd1067f8b0b663169ccbdc04f893dff0bf1)
  account_payment_sale:
    14.0.1.0.0 -> 14.0.1.1.0 (minor) - gh pr view 820 - (8c003c7c7c0f62e41a5cdcc5c3feec8b6b30ed1a)
  account_banking_pain_base:
    14.0.1.0.1 -> 14.0.2.0.0 (MAJOR) - undef - (undef)
    14.0.2.0.0 -> 14.0.2.1.0 (minor) - gh pr view 1025 - (e8219b023db97baa94ccdfc4a5d05f52aff94f72)
  account_banking_sepa_credit_transfer:
    14.0.1.2.0 -> 14.0.2.0.0 (MAJOR) - gh pr view 979 - (0e40c5fa6fb6e3d212afa7e56f515865b1a8ec6c)
  account_banking_sepa_direct_debit:
    14.0.1.3.3 -> 14.0.2.0.0 (MAJOR) - gh pr view 979 - (0e40c5fa6fb6e3d212afa7e56f515865b1a8ec6c)
  account_banking_mandate:
    14.0.1.2.0 -> 14.0.2.0.0 (MAJOR) - gh pr view 979 - (0e40c5fa6fb6e3d212afa7e56f515865b1a8ec6c)

in currency:
  currency_rate_update:
    14.0.1.2.0 -> 14.0.1.3.0 (minor) - gh pr view 163 - (538f9e599790fcfaa2dc31fe0a0916652e5a31a4)

in helpdesk:
  helpdesk_mgmt:
    14.0.2.5.0 -> 14.0.2.6.0 (minor) - gh pr view 328 - (4e04ac99a2ba506d279867e8602c0e5bcec82417)
    14.0.2.6.0 -> 14.0.2.7.0 (minor) - gh pr view 460 - (0ec820f16df5e0479c632e8140d7475cdab5bf7d)
    14.0.2.7.0 -> 14.0.2.8.0 (minor) - gh pr view 461 - (f5721103e96f0a5507d8f9a7f15236f349a74116)
    14.0.2.8.0 -> 14.0.2.9.0 (minor) - gh pr view 464 - (b915b5adf7e98d67efeb62f47827e68ae96c99a1)
    14.0.2.9.0 -> 14.0.2.10.0 (minor) - gh pr view 468 - (7d172fae6afbe79c3d8815694249f7f387d482b4)

in manufacture:
  mrp_subcontracting_purchase_link:
    14.0.1.0.1 -> 14.0.2.0.0 (MAJOR) - gh pr view 985 - (abdd749e35c2779a83241cd64155aae0a9dacc26)
    14.0.2.0.0 -> 14.0.2.1.0 (minor) - gh pr view 1000 - (cc7090ee69a2c9c9c9960f1b7d7f51d6918d603c)

in mis-builder:
  mis_builder:
    14.0.4.1.1 -> 14.0.4.2.0 (minor) - gh pr view 565 - (cac0b3bb8c01b87310f8f33437fab3d5d90acd03)

in pim:
  attribute_set:
    14.0.1.1.0 -> 14.0.1.2.0 (minor) - gh pr view 100 - (f85167bfffb019e02371a6658f53a8a49e94f6ec)
    14.0.1.2.0 -> 14.0.1.3.0 (minor) - gh pr view 122 - (b24fa26bfa93f67c890ae2f9f6e7785f23b26655)
  pim:
    14.0.1.0.2 -> 14.0.1.1.0 (minor) - gh pr view 137 - (77ec00081fec032adf08bc67e4dd90a2be178123)
  product_attribute_set:
    14.0.1.0.2 -> 14.0.1.1.0 (minor) - gh pr view 151 - (adcf6b680a49af4c7542088f04f08e11b113db47)

in purchase-workflow:
  product_form_purchase_link:
    14.0.2.1.1 -> 14.0.2.2.0 (minor) - gh pr view 1683 - (2dd717b0da7c515bbc578053e90dd65537c2f81b)

in queue:
  queue_job:
    14.0.3.1.0 -> 14.0.3.2.0 (minor) - gh pr view 537 - (fe77bd57da37200a2d585d47b065787fe769204d)
    14.0.3.2.0 -> 14.0.3.3.0 (minor) - gh pr view 408 - (d9542c9746117196816b2a246d56586769909296)

in reporting-engine:
  report_qweb_element_page_visibility:
    14.0.1.0.0 -> 14.0.1.1.0 (minor) - gh pr view 540 - (33c3aab3d136f28274ed4b5ec77900a090835f02)
  kpi_dashboard:
    14.0.1.1.0 -> 14.0.1.2.1 (minor) - gh pr view 639 - (aa0b32411546acd600d9880117ead37294fedf46)

in rest-framework:
  base_rest:
    14.0.4.7.3 -> 14.0.4.8.0 (minor) - gh pr view 319 - (1eae73a2e6b32eeaf591af46d66ad3a322fc2618)

in server-brand:
  remove_odoo_enterprise:
    14.0.1.0.1 -> 14.0.2.0.0 (MAJOR) - gh pr view 69 - (240c1489c7bf3e5e0aa09ec69007e941bf3c3b5a)

in server-tools:
  auditlog:
    14.0.1.3.1 -> 14.0.2.0.0 (MAJOR) - gh pr view 2509 - (e620dcc8d57e8a5773e2a6f1aacbff8a64efeca3)

in stock-logistics-workflow:
  stock_picking_invoice_link:
    14.0.1.0.2 -> 14.0.1.1.0 (minor) - gh pr view 968 - (e1861dfd9d3a5990d7ad50cc998c9354a9bad782)
    14.0.1.1.0 -> 14.0.1.2.0 (minor) - gh pr view 1100 - (624464d0508a40b555ec3b5afab5a54568c8b806)
./external-src/support NOT  FOUND!

in web:
  web_widget_x2many_2d_matrix:
    14.0.1.0.1 -> 14.0.1.1.0 (minor) - gh pr view 1942 - (eb2290dc9f4fe7022eca24bc1b27a65c6c5582a6)

cc @hparfr @PierrickBrun @sebastienbeau @renatonlima @mbcosta @bealdav @clementmbr

@rvalyi rvalyi marked this pull request as draft August 23, 2023 06:29
Copy link
Member

@hparfr hparfr left a comment

Choose a reason for hiding this comment

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

Thanks for adressing this topic.

IMO, we can't trust version numbers from patched repo.
So only stable modules (from major oca branch and freezed) should be reported.

On small project, I want to try another approach: never freeze, keep a record of the frozen.yaml (make the build reproductible).
Be able to keep track a record of what changed between two build (or to frozen) is a real gain. It let us investigate before a deploy the changes or figure out what may have changed in case of regressions.

)

# TODO see if we cannot hide the stdout here:
local["git"]["fetch", remote, remote_main_branch] & FG
Copy link
Member

Choose a reason for hiding this comment

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

to hide from stdout; try:

Suggested change
local["git"]["fetch", remote, remote_main_branch] & FG
local["git"]["fetch", remote, remote_main_branch]()

Copy link
Member Author

Choose a reason for hiding this comment

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

the optimistic "no freeze" approach can also work for large projects before they are in production.

But note that changes such as the ones I warned about in the account_payment_order module 6 months ago would have easily broken any small project. So may be we could still freeze many projects and simply filter in ak status to report only major changes so the human check is faster.

As for detecting changes between "builds" we might also save the analysis from the click-odoo update command. But as it is md5 based it is much less informative.

As for patched modules: well eventually we could still report any modules version changed in the git log along with changes in the patch branches. it's not really about trusting a version number but t might still be a better than nothing to know some patched module got a major or minor upstream change, or even a patch level change then if we want to be more cautious.

Copy link
Member

Choose a reason for hiding this comment

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

Also, we can check with partner_modules in our instance if some of our other projects are already in a version. It can reduce the cost of each one of us looking all the pr.

if line.strip().startswith(f"{module} "):
new_version = line.split(" ")[-1]
new_version_major = new_version.split(".")[2]
version_major = upgrade_version.split(".")[2]
Copy link
Member

Choose a reason for hiding this comment

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

use python-semver to clean this code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants