Compare commits

...
9 Commits
Author SHA1 Message Date
Gina Häußge 45d3e7c864 🔖 Preparing hotfix release of 1.4.2 2020-08-06 12:41:11 +02:00
Gina Häußge 89412a761a 🐛 Work around for a watchdog Py2 bug
If the PollingObserver is used under Py2 on a directory that contains
utf8 file names, the default listdir implementation (scandir isn't
natively available under Py2) will generate unicode instead of str. Due
to an insufficent instance check in watchdog that will lead to a
misidentification of an entry as an DirEntry object instead of a str,
and the attempt to read the name property from that will cause an
AttributeError.

We monkey patch watchdog to use our bundled scandir backport where
needed instead of trying to fix the instance check, as that will perform
better anyhow.

Closes #3676
2020-08-06 12:19:41 +02:00
Gina Häußge b8b3cdde53 🥅 Better resilience against watchdog errors on startup
See #3676
2020-08-06 12:19:41 +02:00
Gina Häußge 8c829048af 🐛 pmgr: fix max upload size
Closes #3674
2020-08-06 12:19:41 +02:00
Gina Häußge 14a5f89b59 🐛 Fix download filename parsing
Closes #3678
2020-08-06 12:19:41 +02:00
Khoi 65d5d8963b remove any double quotes from filename obtained from content-disposition header, if any 2020-08-06 12:19:41 +02:00
Gina Häußge ea58e48dad 🔖 staging/hotfix is 1.4.2.dev, maintenance is 1.4.3.dev 2020-08-06 12:19:41 +02:00
Gina Häußge 0a605ccb12 👷‍️ Action based issue labeling 2020-08-05 16:24:12 +02:00
Gina Häußge 0364130dd3 ⬆️ Upgrade cypress 2020-08-04 14:14:47 +02:00
10 changed files with 120 additions and 55 deletions

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
name: "Issue Labeler"
on:
issues:
types: [opened, edited]
jobs:
apply-label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
let labels = [];
if (context.payload.issue.title.match(/\[request\]|feature request/i)) {
labels.push('type:request');
}
if (context.payload.issue.title.match(/\[brainstorming\]/i)) {
labels.push('type:brainstorming');
}
if (context.payload.issue.title.match(/\[rc feedback\]/i)) {
labels.push('type:rc feedback');
}
if (labels.length > 0) {
github.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: labels
})
}
+9 -6
View File
@@ -18,11 +18,14 @@ prerelease
HEAD HEAD
\(detached.* \(detached.*
# maintenance is currently the branch for preparation of maintenance release 1.4.1 # maintenance is currently the branch for preparation of maintenance release 1.4.3
# so are any fix/... and improve/... branches # so are any fix/... and improve/... branches
maintenance 1.4.1 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev maintenance 1.4.3 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
fix/.* 1.4.1 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev fix/.* 1.4.3 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
improve/.* 1.4.1 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev improve/.* 1.4.3 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
# staging/hotfix is the branch for preparation of the 1.4.2 hotfix release
staging/hotfix 1.4.2 3ab84ed7e4c3aaaf71fe0f184b465f25d689f929 pep440-dev
# staging/maintenance is currently the branch for preparation of 1.4.1rc5 # staging/maintenance is currently the branch for preparation of 1.4.1rc5
# so is regressionfix/... # so is regressionfix/...
@@ -32,5 +35,5 @@ regressionfix/.* 1.4.1rc5 458ab91f915307857941f839a1b743430b8786a4 pep440-dev
# staging/devel is currently inactive (but has the 1.4.1rc4 namespace) # staging/devel is currently inactive (but has the 1.4.1rc4 namespace)
staging/devel 1.4.1rc4 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev staging/devel 1.4.1rc4 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev
# every other branch is a development branch and thus gets resolved to 1.5.0-dev for now # every other branch is a development branch and thus gets resolved to 2.0.0.dev for now
.* 1.5.0 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev .* 2.0.0 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
+1 -5
View File
@@ -35,7 +35,6 @@ thanks to everyone who contributed!
* Kaile Riser * Kaile Riser
* Kale Stedman * Kale Stedman
* Kazuhiro Ogura * Kazuhiro Ogura
* Kelly C McNiece
* Kenneth Jiang * Kenneth Jiang
* Kurt Wubbels * Kurt Wubbels
* Kyle Menigoz * Kyle Menigoz
@@ -43,19 +42,16 @@ thanks to everyone who contributed!
* Lee Dohm * Lee Dohm
* Makespace Madrid * Makespace Madrid
* Mark Walker * Mark Walker
* Marvin Nahmias
* Michael Aumock * Michael Aumock
* Miles Flavel * Miles Flavel
* Mosaic Manufacturing * Mosaic Manufacturing
* Neil R. Goldberg * Neil R. Goldberg
* Patrick Glyré
* Patrick McGinnis * Patrick McGinnis
* Prof Yuh Wen Chen * Prof Yuh Wen Chen
* Raise3D * Raise3D
* Randy C. Will * Randy C. Will
* Ranjib Dey * Ranjib Dey
* Richard Michaud * Richard Michaud
* Rigid3D
* Robert Gusek * Robert Gusek
* Ronald Griehsler * Ronald Griehsler
* Sacha Telgenhof * Sacha Telgenhof
@@ -66,4 +62,4 @@ thanks to everyone who contributed!
* Sven Mueller * Sven Mueller
* Ulrich Kempken * Ulrich Kempken
and 1932 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [Github Sponsors](https://github.com/users/foosel/sponsorship)! and 1943 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [Github Sponsors](https://github.com/users/foosel/sponsorship)!
@@ -13,8 +13,8 @@ from octoprint.util.version import get_octoprint_version_string, is_released_oct
from flask import jsonify from flask import jsonify
from flask_babel import gettext from flask_babel import gettext
SENTRY_URL_SERVER = "https://9a2cb386ed8640e8a7fa0276f613be69@o118517.ingest.sentry.io/1373987" SENTRY_URL_SERVER = "https://d479a74f172d4ac2b959a9a7d0536a82@o118517.ingest.sentry.io/1373987"
SENTRY_URL_COREUI = "https://2350156be0954d299dd07a4cef2650b2@o118517.ingest.sentry.io/1374096" SENTRY_URL_COREUI = "https://040577fb88b241ff985e408c11775720@o118517.ingest.sentry.io/1374096"
SETTINGS_DEFAULTS = dict(enabled=False, SETTINGS_DEFAULTS = dict(enabled=False,
enabled_unreleased=False, enabled_unreleased=False,
@@ -157,7 +157,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
def increase_upload_bodysize(self, current_max_body_sizes, *args, **kwargs): def increase_upload_bodysize(self, current_max_body_sizes, *args, **kwargs):
# set a maximum body size of 50 MB for plugin archive uploads # set a maximum body size of 50 MB for plugin archive uploads
return [("POST", r"/upload_archive", 50 * 1024 * 1024)] return [("POST", r"/upload_file", 50 * 1024 * 1024)]
# Additional permissions hook # Additional permissions hook
+16 -11
View File
@@ -283,6 +283,7 @@ class Server(object):
util.tornado.fix_json_encode() util.tornado.fix_json_encode()
util.tornado.fix_websocket_check_origin() util.tornado.fix_websocket_check_origin()
util.flask.fix_flask_jsonify() util.flask.fix_flask_jsonify()
util.watchdog.fix_scandir()
self._setup_mimetypes() self._setup_mimetypes()
@@ -818,18 +819,22 @@ class Server(object):
self._logger.exception("Something went wrong while attempting to automatically connect to the printer") self._logger.exception("Something went wrong while attempting to automatically connect to the printer")
# start up watchdogs # start up watchdogs
watched = self._settings.getBaseFolder("watched") try:
watchdog_handler = util.watchdog.GcodeWatchdogHandler(fileManager, printer) watched = self._settings.getBaseFolder("watched")
watchdog_handler.initial_scan(watched) watchdog_handler = util.watchdog.GcodeWatchdogHandler(fileManager, printer)
watchdog_handler.initial_scan(watched)
if self._settings.getBoolean(["feature", "pollWatched"]): if self._settings.getBoolean(["feature", "pollWatched"]):
# use less performant polling observer if explicitly configured # use less performant polling observer if explicitly configured
observer = PollingObserver() observer = PollingObserver()
else: else:
# use os default # use os default
observer = Observer() observer = Observer()
observer.schedule(watchdog_handler, watched, recursive=True)
observer.start() observer.schedule(watchdog_handler, watched, recursive=True)
observer.start()
except Exception:
self._logger.exception("Error starting watched folder observer")
# run our startup plugins # run our startup plugins
octoprint.plugin.call_plugin(octoprint.plugin.StartupPlugin, octoprint.plugin.call_plugin(octoprint.plugin.StartupPlugin,
+24
View File
@@ -17,6 +17,30 @@ import octoprint.filemanager.util
import octoprint.util import octoprint.util
def fix_scandir():
try:
from os import scandir
# nothing to fix, natively available, return
return
except ImportError:
# not natively available, use backport
from scandir import scandir
import watchdog.utils.dirsnapshot
OriginalDirectorySnapshot = watchdog.utils.dirsnapshot.DirectorySnapshot
class FixedDirectorySnapshot(OriginalDirectorySnapshot):
def __init__(self, listdir=scandir, *args, **kwargs):
OriginalDirectorySnapshot.__init__(self, listdir=listdir, *args, **kwargs)
watchdog.utils.dirsnapshot.DirectorySnapshot = FixedDirectorySnapshot
import watchdog.observers.polling
OriginalPollingEmitter = watchdog.observers.polling.PollingEmitter
class FixedPollingEmitter(OriginalPollingEmitter):
def __init__(self, listdir=scandir, *args, **kwargs):
OriginalPollingEmitter.__init__(self, listdir=listdir, *args, **kwargs)
watchdog.observers.polling.PollingEmitter = FixedPollingEmitter
class GcodeWatchdogHandler(watchdog.events.PatternMatchingEventHandler): class GcodeWatchdogHandler(watchdog.events.PatternMatchingEventHandler):
""" """
+6 -2
View File
@@ -15,6 +15,7 @@ import re
import netifaces import netifaces
import requests import requests
import werkzeug.http
_cached_check_v6 = None _cached_check_v6 = None
def check_v6(): def check_v6():
@@ -201,9 +202,12 @@ def resolve_host(host):
def download_file(url, folder, max_length=None): def download_file(url, folder, max_length=None):
with requests.get(url, stream=True) as r: with requests.get(url, stream=True) as r:
r.raise_for_status() r.raise_for_status()
filename = None
if "Content-Disposition" in r.headers.keys(): if "Content-Disposition" in r.headers.keys():
filename = re.findall("filename=(.+)", r.headers["Content-Disposition"])[0] _, options = werkzeug.http.parse_options_header(r.headers["Content-Disposition"])
else: filename = options.get('filename')
if filename is None:
filename = url.split("/")[-1] filename = url.split("/")[-1]
assert len(filename) > 0 assert len(filename) > 0
+27 -27
View File
@@ -46,7 +46,7 @@
"extend": "3.0.2", "extend": "3.0.2",
"forever-agent": "0.6.1", "forever-agent": "0.6.1",
"form-data": "2.3.3", "form-data": "2.3.3",
"har-validator": "5.1.3", "har-validator": "5.1.5",
"http-signature": "1.2.0", "http-signature": "1.2.0",
"is-typedarray": "1.0.0", "is-typedarray": "1.0.0",
"isstream": "0.1.2", "isstream": "0.1.2",
@@ -104,9 +104,9 @@
"integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==" "integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg=="
}, },
"ajv": { "ajv": {
"version": "6.12.2", "version": "6.12.3",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz",
"integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==",
"requires": { "requires": {
"fast-deep-equal": "3.1.3", "fast-deep-equal": "3.1.3",
"fast-json-stable-stringify": "2.1.0", "fast-json-stable-stringify": "2.1.0",
@@ -380,9 +380,9 @@
} }
}, },
"cypress": { "cypress": {
"version": "4.9.0", "version": "4.12.0",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-4.9.0.tgz", "resolved": "https://registry.npmjs.org/cypress/-/cypress-4.12.0.tgz",
"integrity": "sha512-qGxT5E0j21FPryzhb0OBjCdhoR/n1jXtumpFFSBPYWsaZZhNaBvc3XlBUDEZKkkXPsqUFYiyhWdHN/zo0t5FcA==", "integrity": "sha512-ZDngKMwoQ2UYmeSUJikLMZG6t2N7lTHHlzBzh5W0MbPfXSMv36YUgL2ZVD+t4ZLA63WWkvhwxIkDG+WJknBgHw==",
"requires": { "requires": {
"@cypress/listr-verbose-renderer": "0.4.1", "@cypress/listr-verbose-renderer": "0.4.1",
"@cypress/request": "2.88.5", "@cypress/request": "2.88.5",
@@ -398,7 +398,7 @@
"commander": "4.1.1", "commander": "4.1.1",
"common-tags": "1.8.0", "common-tags": "1.8.0",
"debug": "4.1.1", "debug": "4.1.1",
"eventemitter2": "6.4.2", "eventemitter2": "6.4.3",
"execa": "1.0.0", "execa": "1.0.0",
"executable": "4.1.1", "executable": "4.1.1",
"extract-zip": "1.7.0", "extract-zip": "1.7.0",
@@ -408,10 +408,10 @@
"is-installed-globally": "0.3.2", "is-installed-globally": "0.3.2",
"lazy-ass": "1.6.0", "lazy-ass": "1.6.0",
"listr": "0.14.3", "listr": "0.14.3",
"lodash": "4.17.15", "lodash": "4.17.19",
"log-symbols": "3.0.0", "log-symbols": "3.0.0",
"minimist": "1.2.5", "minimist": "1.2.5",
"moment": "2.26.0", "moment": "2.27.0",
"ospath": "1.2.2", "ospath": "1.2.2",
"pretty-bytes": "5.3.0", "pretty-bytes": "5.3.0",
"ramda": "0.26.1", "ramda": "0.26.1",
@@ -578,9 +578,9 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
}, },
"eventemitter2": { "eventemitter2": {
"version": "6.4.2", "version": "6.4.3",
"resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.2.tgz", "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.3.tgz",
"integrity": "sha512-r/Pwupa5RIzxIHbEKCkNXqpEQIIT4uQDxmP4G/Lug/NokVUWj0joz/WzWl3OxRpC5kDrH/WdiUJoR+IrwvXJEw==" "integrity": "sha512-t0A2msp6BzOf+QAcI6z9XMktLj52OjGQg+8SJH6v5+3uxNpWYRR3wQmfA+6xtMU9kOC59qk9licus5dYcrYkMQ=="
}, },
"execa": { "execa": {
"version": "1.0.0", "version": "1.0.0",
@@ -758,11 +758,11 @@
"integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
}, },
"har-validator": { "har-validator": {
"version": "5.1.3", "version": "5.1.5",
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz",
"integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==",
"requires": { "requires": {
"ajv": "6.12.2", "ajv": "6.12.3",
"har-schema": "2.0.0" "har-schema": "2.0.0"
} }
}, },
@@ -935,7 +935,7 @@
"listr-update-renderer": "0.5.0", "listr-update-renderer": "0.5.0",
"listr-verbose-renderer": "0.5.0", "listr-verbose-renderer": "0.5.0",
"p-map": "2.1.0", "p-map": "2.1.0",
"rxjs": "6.6.0" "rxjs": "6.6.2"
} }
}, },
"listr-silent-renderer": { "listr-silent-renderer": {
@@ -1032,9 +1032,9 @@
} }
}, },
"lodash": { "lodash": {
"version": "4.17.15", "version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ=="
}, },
"lodash.once": { "lodash.once": {
"version": "4.1.1", "version": "4.1.1",
@@ -1136,9 +1136,9 @@
} }
}, },
"moment": { "moment": {
"version": "2.26.0", "version": "2.27.0",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.26.0.tgz", "resolved": "https://registry.npmjs.org/moment/-/moment-2.27.0.tgz",
"integrity": "sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw==" "integrity": "sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ=="
}, },
"ms": { "ms": {
"version": "2.1.2", "version": "2.1.2",
@@ -1317,9 +1317,9 @@
} }
}, },
"rxjs": { "rxjs": {
"version": "6.6.0", "version": "6.6.2",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.0.tgz", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz",
"integrity": "sha512-3HMA8z/Oz61DUHe+SdOiQyzIf4tOx5oQHmMir7IZEu6TMqCLHT4LRcmNaUS0NwOz8VLvmmBduMsoaUvMaIiqzg==", "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==",
"requires": { "requires": {
"tslib": "1.13.0" "tslib": "1.13.0"
} }
+1 -1
View File
@@ -17,7 +17,7 @@
}, },
"homepage": "https://octoprint.org", "homepage": "https://octoprint.org",
"dependencies": { "dependencies": {
"cypress": "^4.9.0", "cypress": "^4.12.0",
"cypress-commands": "^1.1.0", "cypress-commands": "^1.1.0",
"cypress-file-upload": "^4.0.7", "cypress-file-upload": "^4.0.7",
"cypress-plugin-retries": "^1.5.2", "cypress-plugin-retries": "^1.5.2",