Commit graph

574 commits

Author SHA1 Message Date
Akhil Narang
7f433b84af
feat: allow creating a backup with the older metadata style
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-26 11:09:08 +05:30
Akhil Narang
a06e402f38
refactor: use a function with context manager for backup decryption
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-26 11:09:08 +05:30
Akhil Narang
148efbc3ed
refactor(restore): adjust downgrade check
First actually check whether its a downgrade, then check for the force flag

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-26 11:09:08 +05:30
Akhil Narang
50d21677b8
chore: drop use of magic library, run file command directly
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-26 11:09:08 +05:30
Akhil Narang
2b7c74dd5e
feat(restore): handle encrypted backups better
Determine the mimetype based on the file contents instead of waiting for an exception
Cleaner + no need of duplicate code

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-26 11:09:08 +05:30
Akhil Narang
3b0f6de883
perf: don't extract backup files unless required
Read from the gzipped file wherever possible

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-26 11:08:48 +05:30
Ankush Menat
ca33deae12 fix: cast SQL booleans to python 2023-12-17 12:07:14 +05:30
Ankush Menat
40e48c9ac4
feat: describe-database-table to get stats about a table (#23813)
* feat: `describe-database-table` to get stats about a table

This provides description of table, indexes, total row count in machine
parseable format.

Towards https://github.com/frappe/press/issues/1265

* Update test_commands.py
2023-12-15 17:53:11 +05:30
Ankush Menat
b7c2989823
feat: add-database-index command to add and persist custom indexes (#23787) 2023-12-14 15:16:49 +00:00
barredterra
c35476256f refactor: simplify conditional logic
Command: `sourcery review --fix --enable de-morgan .`
2023-12-05 11:14:41 +01:00
Akhil Narang
d67a6d168e
fix(commands/scheduler): typo (#23441)
* fix(commands/scheduler): typo

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* chore: Update frappe/commands/scheduler.py

[skip ci]

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2023-11-27 11:30:33 +05:30
Akhil Narang
d21c7730da
fix(commands/site): the old logic did rely on 0 evaluting to false
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-11-23 16:34:28 +05:30
Akhil Narang
fbc88a4d24
refactor(treewide): code cleanup
Drop redundant bool conversion

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-11-23 13:57:51 +05:30
Akhil Narang
ae9ae40bad
Merge pull request #23168 from blaggacao/refactor/centralize-python-shell-interface-for-database-binaries
refactor: give cli invocations of dbtools a dedicated interface
2023-11-17 17:02:41 +05:30
David Arnold
890becda33
fix: typo 2023-11-09 19:22:17 +01:00
David Arnold
b2f9ff09aa
feat(db): boostrap only option if resource management is exogenous
The database resource management including privileges granting can be
done by external secops. It can be undesirable to grant the grant option
to the framework user.

This commit implements the possibility to remove user resource
management from frappe entirely and only boostrap the database with its
target user.
2023-11-09 17:11:39 +01:00
David Arnold
40a2daf84c
chore: give cli invocations of dbtools a dedicated interface 2023-11-09 12:14:41 +01:00
gavin
bedef22f34
fix(cli): Use mysql CLI as fallback is mariadb isnt found (#23004) 2023-10-30 19:48:04 +05:30
Akhil Narang
091ebdd8dc
refactor(treewide): use mariadb commands directly instead of mysql (#22620)
This has been done because the mysql command issues a deprecation warning now

mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-10-10 12:49:16 +05:30
barredterra
ed2290d1d6 Merge branch 'develop' into feat/improve-openid-connect-devx 2023-10-07 15:22:59 +02:00
Suraj Shetty
80347c9f28
Merge branch 'develop' into update-cy-new 2023-09-25 14:53:23 +05:30
Gavin D'souza
b19c569761
fix(run-ui-tests): Set default browser as chrome
Co-authored-by: Suraj Shetty <surajshetty3416@gmail.com>
2023-09-25 11:11:13 +05:30
Gavin D'souza
a5f709b468
ci: Use electron browser over chrome
* Electron is already shipped along with Cypress. Can we use it?
* Pass --record kwarg only if CYPRESS_RECORD_KEY envvar is set
2023-09-23 18:12:48 +05:30
Suraj Shetty
a496f6b5e1 build: Update cypress 2023-09-22 11:19:41 +05:30
Ankush Menat
56371f09e0 Revert "fix!: Bind development server only to localhost (#22397)"
This reverts commit 9244140816.

Breaks docker development installs
2023-09-20 11:43:56 +05:30
saif
8b83e051d0 refactor: Improve list_apps function readability and maintainability.
- Improve variable naming and reduce redundancy.
- Reorganize and simplify code structure.
2023-09-17 11:41:13 +03:00
David Arnold
64a09be958
Merge branch 'develop' into feat/improve-openid-connect-devx 2023-09-16 09:58:53 +02:00
Ankush Menat
9244140816
fix!: Bind development server only to localhost (#22397) 2023-09-13 17:26:19 +05:30
0xsaif
aa7ee1c6b9
refactor: force ipv4 localhost (#22394)
* reafctor: force ipv4 localhost

Replacing "localhost" with "127.0.0.1" in the codebase; sometimes the name localhost force-resolves to ipv6

* revert: leave localhost usage in oauth tests

Change not required.

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-09-13 16:23:23 +05:30
Ankush Menat
970a740164
revert: #22308 (#22389)
* Revert "chore: move function to correct file"

This reverts commit ebfdfa283b.

* Revert "refactor!: merge get_site_url into get_url (#22308)"

This reverts commit 2001bc278f.
2023-09-13 14:34:52 +05:30
Ankush Menat
64dd4b876b fix: UI test dont start without init 2023-09-13 12:33:49 +05:30
David Arnold
2001bc278f
refactor!: merge get_site_url into get_url (#22308)
* chore: merge get_site_url into get_url

* fix: keep alias with deprecation notice
2023-09-11 15:09:05 +05:30
David Arnold
87684e2647
feat: add werkzeug proxyfix to development server 2023-09-07 01:30:25 +02:00
Ankush Menat
b29272c092 fix: ipython console
https://github.com/ipython/ipython/issues/13966
2023-09-03 19:59:41 +05:30
gavin
ddc4e4813a
Merge pull request #22253 from gavindsouza/trim_database-fix
fix(trim-db): Dont show confirm dialog on dry run
2023-08-31 11:26:38 +05:30
Gavin D'souza
d4fe4c7e02 fix(trim-db): Dont show confirm dialog on dry run 2023-08-30 13:04:33 +00:00
Raffael Meyer
8f7a4f6697
Merge pull request #21873 from blaggacao/dont-exceed-python-module-boundary 2023-08-21 17:10:27 +02:00
Ankush Menat
fd740b780b fix: use vanilla eval 2023-08-21 12:09:45 +05:30
David Arnold
8dabd2bae6
refactor: make the app source accessor explicit
The parent folder of a python module (inside `./site-packages`) can be
`./lib`. Separate code paths that depend on the app source into its own
getter so that patching that function becomes easier in those cases
where the python module is not served from the source checkout.
2023-08-20 01:11:05 +02:00
barredterra
b553ed98d8 refactor: inline immediately returned variable
Inline a variable to a return in the case when the
variable being declared is immediately returned
2023-08-08 18:09:49 +02:00
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
441495b561
refactor!: Drop support for currentsite.txt (#21536)
* refactor!: Drop currentsite.txt

- `bench use` will continue to work.
- Instead of txt file use common_site_config to set default site using `default_site` key.
- `FRAPPE_SITE` environment variable also works

* fix(DX): warn if non-empty currentsite.txt is present
2023-06-30 17:57:40 +05:30
Ankush Menat
1092eef7bd perf: faster pending jobs check 2023-06-29 17:31:06 +05:30
Ankush Menat
73bca16d77 feat: RQ WorkerPool
RQ now has experimental support for workerpools.

When to use this?

Roughly when you have more than 2 workers a workerpool might make
sense, below 2 it's overhead as master "pool" process will need to run
to manager workerpool itself.

Why is it any better?

Currently we just let supervisor duplicate the worker process N number
of times. This is inefficient from shared memory POV. Forking the
original process to create workers enables sharing of more memory thus
leading upwards of 60-70% reduction in memory usage with pool size of 8
workers.
2023-06-26 18:10:00 +05:30
Suraj Shetty
fe25fe1db1 feat: A flag (--save-metafiles) to save esbuild metafiles
- Useful for analysing bundle size
2023-06-26 09:14:17 +05:30
Ankush Menat
8a37d6d278
perf: reduce memory usage of background processes (#21467)
* perf: defer translation.py imports

This indirectly imports babel which isn't really required most of the
time.

* perf: defer gzip import

* perf: move validate_and_sanitize_search_inputs

This causes all sorts of indirect imports and increases memory usage

* perf: defer requests module imports

* perf: defer system settings import

* perf: defer LOG_DOCTYPES import

Causes many indirect imports

* perf: defer update_site_config

* perf: defer notifications import

* perf: remove unused import

* perf: defer safe exec import

* test: memory usage overhead
2023-06-23 12:51:45 +05:30
Alfredo Altamirano
c6b1b026c5
fix: data-import command fails with local files (#20521) (#21381)
* fix: data is retrieved from db instead of local file

* fix: data import command only accepts absolute path

* fix: revert expanduser

- Shells expand it. Works fine with bash/zsh
- Doesn't work anyway as click wont let you init a path that doesn't
  exist

* Revert "fix: data is retrieved from db instead of local file"

This reverts commit cbe50a26da61e01b5a9a7c51f8632defb0913aab.

* fix: allow local import if from console

---------

Co-authored-by: Alfredo Altamirano <Ahuahuachi@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-06-20 18:09:23 +05:30
Anand Baburajan
38960f4219
feat: migrate translations command (#21362)
* feat: migrate translations command

* chore: formatting
2023-06-19 18:19:07 +05:30
Ankush Menat
63a1a32594 chore: remove unused argument 2023-06-13 19:03:52 +05:30
Ankush Menat
3005e66e45 refactor!: Drop previously deprecated code 2023-06-13 16:00:43 +05:30