Compare commits

...
22 Commits
Author SHA1 Message Date
Gina Häußge d60c5a631a 🔖 Prepare release of 1.7.2 2021-11-02 17:31:00 +01:00
Gina Häußge 444fe44d48 🐛 Fix double encoding of file resources
`url_for` seems to be doing the encoding already after all,
so we must not do it as well.

Fixes #4293
2021-11-02 17:19:32 +01:00
Gina Häußge 7d5474cb3d 🔖 staging/bugfix is now 1.7.2.dev 2021-11-01 16:30:21 +01:00
Gina Häußge 945825f03f Merge branch 'master' of github.com:OctoPrint/OctoPrint into master 2021-11-01 15:47:03 +01:00
Gina Häußge 1bd19e3fd5 🔖 Prepare release of 1.7.1 2021-11-01 14:32:07 +01:00
Gina Häußge fd8a72a77a 🥅 Default to lowLatency=False for now
Apparently some printers/printer connections really don't like the
attempt to set the low latency flag, as in, it fails, handled gracefully,
but then the connection is broken regardless.

We'll disable it by default for now, and tackle this properly in 1.8.0.
2021-11-01 11:09:11 +01:00
Gina Häußge dfe7dc7a78 🐛 URL escape timelapse file names as well
It turns out those are also affected by #4267
2021-10-29 17:28:35 +02:00
Gina Häußge 16086741b8 🐛 Better fix for #4267
New helper OctoPrintClient.escapePath, does the equivalent
of x.split("/").map(e => escapeURIComponent(e)).join("/").

Used in the files API client.
2021-10-29 17:28:35 +02:00
Gina Häußge 3bbd3f7a3e 🐛 URL encode all uploaded file names
Otherwise a # in the URL might be treated as a fragment and lead to
resource mismatches.

Closes #4267
2021-10-29 11:20:56 +02:00
Quinn DamerellandGina Häußge 995c8aa0c6 🐛 PMGR: Fix bug in default sort of plugins from the repo (#4273)
Related to #4031

Co-authored-by: Gina Häußge <gina@octoprint.org>
2021-10-29 11:20:39 +02:00
Gina Häußge e3999ca5bb Merge branch 'master' into staging/bugfix 2021-10-29 11:20:11 +02:00
Gina Häußge 4a9e573107 👷‍♂️ Fix comment syntax in workflow step
JS uses `//`, not `#` ...
2021-10-27 22:58:45 +02:00
Gina Häußge 58dc515990 Merge pull request #4285 from OctoPrint/meta/rephrase-bundle-reminder
👷‍♂️ Rephrase the bundle reminder
2021-10-27 22:56:02 +02:00
Gina Häußge d3e92db8a8 👷‍♂️ Rephrase the bundle reminder
And doing this as a PR to test the PR label fix from earlier today...
2021-10-27 22:54:21 +02:00
Gina Häußge 450d5bb9ae 👷‍♂️ Fix PR automation
Labels weren't refreshed properly in a step, causing
labeling to be reverted and thereby causing issues 
in a later step.
2021-10-27 12:57:01 +02:00
Gina Häußge 5444c46777 Merge pull request #4282 from OctoPrint/meta/issue-bundle-reminder
Add reminder for issues w/o bundles
2021-10-27 11:40:29 +02:00
Charlie Powell e451493c0d ✏️ Add missing minDelay timelapse data model entry 2021-10-26 20:16:42 +01:00
Gina Häußge 2a247672a6 👷 Add reminder for issues w/o bundles
Will add a reminder if an issue is labeled 'triage' and now bundle
is detected.

Will go away if issue is no longer labeled 'triage' or edited to fix the
problem.
2021-10-26 19:45:17 +02:00
Gina Häußge 1ae017954b Merge branch 'master' into staging/bugfix 2021-10-14 16:57:35 +02:00
Gina Häußge 1b04c08a1a 🔖 staging/bugfix is now 1.7.1.dev 2021-10-12 11:29:38 +02:00
Gina Häußge ddfd333b62 Merge branch 'master' into staging/bugfix 2021-10-12 11:28:26 +02:00
Gina Häußge 2087c3da54 🔖 staging/bugfix is now 1.6.2.dev 2021-05-10 15:40:37 +02:00
14 changed files with 152 additions and 33 deletions

No files matched your search

+92 -5
View File
@@ -1,19 +1,18 @@
name: "Issue Automation"
on:
issues:
types: [opened, edited, closed, reopened]
types: [opened, edited, closed, reopened, labeled, unlabeled]
jobs:
issue-automation:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v2
- uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
let labels = [];
let labels = context.payload.issue.labels.map(label => label.name);
let setLabels = false;
context.payload.issue.labels.forEach(label => { labels.push(label.name) });
switch (context.payload.action) {
@@ -55,7 +54,7 @@ jobs:
}
if (setLabels) {
github.issues.setLabels({
github.rest.issues.setLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
@@ -67,3 +66,91 @@ jobs:
# if: github.event_name == 'issues' && (github.event.action == 'opened' || github.event.action == 'edited')
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/github-script@v5
env:
REMINDER: >
Hi @${{ github.event.issue.user.login }}!
It looks like you didn't upload a [system info bundle](https://community.octoprint.org/t/29887) as requested by the template.
A bundle is required to further process your issue. It contains important logs and
system information to be able to put your issue into context and give pointers as to
what has happened.
Please **edit your original post above** and upload **a bundle zip file**. Actually upload the file please and
do not paste some link to a cloud provider, we want to have everything in one place here. Also do
not unpack, repack or otherwise modify the bundle or its name, share it **exactly** like you get it from OctoPrint.
Without the availability of a bundle, your issue will have to be closed.
Thank you for your collaboration.
THANKYOU: >
Thank you @${{ github.event.issue.user.login }} for adding a bundle! Now this can actually get looked at.
with:
script: |
const { REMINDER, THANKYOU } = process.env;
const bundleRegex = /\[(octoprint-systeminfo-\d{14}\.zip)\]\(([^)]+)\)/g;
const marker = "<!-- check_for_bundle -->";
const issueLabels = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});
let labels = issueLabels.data.map(label => label.name);
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
})
const comment = comments.data.find(c => c.user.login === "github-actions[bot]" && c.body.includes(marker));
if (!labels.includes("triage")) {
console.log("No label, deleting comment if needed");
if (comment) {
await github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: comment.id,
})
}
return;
}
const found = !!context.payload.issue.body.match(bundleRegex);
if (!found) {
console.log("No bundle found, posting/updating reminder");
const text = REMINDER + "\n" + marker;
if (comment && comment.body !== text) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: comment.id,
body: text
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: text
});
}
} else if (found && comment) {
console.log("Bundle found, saying thanks");
const text = REMINDER.split("\n\n").map(line => `~~${line.trim()}~~`).join("\n\n") + "\n\n" + THANKYOU + "\n" + marker;
if (comment.body !== text) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: comment.id,
body: text
});
}
}
+9 -4
View File
@@ -12,13 +12,18 @@ jobs:
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/github-script@v2
- uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
let labels = [];
// fetch a fresh set of labels, they might have changed earlier
const issueLabels = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});
let labels = issueLabels.data.map(label => label.name);
let setLabels = false;
context.payload.pull_request.labels.forEach(label => { labels.push(label.name) });
let target = context.payload.pull_request.base.ref;
if (["maintenance", "devel", "staging/maintenance", "staging/devel", "master"].includes(target)) {
@@ -27,7 +32,7 @@ jobs:
}
if (setLabels) {
github.issues.setLabels({
github.rest.issues.setLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
+3 -3
View File
@@ -24,10 +24,10 @@ maintenance 1.7.0 07c4630d126617c2ae98a9c23ad49facf7bf0bbd pep440-dev
fix/.* 1.7.0 07c4630d126617c2ae98a9c23ad49facf7bf0bbd pep440-dev
improve/.* 1.7.0 07c4630d126617c2ae98a9c23ad49facf7bf0bbd pep440-dev
# staging/bugfix is the branch for preparation of the 1.6.1 bugfix release
# staging/bugfix is the branch for preparation of the 1.7.2 bugfix release
# so are any bug/... branches
staging/bugfix 1.6.1 29484fb2926960279e62881d6ee073c374a2a5fe pep440-dev
bug/.* 1.6.1 29484fb2926960279e62881d6ee073c374a2a5fe pep440-dev
staging/bugfix 1.7.2 945825f03fbd2417a009dd33daf9f787aff60211 pep440-dev
bug/.* 1.7.2 945825f03fbd2417a009dd33daf9f787aff60211 pep440-dev
# staging/maintenance is currently the branch for preparation of 1.7.0rc4
# so is regressionfix/...
+1
View File
@@ -149,6 +149,7 @@ date of first contribution):
* [Ian Wilt](https://github.com/ianwiltdotcom)
* [Ben Sycha](https://github.com/Sycha)
* [Bryan Kenote](https://github.com/bryankenote)
* [Quinn Damerell](https://github.com/QuinnDamerell)
OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by
[Daid Braam](https://github.com/daid). Parts of its communication layer and
+4
View File
@@ -226,6 +226,10 @@ For timelapse type ``zchange``.
- 1
- float
- Size of retraction Z hop to detect and ignore for z-based snapshots
* - ``minDelay``
- 1
- int
- Snapshots will be rate limited against this interval, to prevent performance issues with vase mode/continuous z prints
.. _sec-api-timelapse-datamodel-config-timed:
+1 -1
View File
@@ -26,7 +26,7 @@ INSTALL_REQUIRES = [
# additional OctoPrint plugins that are maintained on a different release cycle
"OctoPrint-FileCheck>=2021.2.23",
"OctoPrint-FirmwareCheck>=2021.10.11",
"OctoPrint-PiSupport>=2021.8.2",
"OctoPrint-PiSupport>=2021.10.28",
# the following dependencies are non trivial to update since later versions
# introduce backwards incompatible changes that might affect plugins, or due to
# other observed problems
@@ -21,10 +21,10 @@ from octoprint.util.version import (
)
SENTRY_URL_SERVER = (
"https://3d510fcb31be49c8a811639b7ed18377@o118517.ingest.sentry.io/1373987"
"https://690e174698034bcc95928e6bfa8573f7@o118517.ingest.sentry.io/1373987"
)
SENTRY_URL_COREUI = (
"https://c6ab43a97f224198ae62a6e11e253cf0@o118517.ingest.sentry.io/1374096"
"https://186f1dc5da7d46ab9d6b6de564d839bb@o118517.ingest.sentry.io/1374096"
)
SETTINGS_DEFAULTS = {
@@ -50,7 +50,7 @@ $(function () {
return !item.enabled;
}
},
"popularity",
"name",
[],
[
["bundled", "3rdparty"],
@@ -138,7 +138,7 @@ $(function () {
return !plugin.abandoned;
}
},
"title",
"popularity",
["filter_installed", "filter_incompatible"],
[],
0
+17 -6
View File
@@ -37,6 +37,11 @@ from octoprint.server.util.flask import (
from octoprint.settings import settings, valid_boolean_trues
from octoprint.util import sv, time_this
try:
from urllib.parse import quote as urlquote
except ImportError:
from urllib import quote as urlquote # noqa: F401
# ~~ GCODE file handling
_file_cache = {}
@@ -448,7 +453,7 @@ def _getFileList(
+ "downloads/files/"
+ FileDestinations.LOCAL
+ "/"
+ file_or_folder["path"],
+ urlquote(file_or_folder["path"]),
}
result.append(file_or_folder)
@@ -702,7 +707,7 @@ def uploadGcodeFile(target):
+ "downloads/files/"
+ FileDestinations.LOCAL
+ "/"
+ filename,
+ urlquote(filename),
},
}
}
@@ -1034,7 +1039,10 @@ def gcodeFileCommand(filename, target):
abort(404, description="Unknown profile")
location = url_for(
".readGcodeFile", target=target, filename=full_path, _external=True
".readGcodeFile",
target=target,
filename=full_path,
_external=True,
)
result = {
"name": destination,
@@ -1047,7 +1055,7 @@ def gcodeFileCommand(filename, target):
+ "downloads/files/"
+ target
+ "/"
+ full_path,
+ urlquote(full_path),
},
}
@@ -1154,7 +1162,10 @@ def gcodeFileCommand(filename, target):
fileManager.move_folder(target, filename, destination)
location = url_for(
".readGcodeFile", target=target, filename=destination, _external=True
".readGcodeFile",
target=target,
filename=destination,
_external=True,
)
result = {
"name": name,
@@ -1168,7 +1179,7 @@ def gcodeFileCommand(filename, target):
+ "downloads/files/"
+ target
+ "/"
+ destination
+ urlquote(destination)
)
r = make_response(jsonify(result), 201)
+7 -2
View File
@@ -24,6 +24,11 @@ from octoprint.server.util.flask import (
)
from octoprint.settings import settings, valid_boolean_trues
try:
from urllib.parse import quote as urlquote
except ImportError:
from urllib import quote as urlquote # noqa: F401
_DATA_FORMAT_VERSION = "v2"
# ~~ timelapse handling
@@ -140,7 +145,7 @@ def getTimelapseData():
finished_list = []
for f in files:
output = dict(f)
output["url"] = url_for("index") + "downloads/timelapse/" + f["name"]
output["url"] = url_for("index") + "downloads/timelapse/" + urlquote(f["name"])
finished_list.append(output)
result = {
@@ -160,7 +165,7 @@ def getTimelapseData():
@Permissions.TIMELAPSE_DOWNLOAD.require(403)
def downloadTimelapse(filename):
return redirect_to_tornado(
request, url_for("index") + "downloads/timelapse/" + filename
request, url_for("index") + "downloads/timelapse/" + urlquote(filename)
)
+1 -1
View File
@@ -109,7 +109,7 @@ default_settings = {
"port": None,
"baudrate": None,
"exclusive": True,
"lowLatency": True,
"lowLatency": False,
"autoconnect": False,
"log": False,
"timeout": {
@@ -426,5 +426,11 @@
});
};
OctoPrintClient.escapePath = function (path) {
return _.map(path.split("/"), function (p) {
return encodeURIComponent(p);
}).join("/");
};
return OctoPrintClient;
});
+4 -4
View File
@@ -14,19 +14,19 @@
};
var resourceForLocation = function (location) {
return url + "/" + location;
return url + "/" + OctoPrintClient.escapePath(location);
};
var downloadForLocation = function (location) {
return downloadUrl + "/" + location;
return downloadUrl + "/" + OctoPrintClient.escapePath(location);
};
var downloadForEntry = function (location, filename) {
return downloadForLocation(location) + "/" + filename;
return downloadForLocation(location) + "/" + OctoPrintClient.escapePath(filename);
};
var resourceForEntry = function (location, filename) {
return resourceForLocation(location) + "/" + filename;
return resourceForLocation(location) + "/" + OctoPrintClient.escapePath(filename);
};
var preProcessList = function (response) {
@@ -11,15 +11,15 @@
var bulkDownloadUrl = "downloads/timelapses";
var timelapseUrl = function (filename) {
return url + "/" + filename;
return url + "/" + OctoPrintClient.escapePath(filename);
};
var timelapseDownloadUrl = function (filename) {
return downloadUrl + "/" + filename;
return downloadUrl + "/" + OctoPrintClient.escapePath(filename);
};
var unrenderedTimelapseUrl = function (name) {
return url + "/unrendered/" + name;
return url + "/unrendered/" + OctoPrintClient.escapePath(name);
};
var OctoPrintTimelapseClient = function (base) {