Skip to content

[16.0] [IMP] fs_storage: Remove dependancy on server_environment#627

Merged
OCA-git-bot merged 13 commits into
OCA:16.0from
dixmit:16.0-split
Jun 8, 2026
Merged

[16.0] [IMP] fs_storage: Remove dependancy on server_environment#627
OCA-git-bot merged 13 commits into
OCA:16.0from
dixmit:16.0-split

Conversation

@etobella

@etobella etobella commented Jun 3, 2026

Copy link
Copy Markdown
Member

Server Environment should never be a dependancy on a base module.

So, I removed and added a glue module to handle the dependancy.

@lmignon @sebastienbeau as original authors of the module, I am sure that you have something to share.

@OCA-git-bot OCA-git-bot added mod:fs_storage Module fs_storage series:16.0 mod:fs_storage_environment Module fs_storage_environment labels Jun 3, 2026
@pedrobaeza pedrobaeza added this to the 16.0 milestone Jun 3, 2026

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think separating this is important for being able to use the suite of modules without using server_environment system, which in my opinion is also mixing deployment with business logic.

@OCA-git-bot OCA-git-bot added the mod:fs_attachment Module fs_attachment label Jun 3, 2026
@lmignon

lmignon commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@etobella This change is unfortunately far more complex.. A First PR already exists here with some comments describing the impacts of such a change.

@OCA-git-bot OCA-git-bot added mod:fs_attachment_s3 Module fs_attachment_s3 mod:fs_storage_backup Module fs_storage_backup mod:fs_storage_backup_environment Module fs_storage_backup_environment mod:fs_attachment_s3_environment Module fs_attachment_s3_environment mod:fs_attachment_environment Module fs_attachment_environment labels Jun 3, 2026
"name": "Filesystem Storage Backend",
"summary": "Implement the concept of Storage with amazon S3, sftp...",
"version": "16.0.1.5.0",
"version": "16.0.2.0.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you avoid to bump the version manually.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No, because I added a migration script

@lmignon lmignon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To be complete and support all the installation mode, we should also modify some files into the setup directory....
in setup/fs_storage/setup.py

import setuptools


setuptools.setup(
    setup_requires=['setuptools-odoo'],
    odoo_addon=True,
    # The dependencies are not strictly required for the module 
    # to be installed, but they are required to ensure
    # compatibility with the initial implemenation of the module
    # where the server_environment was a direct dependency of
    # the module even if not used by the user.
    install_requires=['odoo-addon-fs-storage-environment'],
)

@sbidoul Am I right?

The same should apply for all the addons where the split is done. (but the requirements must be adapted 😏 )

Thank you for your work.

Comment thread fs_storage/README.rst Outdated
cannot use tuples. The fix converts the list to a tuple when the config is
related to a webdav protocol and the auth option is into the confix. (`#285 <https://github.com/OCA/storage/issues/285>`_)


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To add an item into the history you must add a new file into the readme/newsfragments direcctory. For a features you just need to create a file named '627.feature.rst' (see https://towncrier.readthedocs.io/en/stable/tutorial.html#creating-news-fragments) with one paragraph. The history will be populated by the bot at merge time with the right version number and date.

@etobella

etobella commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

I don't get the install_requires, actually, it was done on the migration script, that will work in all scenarios, not only when using pypi for installation

@sbidoul

sbidoul commented Jun 4, 2026

Copy link
Copy Markdown
Member

The install_requires is important so a user doing an upgrade of odoo-addon-fs_storage with pip or uv will receive the new optional odoo-addon-fs_storage_environment dependency automatically in its addons path. The migration script will then make sure the new dependency is actually installed in the Odoo database.

@etobella

etobella commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

yes but that only makes sense when making the upgrade, not on other cases, for me it shouldn't be there...

@sbidoul

sbidoul commented Jun 4, 2026

Copy link
Copy Markdown
Member

yes but that only makes sense when making the upgrade, not on other cases, for me it shouldn't be there...

@etobella I don't understand. What upgrade? When doing a pip install of an addon, it makes sense that the glue modules are installed in the addons path together with it. That does not mean they will be installed in the database.

@etobella

etobella commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

@sbidoul We are making this change in order to avoid the need of such a module. Then, why do we add the dependency if it is not needed anymore? it does only have sense on the migration, if someone starts to use the module and install it with pip, we server_environemnt and fs_storage_environment are added to their code base. That makes no sense IMO

@lmignon

lmignon commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

@etobella We need to add this pip dependency to ensure that we will not break existing installation if these addons are upgraded in an environment managed by pip. For sure this specific pip requirement will be removed in version 20 since the dependency on server_environment will not be present from the start for these addons. This change will simply ensure that the new glue add-ons are included in the Python path if they are required by the migration scripts. However, for any new user of the addons who uses pip, apart from installing Python packages that are unnecessary for their installation, this will have no effect.

@lmignon

lmignon commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

@etobella dixmit#1 😏

@sbidoul

sbidoul commented Jun 5, 2026

Copy link
Copy Markdown
Member

I have pre-registered the 4 new fs_*_environment modules on PyPI.

@lmignon

lmignon commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

@etobella My last remaining concern is the modification of the fs_storafe\readme\history.rst file. Could you take into account my comment here: #627 (comment)? It would make the forward ports easier.

@simahawk simahawk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@etobella

etobella commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

@lmignon done

@ivantodorovich ivantodorovich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the work done!

It looks good to me. Just have one question about the migration scripts
Pre-approving, though

env.cr,
"""
UPDATE ir_module_module
SET state = 'to install'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is that really enough to get fs_attachment_environment installed during the fs_attachment upgrade?

I would've bet you need to call button_install or button_immediate_install on the ir.module.module instead.

@yankinmax, you worked on this too, do you remember what you had to do for the other modules?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Indeed migration did not run properly for me and erased the field values for the existing "fs.storage" records in the production environment.

Not sure if this was one of the reasons.

I was able to quickly to recover the config from a backup

@lmignon

lmignon commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-627-by-lmignon-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 595232d into OCA:16.0 Jun 8, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 7232131. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved merged 🎉 mod:fs_attachment_environment Module fs_attachment_environment mod:fs_attachment_s3_environment Module fs_attachment_s3_environment mod:fs_attachment_s3 Module fs_attachment_s3 mod:fs_attachment Module fs_attachment mod:fs_storage_backup_environment Module fs_storage_backup_environment mod:fs_storage_backup Module fs_storage_backup mod:fs_storage_environment Module fs_storage_environment mod:fs_storage Module fs_storage series:16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants