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

Make Topic and Subscription classes standalone #523

Merged
merged 8 commits into from
Sep 27, 2022

Conversation

cortadocodes
Copy link
Member

@cortadocodes cortadocodes commented Sep 26, 2022

Summary

Make the Topic and Subscription classes standalone instead of relying on a Service instance and a related subscriber.

Contents (#523)

IMPORTANT: There are 2 breaking changes.

Enhancements

  • 💥 BREAKING CHANGE: Remove service argument from Topic constructor
  • 💥 BREAKING CHANGE: Remove subscriber argument from Subscription constructor
  • Implicitly get Service credentials from environment and remove credentials attribute

Fixes

  • Move finally clause to correct nesting level in OrderedMessageHandler.handle_messages

Upgrade instructions

💥 Remove `service` argument from `Topic` constructor

Provide the project_name argument instead of the old service argument.

💥 Remove `subscriber` argument from `Subscription` constructor

Remove the old subscriber argument as it's no longer needed.

BREAKING CHANGE: Provide the `project_name` argument instead of the
old `service` argument.
@cortadocodes cortadocodes self-assigned this Sep 26, 2022
@cortadocodes cortadocodes linked an issue Sep 26, 2022 that may be closed by this pull request
@cortadocodes cortadocodes linked an issue Sep 26, 2022 that may be closed by this pull request
@codecov-commenter
Copy link

Codecov Report

Merging #523 (5d3dadf) into main (a87dd3d) will increase coverage by 0.14%.
The diff coverage is 89.20%.

@@            Coverage Diff             @@
##             main     #523      +/-   ##
==========================================
+ Coverage   93.99%   94.14%   +0.14%     
==========================================
  Files          75       76       +1     
  Lines        3115     3158      +43     
==========================================
+ Hits         2928     2973      +45     
+ Misses        187      185       -2     
Impacted Files Coverage Δ
octue/cloud/emulators/child.py 97.64% <ø> (ø)
octue/cli.py 83.67% <43.75%> (-5.22%) ⬇️
octue/cloud/pub_sub/topic.py 94.33% <82.35%> (+0.86%) ⬆️
octue/cloud/pub_sub/subscription.py 91.42% <84.61%> (+3.92%) ⬆️
octue/cloud/pub_sub/message_handler.py 97.38% <97.72%> (+0.16%) ⬆️
...ctue/cloud/deployment/google/cloud_run/deployer.py 92.45% <100.00%> (-0.28%) ⬇️
octue/cloud/deployment/google/dataflow/pipeline.py 100.00% <100.00%> (ø)
octue/cloud/emulators/_pub_sub.py 90.83% <100.00%> (+1.94%) ⬆️
octue/cloud/pub_sub/service.py 94.31% <100.00%> (+3.26%) ⬆️
octue/compatibility.py 100.00% <100.00%> (ø)
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@cortadocodes cortadocodes merged commit 476c930 into main Sep 27, 2022
@cortadocodes cortadocodes deleted the enhancement/remove-service-argument-from-topic branch September 27, 2022 10:19
@cortadocodes cortadocodes changed the title Remove service argument from Topic instantiation Make Topic and Subscription classes standalone Sep 27, 2022
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.

Fix try/finally block in OrderedMessageHandler Topic class shouldn't require a service to instantiate
2 participants