diff --git a/.github/workflows/issue_automation.yml b/.github/workflows/issue_automation.yml index fb59a7d97..facf1ade8 100644 --- a/.github/workflows/issue_automation.yml +++ b/.github/workflows/issue_automation.yml @@ -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 = ""; + + 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 + }); + } + } diff --git a/.github/workflows/pr_automation.yml b/.github/workflows/pr_automation.yml index c1f115ecf..cc411d121 100644 --- a/.github/workflows/pr_automation.yml +++ b/.github/workflows/pr_automation.yml @@ -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, diff --git a/.versioneer-lookup b/.versioneer-lookup index e2ceecdb5..164a3b441 100644 --- a/.versioneer-lookup +++ b/.versioneer-lookup @@ -24,10 +24,10 @@ maintenance 1.8.0 3fe45661cd79c5137d9d4f5f4adb4d9519bc2084 pep440-dev fix/.* 1.8.0 3fe45661cd79c5137d9d4f5f4adb4d9519bc2084 pep440-dev improve/.* 1.8.0 3fe45661cd79c5137d9d4f5f4adb4d9519bc2084 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/... diff --git a/AUTHORS.md b/AUTHORS.md index 8c6e18395..104016aa3 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -152,6 +152,8 @@ date of first contribution): * [Adam DeMuri](https://github.com/ademuri) * [Daniel Shenkle](https://github.com/DShenkle) * [Bryan Kenote](https://github.com/bryankenote) + * [Quinn Damerell](https://github.com/QuinnDamerell) + * [Sven Samoray](https://github.com/thelastWallE) 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 diff --git a/docs/api/timelapse.rst b/docs/api/timelapse.rst index 000a8190f..66e0bb72e 100644 --- a/docs/api/timelapse.rst +++ b/docs/api/timelapse.rst @@ -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: diff --git a/setup.py b/setup.py index 777c93889..27299c386 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,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 diff --git a/src/octoprint/plugin/types.py b/src/octoprint/plugin/types.py index e1ede3b5d..bea482ed1 100644 --- a/src/octoprint/plugin/types.py +++ b/src/octoprint/plugin/types.py @@ -398,6 +398,10 @@ class TemplatePlugin(OctoPrintPlugin, ReloadNeedingPlugin): ``TemplatePlugin`` is a :class:`~octoprint.plugin.core.ReloadNeedingPlugin`. """ + @property + def template_folder_key(self): + return f"plugin_{self._identifier}" + def get_template_configs(self): """ Allows configuration of injected navbar, sidebar, tab and settings templates (and also additional templates of diff --git a/src/octoprint/plugins/backup/templates/backup_settings.jinja2 b/src/octoprint/plugins/backup/templates/backup_settings.jinja2 index 0d2fd81fe..d65bab106 100644 --- a/src/octoprint/plugins/backup/templates/backup_settings.jinja2 +++ b/src/octoprint/plugins/backup/templates/backup_settings.jinja2 @@ -108,7 +108,7 @@

{{ _('Restore settings & files from an uploaded backup archive.') }}

{% set plugin_backup_upload_form_id='settings-backup-upload' %} - {% include "snippets/plugin/backup/backup_plugin_upload_form.jinja2" %} + {% include "snippets/backup_plugin_upload_form.jinja2" %}
diff --git a/src/octoprint/plugins/backup/templates/backup_wizard.jinja2 b/src/octoprint/plugins/backup/templates/backup_wizard.jinja2 index 8ba4f479c..f1f4c2c87 100644 --- a/src/octoprint/plugins/backup/templates/backup_wizard.jinja2 +++ b/src/octoprint/plugins/backup/templates/backup_wizard.jinja2 @@ -5,4 +5,4 @@

{% endtrans %} {% set plugin_backup_upload_form_id='wizard-backup-upload' %} -{% include "snippets/plugin/backup/backup_plugin_upload_form.jinja2" %} +{% include "snippets/backup_plugin_upload_form.jinja2" %} diff --git a/src/octoprint/plugins/backup/templates/snippets/plugin/backup/backup_plugin_upload_form.jinja2 b/src/octoprint/plugins/backup/templates/snippets/backup_plugin_upload_form.jinja2 similarity index 100% rename from src/octoprint/plugins/backup/templates/snippets/plugin/backup/backup_plugin_upload_form.jinja2 rename to src/octoprint/plugins/backup/templates/snippets/backup_plugin_upload_form.jinja2 diff --git a/src/octoprint/plugins/errortracking/__init__.py b/src/octoprint/plugins/errortracking/__init__.py index 144918d64..cb70e950d 100644 --- a/src/octoprint/plugins/errortracking/__init__.py +++ b/src/octoprint/plugins/errortracking/__init__.py @@ -18,10 +18,10 @@ from octoprint.util.version import ( ) SENTRY_URL_SERVER = ( - "https://3d510fcb31be49c8a811639b7ed18377@o118517.ingest.sentry.io/1373987" + "https://6600411b6f6b4a959d53037e782a8f73@o118517.ingest.sentry.io/1373987" ) SENTRY_URL_COREUI = ( - "https://c6ab43a97f224198ae62a6e11e253cf0@o118517.ingest.sentry.io/1374096" + "https://72b9fc82150d47bead5c940ccbd05995@o118517.ingest.sentry.io/1374096" ) SETTINGS_DEFAULTS = { diff --git a/src/octoprint/plugins/gcodeviewer/static/js/gcodeviewer.js b/src/octoprint/plugins/gcodeviewer/static/js/gcodeviewer.js index fcf717b8a..b2ae6fdfe 100644 --- a/src/octoprint/plugins/gcodeviewer/static/js/gcodeviewer.js +++ b/src/octoprint/plugins/gcodeviewer/static/js/gcodeviewer.js @@ -371,6 +371,7 @@ $(function () { self._configureLayerSlider(layerSliderElement); self._configureLayerCommandSlider(commandSliderElement); + self._configureContainerElement(containerElement); self.settings.firstRequest.done(function () { var initResult = GCODE.ui.init({ @@ -475,6 +476,18 @@ $(function () { .on("slide", self.changeCommandRange); }; + self._configureContainerElement = function (containerElement) { + // Prevent the default browser action for the mouse wheel down event. The desired behavor is to have the + // gocde canvas pan on mouse down + drag, which happens. But if we don't prevent the default action, the browser + // will also scroll the entire page. + containerElement.mousedown(function (event) { + // Middle mouse button + if (event.which === 2) { + event.preventDefault(); + } + }); + }; + self.loadFile = function (path, date) { self.enableReload(false); self.needsLoad = false; diff --git a/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js b/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js index 4d1276b33..28f515056 100644 --- a/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js +++ b/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js @@ -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 diff --git a/src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/checkoutFolder.jinja2 b/src/octoprint/plugins/softwareupdate/templates/snippets/checkoutFolder.jinja2 similarity index 100% rename from src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/checkoutFolder.jinja2 rename to src/octoprint/plugins/softwareupdate/templates/snippets/checkoutFolder.jinja2 diff --git a/src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/pipEnableCheck.jinja2 b/src/octoprint/plugins/softwareupdate/templates/snippets/pipEnableCheck.jinja2 similarity index 100% rename from src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/pipEnableCheck.jinja2 rename to src/octoprint/plugins/softwareupdate/templates/snippets/pipEnableCheck.jinja2 diff --git a/src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/pipTarget.jinja2 b/src/octoprint/plugins/softwareupdate/templates/snippets/pipTarget.jinja2 similarity index 100% rename from src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/pipTarget.jinja2 rename to src/octoprint/plugins/softwareupdate/templates/snippets/pipTarget.jinja2 diff --git a/src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/releaseChannel.jinja2 b/src/octoprint/plugins/softwareupdate/templates/snippets/releaseChannel.jinja2 similarity index 100% rename from src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/releaseChannel.jinja2 rename to src/octoprint/plugins/softwareupdate/templates/snippets/releaseChannel.jinja2 diff --git a/src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/trackedBranch.jinja2 b/src/octoprint/plugins/softwareupdate/templates/snippets/trackedBranch.jinja2 similarity index 100% rename from src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/trackedBranch.jinja2 rename to src/octoprint/plugins/softwareupdate/templates/snippets/trackedBranch.jinja2 diff --git a/src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/versionTracking.jinja2 b/src/octoprint/plugins/softwareupdate/templates/snippets/versionTracking.jinja2 similarity index 100% rename from src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/versionTracking.jinja2 rename to src/octoprint/plugins/softwareupdate/templates/snippets/versionTracking.jinja2 diff --git a/src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2 b/src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2 index 40deec7bd..3bf2516d5 100644 --- a/src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2 +++ b/src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2 @@ -158,11 +158,11 @@