Commit graph

218 commits

Author SHA1 Message Date
David Arnold
6b2bb9a2ab
fix: add env overrides for service orchestration (#21577)
This avoids having to manipulate config files in brittle bash
entrypoints that need to react to dynamic service discovery.

This significantly improves the operability of various bench sites.
2023-07-14 11:39:01 +05:30
Ankush Menat
ae8ee5064c refactor!: Remove error snapshot 2023-06-28 10:59:51 +05:30
Rucha Mahabal
ba8f97e789 feat: before/after hooks for any app install/uninstall 2023-06-22 16:07:06 +05:30
Gavin D'souza
d357af1533 refactor: Add a maxsplit limit to string splits 2023-01-24 19:22:51 +05:30
Richard Case
e80c8ac862
fix: improved installed app fail feedback (#19668) 2023-01-20 13:02:09 +05:30
Ankush Menat
442ba5dbf2
fix: set-config -g (#19217)
This isn't working because it uses update_site_config command which
attemts to find site_dir to create a lock which doesn't work when site
isn't init-ed.
2022-12-09 11:10:09 +05:30
Ankush Menat
49437f53b4
feat: operation level locking for CLI commands (#19162)
This prevents mistakenly issuing same commands twice which can be
dangerous.

added global lock(s):
- [x] bench build

added site level lock(s):
- [x] bench new-site sitename
- [x] bench --site sitename migrate
- [x] bench install-app appname
- [x] bench build
- [x] bench restore (the code is just meh, needs some cleanup)

closes https://github.com/frappe/frappe/issues/13215
2022-12-08 13:24:43 +05:30
Ankush Menat
d389fffbb7
feat: inter-process file locks (#19133) 2022-12-06 16:31:51 +05:30
Ankush Menat
70633573c2
fix: dont convert row format if not required (#18900) 2022-11-16 20:48:50 +05:30
Ankush Menat
ad7c0816f8
fix: prevent deleting standard doctypes in prod (#18803) 2022-11-08 21:27:41 +05:30
phot0n
51ac3e8a99 fix: sync app dashboard on app install
* chore: fix sync_dashboards' docstring
2022-09-12 00:01:21 +05:30
Nabin Hait
395caebd5a fix: init only existing single doctypes 2022-08-11 17:10:55 +05:30
Gavin D'souza
71b5c77e6e Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-07-05 14:55:02 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
Gavin D'souza
cf699fe40b Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-06-29 13:49:18 +05:30
Ankush Menat
d35d7ffbe2 fix: remove bare exception catching
A bare except catches lots of things (like generator iteration end) and should never be used.
2022-06-28 18:05:00 +05:30
Gavin D'souza
b4578dc632 Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-06-15 16:40:29 +05:30
Ankush Menat
82cc98366d fix: dont attempt to init singles that dont exist
This is done during app install stage and causes unnecessary failures
where stale doctypes are left in db.
2022-05-29 13:46:48 +05:30
gavin
73c3db12ee refactor(minor): Move internal util to the module where it's used 2022-05-24 19:19:53 +05:30
phot0n
ef99b57a08 chore: use secho instead of raising exception if app is already installed
* chore: singular click import
2022-05-11 16:18:14 +05:30
phot0n
fc6093515d chore: add comments and add force flag to more places 2022-05-11 16:18:14 +05:30
chillaranand
d2b63d0935 feat: Added force flag to install-app command 2022-05-11 16:18:14 +05:30
Ankush Menat
dad19e2c3f fix: required_apps blocks app install 2022-04-13 13:51:51 +05:30
Ankush Menat
8269e8dd47 fix: ignore duplicate modules during install 2022-04-13 13:03:09 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
ChillarAnand
7c46736654 fix: Use app name for parsing app name 2022-04-06 12:26:26 +05:30
ChillarAnand
112593fb5f fix: Use github.com when github api rate is crossed 2022-04-01 12:05:04 +05:30
saxenabhishek
f8c4098585 docs: docstings and refs 2022-03-22 14:17:01 +05:30
saxenabhishek
c53e6d822d feat: parse app name from tags and urls 2022-03-22 14:16:59 +05:30
Gavin D'souza
14a4e35d8d fix: Typo in is_downgrade's user warning
Fixes https://github.com/frappe/frappe/issues/16312
2022-03-17 09:51:00 +05:30
Revant Nandgaonkar
cdc6bcadb1
fix(cli): Database agnostic options for root db credentials (#15973)
* fix(bench): new-site params for root db credentials

allow root credentials for postgresql
use common cli option name for both database types

* fix(bench): backward compatible db params

Co-authored-by: gavin <gavin18d@gmail.com>

* fix(bench): use common db cred params

use --db-root-username and --db-root-password

* feat(bench): add --set-default to bench new-site

* fix: do not set default root user

* fix: indentation

Co-authored-by: gavin <gavin18d@gmail.com>
2022-02-25 09:58:59 +05:30
barredterra
745297a49d refactor: a not in b
Search: if not ([\w\d]*?) in ([\w\d]*?)
Replace: if $1 not in $2
2022-02-21 19:54:34 +01:00
ChillarAnand
0a1cd9e623 fix: Removed verbose flag for gzip 2022-02-17 15:43:07 +05:30
Ankush Menat
fd227d38f4
feat: post model-sync patches (#15351)
Ability to run a few patches after the doctype model schema is synced.

Read module-level docstring of patch_handler.py for more info.
2022-01-26 11:21:30 +05:30
barredterra
dac9349aef refactor: use is bool instead of == bool 2022-01-17 15:40:33 +01:00
phot0n
1d879f741b feat: before_uninstall and after_uninstall hooks 2021-12-20 14:05:10 +05:30
Raffael Meyer
c5df17e356
fix: cannot uninstall app with virtual doctype (#15136)
* Update installer.py

* fix: Drop table only if it exists

* revert: "Update installer.py"

This reverts commit 0e8370ede8a9c2b1c0687e5c216ecf67566da0f5.

Co-authored-by: Suraj Shetty <surajshetty3416@gmail.com>
2021-12-03 14:34:41 +00:00
Gavin D'souza
2e28ee5b25 fix: Update Installed Applications on remove_app
Removing an app from a site should sync the Installed Applications
doctype
2021-11-15 12:10:50 +05:30
Gavin D'souza
30c39acabe fix: Don't unlink file blindly
This made sense with the missing_ok. But now, a try-except seems
unnecessary too. Also, possibly destructive. Best to stray away from
these things.
2021-10-18 12:07:42 +05:30
Gavin D'souza
f51b1cc739 fix: Remove unnecessary missing_ok kwarg from unlink
missing_ok added in PY38, this change breaks installs for PY37. ref: https://docs.python.org/3/library/pathlib.html#pathlib.Path.unlink
2021-10-18 11:51:33 +05:30
Ankush Menat
a6bfbe4f1a
Merge pull request #14427 from ankush/app_uninstall_failure
fix: app uninstallation failure if module def link field isn't called "module"
2021-10-13 16:38:18 +05:30
Ankush Menat
70fcac8acf
refactor: change _delete_modules for testability 2021-10-12 17:10:14 +05:30
Ankush Menat
aa372b0990
fix: change order of deletion
Previous order was:
1. Delete DocTypes
2. Delete linked records
3. Drop tables

Now if linked records belonged to deleted doctypes it causes
uninstallation failure.

Changed order to:

1. Delete linked records
2. Delete DocTypes
3. Drop tables
2021-10-12 16:52:18 +05:30
Ankush Menat
412aa9f5cc
fix: fieldname for linkfield hardcoded to "module"
Remove_app assumed that all link fileds linking to "Module Def" are
called "module", this causes uninstall failure and leaves bench in
pseudo-irrecoverable state. (requiring some manual cleanup)
2021-10-12 16:52:18 +05:30
Ankush Menat
ae88fca3ef
refactor: split remove_app in smaller functions 2021-10-12 16:52:17 +05:30
abhishek
69d8eddf5a refactor: remove unused args
refactor: remove unused args
2021-10-11 17:23:17 +05:30
Gavin D'souza
e245c8da09 fix: Don't load entire db file into memory
Cleaning up my own mess :')
Read and write entire SQL file line by line
2021-10-08 18:15:12 +05:30
Pruthvi Patel
f2cf8981b5 fix: get abs path 2021-10-04 17:59:34 +05:30
Sagar Vora
cbbfdf33de fix: use site path instead of site name to generate DB name 2021-10-04 17:49:21 +05:30
Gavin D'souza
f1d2886328 Merge branch 'develop' of github.com:frappe/frappe into mariadb-10_6 2021-09-14 22:10:24 +05:30