Repository navigation
feat(release): prepare Castlegate Server for the QGIS plugin repository - #14
Merged
Merged
Conversation
- metadata.txt adds the repository, homepage, tracker and tags, marks the plugin experimental, and says in its about what Castlegate does, what it leaves out and that it has had no outside review; the zip now carries LICENSE and a .bandit that skips B405 with its reason. - The two last-resort handlers that swallowed an error now log it; a release tagged castlegate_server@<version> builds the zip and attaches it (plugin-release.yml, RELEASING.md). - Checked: core and plugin tests pass, test_build.py included; bandit and detect-secrets report 0 on the built zip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- metadata.txt gives castlegate@vectoria.com.au as the plugin's email, which the QGIS plugin repository writes to. - Checked: the plugin tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…'s contact - spike/plugin/castlegate_spike/metadata.txt gives the same contact as the released plugin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The reason for skipping B405 says every parse refuses document type and entity declarations, and that only read() refuses a body over MAX_BODY_BYTES; is_transaction() parses with no size limit. - Checked: the plugin tests pass; bandit reports 0 on the built zip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
…ithout parsing it - is_transaction() no longer parses a body over MAX_BODY_BYTES; it answers True, so read() refuses the body as too large and a large Transaction never reaches QGIS Server unread. - .bandit's reason for skipping B405 says no body over the limit is parsed. - Checked: the new test fails on the previous transaction.py and passes now; core and plugin tests pass; bandit reports 0 on the built zip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Castlegate Server is to be published in the QGIS plugin repository (plugins.qgis.org) as an experimental plugin. This makes the zip pass the repository's validation and security scan, adds a release route that builds the zip, and caps the size of every body the plugin parses.
Changes
server/castlegate_server/metadata.txt:repository, which the repository requires, andhomepage,trackerandtags;experimental=True;descriptionandabout. The about is plain text in paragraphs, which is how the repository shows it, and says:castlegate@vectoria.com.auas the contact, asspike/plugin/castlegate_spike/metadata.txtnow does too.scripts/build.pycopiesLICENSEinto the plugin's folder. The repository refuses a zip without one.transaction.py:is_transaction()no longer parses a body overMAX_BODY_BYTES.read()refuses the body as too large. Before, it parsed a body of any size.server/castlegate_server/.banditskips B405, the import ofxml.etree, with its reason: every parse intransaction.pygoes through an expat parser that refuses any document type declaration and entity declaration, and no body overMAX_BODY_BYTESis parsed. The repository reads.banditbesidemetadata.txtand lists such a version as "Validated (configured)".request_filter.pyandstatus.py: the two last-resort handlers that swallowed a second error (Bandit B110) now write it to QGIS Server's log..github/workflows/plugin-release.yml: a release taggedcastlegate_server@<version>runs this workflow. It checks the tag againstmetadata.txt, runs the core and plugin tests, builds the zip and attaches it to the release.RELEASING.mdgives those steps.install/README.mdsays the release zip is on the Releases page.tests/plugin/test_build.py: the built zip holds one folder,LICENSE,.banditand no compiled Python.metadata.txthas every field the repository requires, and is marked experimental.VERSIONinstatus.pyequals the version inmetadata.txt.tests/plugin/test_transaction.py: a body over the limit counts as a Transaction, unparsed, andread()refuses it. The test fails on the previoustransaction.py.Checks
python -m unittest discover -s tests/plugin -t .andpython -m unittest discover -s tests/core -t .pass.scripts/build.pybuilds:bandit -r .reports 0 issues; with.banditremoved, 1 (B405);detect-secrets scan --all-files --exclude-files 'metadata\.txt' ., as the repository runs it, reports 0.configparser.ConfigParser(), the reader the repository uses, reads theaboutwith its paragraphs.