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

Allow specifying topic type for SNS module. #599

Merged

Conversation

stefanhorning
Copy link
Contributor

@stefanhorning stefanhorning commented Jun 11, 2021

SUMMARY

Adding a topic_type param to SNS module (simillar to SQS).

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

sns_topic module

ADDITIONAL INFORMATION

Simillar to SQS queues, SNS topics also allow specifying a type, that can either be 'Standard' or 'FIFO'. Furthermore if you have a FIFO SQS queue and want to subscribe that to an SNS topic, that one has to be FIFO too. Hence adding this flag is important and is actually just another option for the creat_topic action in Boto, see https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sns.html#SNS.Client.create_topic

@ansibullbot
Copy link

@ansibullbot ansibullbot added community_review feature This issue/PR relates to a feature request module module needs_triage plugins plugin (any type) labels Jun 11, 2021
Copy link
Contributor

@alinabuzachis alinabuzachis left a comment

Choose a reason for hiding this comment

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

@stefanhorning Thank you for working on this. Could you add please some integration tests? In addition, a changelog fragment is also required https://docs.ansible.com/ansible/latest/dev_guide/testing/sanity/changelog.html.

plugins/modules/sns_topic.py Show resolved Hide resolved
@ansibullbot ansibullbot added integration tests/integration tests tests labels Jun 29, 2021
@stefanhorning
Copy link
Contributor Author

@alinabuzachis done now. Let's see if all tests pass.

@stefanhorning
Copy link
Contributor Author

Build fails in this line https://github.com/ansible/ansible-zuul-jobs/blob/master/roles/ansible-test/tasks/split_targets.yaml#L23, not sure how that's related to my change (if at all).

@stefanhorning
Copy link
Contributor Author

it was probably more likely that this was the change that broke CI (20 hours ago) ansible/ansible-zuul-jobs@f8fa3e9#diff-1e727d74735315c5405dbbc015402f13da5e0c3d8d7a08cae148cc7dac1c4f56

@tremble
Copy link
Contributor

tremble commented Jun 29, 2021

Looks like the failure occurs when there's not matching tests. a default([]) is needed

@stefanhorning
Copy link
Contributor Author

Also just noticed that the tests for sns_topic are disabled anyway with alias unsupported. So I guess we need to enable the test first before it will be run at all. Hence the test failures from CI are unrelated to this PR.

@stefanhorning
Copy link
Contributor Author

There was a PR already to attempt enabling tests https://github.com/ansible-collections/community.aws/pull/519/files

I will just do that in here now to see how it goes @tremble

@tremble
Copy link
Contributor

tremble commented Jun 30, 2021

    "msg": "Unsupported parameters for (sns_topic) module: type. Supported parameters include: topic_type, aws_ca_bundle, aws_access_key (access_key, ec2_access_key), aws_secret_key (ec2_secret_key, secret_key), display_name, name, ec2_url (aws_endpoint_url, endpoint_url), profile (aws_profile), region (aws_region, ec2_region), security_token (access_token, aws_security_token), validate_certs, aws_config, state, delivery_policy, purge_subscriptions, subscriptions, policy, debug_botocore_endpoint_logs."

@stefanhorning
Copy link
Contributor Author

should read my own docs :)
Fixed now

Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

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

I'm sorry about the delay here. The main change looks good.

2 minor things:

  • defaults/main.yml in the test has a merge conflict (side effect of the zuul migration)
  • shippable/aws/group1 is no longer needed in the aliases file, just remove the unsupported entry

tests/integration/targets/sns_topic/aliases Outdated Show resolved Hide resolved
@ansibullbot
Copy link

@ansibullbot ansibullbot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed community_review labels Jul 9, 2021
@stefanhorning
Copy link
Contributor Author

@tremble merged in latest main now and resolved conflicts, or should I rather rebase?

@ansibullbot
Copy link

@stefanhorning this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibullbot ansibullbot added merge_commit This PR contains at least one merge commit. Please resolve! and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Jul 12, 2021
@tremble
Copy link
Contributor

tremble commented Jul 12, 2021

Please rebase if possible. With the migration to Zuul commits are now merged as-is rather than squashed.

@stefanhorning
Copy link
Contributor Author

Yes, the bot already answered my question ;)

Rebased now

@ansibullbot ansibullbot added community_review and removed merge_commit This PR contains at least one merge commit. Please resolve! needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Jul 12, 2021
Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

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

apologies, one minor nit and we're good to merge.

changelogs/fragments/sns_topic_type.yml Outdated Show resolved Hide resolved
Co-authored-by: Mark Chappell <mchappel@redhat.com>
@stefanhorning
Copy link
Contributor Author

done

@tremble tremble added the gate label Jul 12, 2021
@ansible-zuul ansible-zuul bot merged commit 9ab9c77 into ansible-collections:main Jul 12, 2021
@tremble
Copy link
Contributor

tremble commented Jul 12, 2021

@stefanhorning Thanks for your contribution and patience.

alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
…type_param

Allow specifying topic type for SNS module.

SUMMARY
Adding a topic_type param to SNS module (simillar to SQS).
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
sns_topic module
ADDITIONAL INFORMATION
Simillar to SQS queues, SNS topics also allow specifying a type, that can either be 'Standard' or 'FIFO'. Furthermore if you have a FIFO SQS queue and want to subscribe that to an SNS topic, that one has to be FIFO too. Hence adding this flag is important and is actually just another option for the creat_topic action in Boto, see https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sns.html#SNS.Client.create_topic

Reviewed-by: Stefan Horning <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Mark Chappell <None>
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
…type_param

Allow specifying topic type for SNS module.

SUMMARY
Adding a topic_type param to SNS module (simillar to SQS).
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
sns_topic module
ADDITIONAL INFORMATION
Simillar to SQS queues, SNS topics also allow specifying a type, that can either be 'Standard' or 'FIFO'. Furthermore if you have a FIFO SQS queue and want to subscribe that to an SNS topic, that one has to be FIFO too. Hence adding this flag is important and is actually just another option for the creat_topic action in Boto, see https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sns.html#SNS.Client.create_topic

Reviewed-by: Stefan Horning <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Mark Chappell <None>
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request May 25, 2022
…ollections#599)

Prepare for distutils.version being removed in Python 3.12

SUMMARY
distutils has been deprecafed and will be removed from
Python's stdlib in Python 3.12 (see https://python.org/dev/peps/pep-0632).
This PR replaces the use of distutils.version.LooseVersion and distutils.version.StrictVersion
with LooseVersion from the vendored copy of distutils.version
included with ansible-core 2.12 (ansible/ansible#74644) if available,
and falls back to distutils.version for ansible-core 2.11 and before.
Since ansible-core 2.11 and earlier do not support Python 3.12 (since
they use LooseVersion itself in various places), this incomplete fix
should be OK for now. Also, the way this PR works (by adding a new
module_utils version that abstracts away where LooseVersion comes from),
it is easy to also fix this for ansible-core 2.11 and earlier later on.
Signed-off-by: Abhijeet Kasurde akasurde@redhat.com
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
changelogs/fragments/disutils.version.yml
plugins/module_utils/core.py
plugins/module_utils/version.py
plugins/modules/ec2.py

Reviewed-by: Felix Fontein <felix@fontein.de>
Reviewed-by: Jill R <None>
Reviewed-by: None <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community_review feature This issue/PR relates to a feature request integration tests/integration module module plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants