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

Initialize a db with only the base module in case install fails #95

Merged
merged 3 commits into from
Nov 19, 2023

Conversation

sbidoul
Copy link
Owner

@sbidoul sbidoul commented Jun 27, 2023

closes #94

@codecov
Copy link

codecov bot commented Jun 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (aca17a0) 64.97% compared to head (8087b43) 64.97%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #95   +/-   ##
=======================================
  Coverage   64.97%   64.97%           
=======================================
  Files          19       19           
  Lines        1245     1245           
=======================================
  Hits          809      809           
  Misses        436      436           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@francesco-ooops
Copy link

@sbidoul what's the status of this? I'm trying to get broken runboat fixed for stock-logistics-workflow v14, ref: OCA/stock-logistics-workflow#1271 (comment)

@sbidoul
Copy link
Owner Author

sbidoul commented Nov 14, 2023

This is an untested idea so far. But the general idea should work, I think. I don't know when I'll have time to work on this.

In the meantime, people should not put modules that conflict at install time in the same repo. Sorry, there is no better solution for now.

@francesco-ooops
Copy link

@sbidoul I agree with you that they should not be merged, but that has happened

here OCA/stock-logistics-workflow#1271
and here (attempted) OCA/stock-logistics-workflow#1320

and then we're out of runboat due to a single module :/

@sbidoul
Copy link
Owner Author

sbidoul commented Nov 14, 2023

Yes I know. Reverts are a possibility. At some point we could also block merges on a red runboat.

unbuffer $(which odoo || which openerp-server) \
--data-dir=/mnt/data/odoo-data-dir \
--db-template=template1 \
-d ${PGDATABASE} \
-i ${ADDONS:-base} \
--stop-after-init
--stop-after-init || exit 0
Copy link
Owner Author

Choose a reason for hiding this comment

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

todo: dropdb if install failed ?

@@ -35,8 +35,6 @@ oca_wait_for_postgres
# --db_user is necessary for Odoo <= 10
unbuffer $(which odoo || which openerp-server) \
--data-dir=/mnt/data/odoo-data-dir \
--no-database-list \
Copy link
Owner Author

Choose a reason for hiding this comment

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

make sure users cannot create databases

@sbidoul sbidoul changed the title Initialize a db with only the base module Initialize a db with only the base module in case install fails Nov 19, 2023
So users cannot do anything harmful with the database manager,
which is now enabled so they can select the base or full
database
@sbidoul sbidoul marked this pull request as ready for review November 19, 2023 12:42
@sbidoul sbidoul merged commit 4dd762e into main Nov 19, 2023
4 checks passed
@sbidoul sbidoul deleted the baseonly-db branch November 19, 2023 12:43
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.

Create a second database with only base installed
2 participants