Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: flask and django, update to paas-app-charmer 1.0.3 #1691

Merged
merged 9 commits into from
Jul 3, 2024
Merged

feat: flask and django, update to paas-app-charmer 1.0.3 #1691

merged 9 commits into from
Jul 3, 2024

Conversation

javierdelapuente
Copy link
Contributor

@javierdelapuente javierdelapuente commented May 29, 2024

Version 1.0.3 of paas-app-charmer has been released, providing the new following functionality:

  • Two new integrations, SAML and S3.
  • Blocking on non optional integrations. If the optional attribute in the charmcraft.yaml file is set to false and the integration is not active, paas-app-charmer will block the charm (and stop all the services).

This PR adapts charmcraft to get advantage of that functionality.

Besides those changes, charm-libs has been added to the extension (including the new two new libraries for SAML and S3). That way the user can do charmcraft fetch-libs instead of one fetch-lib per library.

@lengau
Copy link
Collaborator

lengau commented Jun 28, 2024

@javierdelapuente please ping me when this is ready to review

@javierdelapuente javierdelapuente changed the title Add optional in charm init template for flask feat: flask and django, update to latest paas-app-charmer Jul 2, 2024
@javierdelapuente javierdelapuente marked this pull request as ready for review July 2, 2024 08:51
@javierdelapuente
Copy link
Contributor Author

Hi @lengau , can you have a look at this PR? Thanks!

@javierdelapuente javierdelapuente changed the title feat: flask and django, update to latest paas-app-charmer feat: flask and django, update to paas-app-charmer 1.0.3 Jul 2, 2024
@@ -134,6 +134,17 @@ def _get_root_snippet(self) -> dict[str, Any]:
"description": f"{self.framework} application image.",
},
},
"charm-libs": [
{"lib": "traefik_k8s.ingress", "version": "2"},
{"lib": "observability_libs.juju_topology", "version": "0"},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any worry with version 0 libs here that they'll make breaking changes?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for some reason it is common to start the versions on version 0 for charm libraries, I have seen it a lot. There generally shouldn't be breaking changes within any major version

Copy link
Contributor Author

@javierdelapuente javierdelapuente Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully LIBPATCH will not introduce non-breaking changes. https://juju.is/docs/sdk/document-your-charm-library.

I do not think the LIBAPI 0 has the usual semantics of semver with major number 0 (that any breaking change can happen). In the wild, we haven't had problems with that either.

Copy link
Collaborator

@lengau lengau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! I have one question but it's for my own understanding.

@lengau lengau requested a review from a team July 2, 2024 18:47
Copy link
Contributor

@mr-cal mr-cal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving with the understanding that:

  • charms using these extensions with charm-libs defined in a charmcraft.yaml will now get an error
  • there is not a mechanism to override or modify the charm-libs defined by the extension
    • this can be added later as a feature
  • these extensions are experimental, so this is an OK change

@mr-cal mr-cal added this pull request to the merge queue Jul 3, 2024
Merged via the queue into canonical:main with commit 775a0fc Jul 3, 2024
16 of 17 checks passed
@javierdelapuente javierdelapuente deleted the update-init-flask-optional branch July 4, 2024 06:57
@javierdelapuente
Copy link
Contributor Author

javierdelapuente commented Jul 4, 2024

Approving with the understanding that:

  • charms using these extensions with charm-libs defined in a charmcraft.yaml will now get an error

  • there is not a mechanism to override or modify the charm-libs defined by the extension

    • this can be added later as a feature
  • these extensions are experimental, so this is an OK change

I will add a new PR with a fix and a test. As you point out, the error is not nice and no merging is possible. Thanks.

github-merge-queue bot pushed a commit that referenced this pull request Jul 16, 2024
As pointed by @mr-cal in
#1691 (review),
the Flask extension fails when a `charm-libs` is already defined in a
`charmcraft.yaml`, with a not very clear message because of an
`AttributeError` exception.

This PR allows having a `charm-libs` in the original `charmcraft.yaml`,
and will combine both `charm-libs` lists (if there are duplicated
elements they will be only downloaded once).

Co-authored-by: Alex Lowe <alex.lowe@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants