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: validate ops.main() call for operator framework charms #1883

Merged
merged 2 commits into from
Sep 21, 2024

Conversation

dimaqq
Copy link
Contributor

@dimaqq dimaqq commented Sep 6, 2024

Jira: https://warthogs.atlassian.net/browse/CHARMTECH-223
Parent: https://warthogs.atlassian.net/browse/CHARMTECH-219

The idea is to validate that the charm initialises the operator framework correctly:

@dimaqq dimaqq force-pushed the wip-ast-ops-main-extras branch 2 times, most recently from c32422e to 2b201a0 Compare September 6, 2024 08:03
tests/test_linters.py Show resolved Hide resolved
charmcraft/linters.py Outdated Show resolved Hide resolved
@dimaqq dimaqq force-pushed the wip-ast-ops-main-extras branch from ff76cec to c0529e5 Compare September 9, 2024 07:48
@dimaqq
Copy link
Contributor Author

dimaqq commented Sep 9, 2024

Rebased.

@dimaqq dimaqq requested a review from lengau September 10, 2024 01:33
@dimaqq dimaqq force-pushed the wip-ast-ops-main-extras branch from 95a950d to 8c87a50 Compare September 20, 2024 01:02
@dimaqq
Copy link
Contributor Author

dimaqq commented Sep 20, 2024

rebased and squashed

@dimaqq dimaqq requested a review from lengau September 20, 2024 01:02
@dimaqq
Copy link
Contributor Author

dimaqq commented Sep 20, 2024

cc @mr-cal if a second reviewer is needed to merge.

@dimaqq dimaqq mentioned this pull request Sep 20, 2024
3 tasks
.gitignore Outdated Show resolved Hide resolved
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 great, thanks!

@lengau lengau requested a review from mr-cal September 20, 2024 23:39
@lengau lengau enabled auto-merge September 21, 2024 01:21
@lengau lengau added this pull request to the merge queue Sep 21, 2024
Merged via the queue into canonical:main with commit b6fbbe9 Sep 21, 2024
20 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Sep 26, 2024
The `ops.main` entry point will be properly typed starting with the
upcoming release, ops==2.17.0

This PR updates the templates so that new charms use the fixed type
hints.

It is paired with #1883 where charmcraft analyse validates that ops.main
is called.

We'll be relying on charm repo static type checker to validate that
ops.main is called with correct arguments.

- [x] wait for ops 2.17.0 to be released
- [x] update ops version in the templates
- [x] update ops.main() call in the templates

https://warthogs.atlassian.net/browse/CHARMTECH-276
parent: https://warthogs.atlassian.net/browse/CHARMTECH-219

---------

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.

3 participants