Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds the packaging and deployment scaffolding needed to run products-api as a Rock + 12-factor (paas-charm) charm, and adjusts the app/migrations setup to work in that charm runtime.
Changes:
- Add Rockcraft configuration (with explicit prime list) and a charm definition using the
flask-frameworkextension. - Add a charm migration hook (
migrate.sh) and update Alembic env resolution to rely on the Flask app’s configured DB URL. - Add
geventto support the existing Gunicorn--worker-class gevententrypoint configuration.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| webapp/app.py | Adds DB URL fallback to support charm-injected PostgreSQL connection string. |
| rockcraft.yaml | Introduces Rockcraft config and overrides prime to include app + migrations assets. |
| requirements.txt | Adds gevent dependency for the configured Gunicorn worker class. |
| migrations/env.py | Resolves Alembic DB URL via Flask app config and updates the error message. |
| migrate.sh | Adds paas-charm-compatible migration hook to run flask db upgrade. |
| charm/tox.ini | Adds charm lint/format/static tox environments (plus unit/integration stanzas). |
| charm/src/charm.py | Adds the charm entrypoint extending paas_charm.flask.Charm. |
| charm/requirements.txt | Adds charm runtime dependencies (ops, paas-charm). |
| charm/pyproject.toml | Adds tool configuration for ruff/codespell/pytest/coverage/pyright. |
| charm/charmcraft.yaml | Defines the charm metadata and required PostgreSQL integration. |
| charm/.gitignore | Ignores charm build artifacts, venvs, and fetched charm libs. |
Comment on lines
+10
to
+13
| [vars] | ||
| src_path = {tox_root}/src | ||
| ;tests_path = {tox_root}/tests | ||
| all_path = {[vars]src_path} |
Comment on lines
+40
to
+41
| [tool.pyright] | ||
| include = ["src/**.py"] |
britneywwc
reviewed
Jul 3, 2026
britneywwc
left a comment
There was a problem hiding this comment.
Can we add a deploy.yaml action (similar to u.com here) to test that the rock / charm is packed and can be deployed as expected?
britneywwc
reviewed
Jul 15, 2026
| name: Pack | ||
|
|
||
| on: | ||
| pull_request: |
| optional: false | ||
| limit: 1 | ||
|
|
||
| # Uncomment the integrations used by your application |
There was a problem hiding this comment.
Can we summarise the comments for db upgrade to make it more readable?
| SQLAlchemy-Utils>=0.41.2 | ||
| Talisker>=0.16.0 | ||
| gunicorn>=20.0.4 | ||
| gevent>=23.9.1 |
There was a problem hiding this comment.
Is this needed? We can also invoke gevent through gunicorn.gevent
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.
Done
Notes / Rationale
QA
Issue / Card
WD-36748