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

chore: release v15 #25536

Merged
merged 76 commits into from
Mar 19, 2024
Merged

chore: release v15 #25536

merged 76 commits into from
Mar 19, 2024

Conversation

frappe-pr-bot
Copy link
Collaborator

Automated weekly release.

ankush and others added 30 commits March 12, 2024 10:23
default ipython colours use yellow on white font, which looks horrible
and is practically unreadable on most colourschemes.

(cherry picked from commit 59f421c)
confuses query planner in some cases

(cherry picked from commit ae649aa)

# Conflicts:
#	frappe/desk/reportview.py
In InnoDB counting is essentially O(n) operation, it can be pretty fast
on indexes but when filters don't use any index it usually means doing a
full table scan.

Adding a limit will stop the scan as soon as that many records are
matched.

(cherry picked from commit a49fafb)

# Conflicts:
#	frappe/desk/reportview.py
Only difference is element

(cherry picked from commit 698ef95)
Resolves #25313

(cherry picked from commit 031d227)
…-25348

perf: cap max count on list views (backport #25348)
No one reads these, no need to indent them.

(cherry picked from commit 135fd33)
(cherry picked from commit 2d75dbb)

# Conflicts:
#	frappe/commands/utils.py
…-25370

perf: compact prepared report files (backport #25370)
…-25361

fix: dont show tooltip if not limited (backport #25361)
…-25366

fix: log mariadb console usage (backport #25366)
* fix: Log ipython commands

(cherry picked from commit 8bdc88f)

# Conflicts:
#	frappe/commands/utils.py

* fix: print frappe.log message

(cherry picked from commit 4ef0740)

# Conflicts:
#	frappe/__init__.py

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 54a2b08)

# Conflicts:
#	frappe/desk/doctype/console_log/console_log.py

Co-authored-by: Ankush Menat <ankush@frappe.io>
Some users have manged to write fetch expr with 2 dots 🤷

(cherry picked from commit 166d28a)
…-25378

fix: handle invalid fetch from split (backport #25378)
(cherry picked from commit ddaf1d2)

Co-authored-by: Ankush Menat <ankush@frappe.io>
…-25314

chore: specify typing models for ruff (backport #25314)
* Revert "fix: extract the frappe version from backup header directly"

This reverts commit 4d2cf23.

* fix(cli): Use mysql CLI as fallback is mariadb isnt found

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

* fix(cli): Use mysql CLI as fallback is mariadb isnt found

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

* fix(cli): Use mysql CLI as fallback is mariadb isnt found

[skip_ci]

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

* chore: give cli invocations of dbtools a dedicated interface

(cherry picked from commit 40a2daf)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* fix: shell escaping in execute_in_shell helper

(cherry picked from commit 5b33608)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* fix: code style

(cherry picked from commit 9228cd7)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* fix: minor fixes

Co-authored-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 283e91f)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* perf: don't extract backup files unless required

Read from the gzipped file wherever possible

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

* fix(Backup): automatically rollback decryption when object is being deleted

This allows us to not have to call it everytime before returning

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

* feat(installer): drop actual gzip file extraction

Use `zgrep` to check for table name match where required

Also use a table that's at the top of the dump files (`__Auth`)

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

* feat(db_manager): avoid extraction of DB dump if gzipped

Use `gzip -cd` to directly get the contents onto stdout and pipe to mariadb

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

* 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>

* chore: drop use of `magic` library, run `file` command directly

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

* fix(postgres/setup): use `gzip` to get backup contents if the file is an archive

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

* 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>

* fix: simplify version detection logic

Our version detection code is relatively simple, so we shouldn't have any exceptions arising there
Just check for a None return value to decide whether we should use the older logic

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

* refactor: use a function with context manager for backup decryption

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

* fix: handle older gzipped backups as well

Also fix the actual comparison

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

* feat: allow creating a backup with the older metadata style

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

* chore: add in some tests for backup

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

* chore(installer): fix output when prompting user about downgrade

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

* fix: use source before changing its contents

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

* fix(postgres): make use of common helper

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

* chore: don't pipe output through `pv`

No point if we're using `execute_in_shell()`

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

* fix: simplify parsing version for older backups

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

* refactor: set pipefail in shell before running piped backup/restore commands

Drop the complicated logic behind storing pid and killing process if first stage of pipe fails

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

* fix(execute_in_shell): run explicitly in bash

`pipefail` isn't supported in sh, bash is common enough to be installed nearly everywhere

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

* fix: add a check for `gpg` existing

Encrypted backup/restores just fail without a clear error message if gpg is missing

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 235be44)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* fix(decrypt): wrap the yield and cleanup code in try-finally

Without this, the cleanup code won't run after if `sys.exit()` is called when we yield

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

* fix: shell escaping on external commands

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

* fix: check correct part of backup header

`-- Backup generated by Frappe 15.1.0 on branch fix-backup-restore`

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit b992357)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* fix: wrong operator in version check

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

* refactor: better variable name

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

* refactor: `get_(old)_backup_version` methods

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

* docs: imporve docstrings

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

* fix: update downgrade warning

Seemed a bit confusing, #24898 (comment)

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

* refactor(treewide): run ruff

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

* fix(partial-restore): add in missing whitespace between sentences

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

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: Gavin D'souza <me@gavv.in>
Co-authored-by: David Arnold <david.arnold@iohk.io>
Co-authored-by: David Arnold <dgx.arnold@gmail.com>
Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 1896117)
…25397)

* feat: move bulk print operation to the background

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit bf6cb1a)

# Conflicts:
#	frappe/utils/print_format.py

* fix: open PDF in new tab

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 5d0db0c)

* fix: update message

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 9bf22b7)

* fix: add back a limitation to number of the documents

Don't allow printing more than 500 documents

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 1caae03)

* fix: let backend generate task ID

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 5a6bff9)

* fix: make filename more user-friendly

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 508e4d9)

* refactor(bulk_print): choose queue dynamically

Update docstrings and type hints a bit

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 5e37ac7)

* refactor: add in a new endpoint for background printing

Let the original one stay as-is for backward compatibility

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 0ec3e4a)

* fix: unsubscribe from task after completion

Also update event name to be more logical

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 6a5af14)

* refactor: make download button a primary action, update text

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 5f087ed)

* chore: fix conflicts

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

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
Resolves #25242

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 3f524be)
…-25399

fix(json_handler): handle `uuid.UUID` (backport #25399)
(cherry picked from commit e47f1d0)

Co-authored-by: Ankush Menat <ankush@frappe.io>
mergify bot and others added 19 commits March 15, 2024 10:01
(cherry picked from commit df2b9c0)

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 77618cd)

Co-authored-by: Revant Nandgaonkar <revant.one@gmail.com>
…5460)

* perf: avoid importing posthog if not required

Avoids 7MB of overhead and cleanup costs for each background job 🎉

(cherry picked from commit 3226717)

* perf: preload modules in worker pool

(cherry picked from commit 0d6ec13)

* perf: import sentinal locally

(cherry picked from commit b7a5884)

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
* fix: default filter setup on todo list

Since `frappe.route_options` is an empty object by default, the condition needs updated from `!frappe.route_options` to `!Object.keys(frappe.route_options).length`.

Also, `allocated_to` is a better default filter for the To Do list compared to the previous `owner` filter.

Further, this contained the only use of `page.add_sidebar_item()` in all of the current Frappe and ERPNext codebase, and that function neither makes sense or works anymore, so it should be removed.

* refactor: remove deprecated add_sidebar_item

* style: format files

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 396bc41)

Co-authored-by: Kevin Shenk <kevin@avu.nu>
* fix: log psql console usage as well

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit afdb455)

* refactor: move histfile setting into helper function

This will ensure even users of `bench db-console` can use it

(cherry picked from commit d0923b0)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>

---------

Co-authored-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 0cf58ca)

Co-authored-by: Corentin Flr <10946971+cogk@users.noreply.github.com>
(cherry picked from commit e30fdb6)

Co-authored-by: Corentin Flr <10946971+cogk@users.noreply.github.com>
(cherry picked from commit 71cfeb1)

Co-authored-by: Corentin Flr <10946971+cogk@users.noreply.github.com>
Looks like formatted by mistake :dead:

(cherry picked from commit 05f23dc)

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit b28db47)

Co-authored-by: Ankush Menat <ankush@frappe.io>
* fix: allow transitioning to long text

(cherry picked from commit 02fd017)

* ci: setup ssh if test failed

(cherry picked from commit 0ca0e22)

# Conflicts:
#	.github/workflows/server-tests.yml

* test: fixup timeouts

The tests were failing because they weren't able to complete in 20
seconds. Ugh!

(cherry picked from commit 48c24c7)

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit ce124d8)

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 2f87a09)

Co-authored-by: Ankush Menat <ankush@frappe.io>
…5495)

(cherry picked from commit ef6af0b)

Co-authored-by: Ankush Menat <ankush@frappe.io>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 6c767bf)
(cherry picked from commit 56f1ed4)

Co-authored-by: David Arnold <dgx.arnold@gmail.com>
…-25509

fix: skip setting of contact full name if its too long (backport #25509)
(cherry picked from commit d7f82bc)

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit fa6ec99)

Co-authored-by: Ankush Menat <ankush@frappe.io>
@frappe-pr-bot frappe-pr-bot requested review from a team and ankush and removed request for a team March 19, 2024 09:31
mergify bot and others added 4 commits March 19, 2024 17:39
Happens here on a local setup if I click `Compose Email` button

communication.js:212 Uncaught TypeError: Cannot read properties of undefined (reading 'doc')
    at frappe.views.CommunicationComposer.guess_language (communication.js:212:32)
    at frappe.views.CommunicationComposer.setup_print (communication.js:536:8)
    at frappe.views.CommunicationComposer.prepare (communication.js:239:8)
    at frappe.views.CommunicationComposer.make (communication.js:41:8)
    at new frappe.views.CommunicationComposer (communication.js:16:8)
    at Object.primary_action (communication__list_js:34:3)
    at HTMLButtonElement.<anonymous> (list_view.js:1426:19)
    at HTMLButtonElement.dispatch (jquery.js:5135:27)
    at elemData.handle (jquery.js:4939:28)

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 978e340)

Co-authored-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 674ca78)

Co-authored-by: Akhil Narang <me@akhilnarang.dev>
* fix: debug stuck process by sending SIGUSR1

It will print stack to stderr.

(cherry picked from commit 6560d45)

* fix: set sane default timeout on SMTP

(cherry picked from commit fdd74e3)

[skip ci]

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
`distinct count(fieldname)` is supported well but `count(distinct fieldname)` fails if fieldname contains full field with table name included. This PR just adds basic handling for it.

Needs to be rewritten entirely in QB __some day__.

(cherry picked from commit 8a7beeb)

# Conflicts:
#	frappe/model/db_query.py

Co-authored-by: Ankush Menat <ankush@frappe.io>
@ankush ankush merged commit 21482d8 into version-15 Mar 19, 2024
13 of 19 checks passed
@frappe-pr-bot
Copy link
Collaborator Author

🎉 This PR is included in version 15.18.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants