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" %}