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

Add support for Vhost metadata #964

Merged
merged 1 commit into from Dec 7, 2023

Conversation

jimmybigcommerce
Copy link
Contributor

@jimmybigcommerce jimmybigcommerce commented Nov 20, 2023

Adding support for Vhost metadata - resolves #963

Allows for the following resource definition:

rabbitmq_vhost { 'myvhost':
  ensure             => present,
  description        => 'myvhost description',
  tags               => ['tag1', 'tag2'],
  default_queue_type => 'quorum',
}

Manual testing

Adding a various assortment of Vhosts with various settings defined:

Puppet run:

Notice: /Stage[main]/Test_rabbitmq::Server::Vhosts/Rabbitmq_vhost[test_no_desc_or_tags_or_queue_type-temp]/ensure: created
Notice: /Stage[main]/Test_rabbitmq::Server::Vhosts/Rabbitmq_vhost[test_tags_and_desc_stream_no_queue_type-temp]/ensure: created
Notice: /Stage[main]/Test_rabbitmq::Server::Vhosts/Rabbitmq_vhost[test_no_desc_or_tags_stream-temp]/ensure: created
Notice: /Stage[main]/Test_rabbitmq::Server::Vhosts/Rabbitmq_vhost[test_desc_no_tags_stream-temp]/ensure: created
Notice: /Stage[main]/Test_rabbitmq::Server::Vhosts/Rabbitmq_vhost[test_tags_and_desc_stream-temp]/ensure: created
Notice: /Stage[main]/Test_rabbitmq::Server::Vhosts/Rabbitmq_vhost[test_no_desc_or_tags_quorum-temp]/ensure: created
Notice: /Stage[main]/Test_rabbitmq::Server::Vhosts/Rabbitmq_vhost[test_desc_no_tags_quorum-temp]/ensure: created
Notice: /Stage[main]/Test_rabbitmq::Server::Vhosts/Rabbitmq_vhost[test_tags_and_desc_quorum-temp]/ensure: created
Notice: /Stage[main]/Test_rabbitmq::Server::Vhosts/Rabbitmq_vhost[test_no_desc_or_tags_classic-temp]/ensure: created
Notice: /Stage[main]/Test_rabbitmq::Server::Vhosts/Rabbitmq_vhost[test_desc_no_tags_classic-temp]/ensure: created
Notice: /Stage[main]/Test_rabbitmq::Server::Vhosts/Rabbitmq_vhost[test_tags_and_desc_classic-temp]/ensure: created

And the resulting vhost list:

# rabbitmqctl list_vhosts name,description,default_queue_type,tags -s | grep 'temp'
test_desc_no_tags_classic-temp	Vhost with a description but no tags, default queue type classic	classic	[]
test_desc_no_tags_quorum-temp	Vhost with a description but no tags, default queue type quorum	quorum	[]
test_no_desc_or_tags_classic-temp		classic	[]
test_no_desc_or_tags_quorum-temp		quorum	[]
test_tags_and_desc_classic-temp	Vhost with a description and tags, default queue type classic	classic	[tag1, tag2]
test_desc_no_tags_stream-temp	Vhost with a description but no tags, default queue type stream	stream	[]
test_tags_and_desc_quorum-temp	Vhost with a description and tags, default queue type quorum	quorum	[tag1, tag2]
test_no_desc_or_tags_or_queue_type-temp		undefined	[]
test_tags_and_desc_stream-temp	Vhost with a description and tags, default queue type stream	stream	[tag1, tag2]
test_no_desc_or_tags_stream-temp		stream	[]
test_tags_and_desc_stream_no_queue_type-temp	Vhost with a description and tags, no default queue type	undefined	[tag1, tag2]

Change some tags and default queue types and rerun

Puppet run:

Info: Applying configuration version '6da7560f7d - Wed Dec 6 10:01:34 2023 +1100'
Notice: /Stage[main]/Test_rabbitmq::Server::Vhosts/Rabbitmq_vhost[test_no_desc_or_tags_or_queue_type-temp]/default_queue_type: default_queue_type changed  to 'quorum'
Notice: /Stage[main]/Test_rabbitmq::Server::Vhosts/Rabbitmq_vhost[test_tags_and_desc_stream_no_queue_type-temp]/tags: tags changed ['tag1', 'tag2'] to ['tag1', 'newtag']
Notice: /Stage[main]/Test_rabbitmq::Server::Vhosts/Rabbitmq_vhost[test_tags_and_desc_quorum-temp]/description: description changed 'Vhost with a description and tags, default queue type quorum' to 'Vhost with an amended description and tags, default queue type quorum'

Vhost list:

# rabbitmqctl list_vhosts name,description,default_queue_type,tags -s | grep 'temp'
test_desc_no_tags_classic-temp	Vhost with a description but no tags, default queue type classic	classic	[]
test_desc_no_tags_quorum-temp	Vhost with a description but no tags, default queue type quorum	quorum	[]
test_no_desc_or_tags_classic-temp		classic	[]
test_no_desc_or_tags_quorum-temp		quorum	[]
test_tags_and_desc_classic-temp	Vhost with a description and tags, default queue type classic	classic	[tag1, tag2]
test_desc_no_tags_stream-temp	Vhost with a description but no tags, default queue type stream	stream	[]
test_tags_and_desc_quorum-temp	Vhost with an amended description and tags, default queue type quorum	quorum	[tag1, tag2]
test_no_desc_or_tags_or_queue_type-temp		quorum	[]
test_tags_and_desc_stream-temp	Vhost with a description and tags, default queue type stream	stream	[tag1, tag2]
test_no_desc_or_tags_stream-temp		stream	[]
test_tags_and_desc_stream_no_queue_type-temp	Vhost with a description and tags, no default queue type	undefined	[tag1, newtag

Absent some Vhosts

Puppet run:

Info: Applying configuration version '31ff014b16 - Wed Dec 6 10:01:34 2023 +1100'
Notice: /Stage[main]/Test_rabbitmq::Server::Vhosts/Rabbitmq_vhost[test_no_desc_or_tags_or_queue_type-temp]/ensure: removed
Notice: /Stage[main]/Test_rabbitmq::Server::Vhosts/Rabbitmq_vhost[test_tags_and_desc_stream_no_queue_type-temp]/ensure: removed

Vhost list:

# rabbitmqctl list_vhosts name,description,default_queue_type,tags -s | grep 'temp'
test_desc_no_tags_classic-temp	Vhost with a description but no tags, default queue type classic	classic	[]
test_desc_no_tags_quorum-temp	Vhost with a description but no tags, default queue type quorum	quorum	[]
test_no_desc_or_tags_classic-temp		classic	[]
test_no_desc_or_tags_quorum-temp		quorum	[]
test_tags_and_desc_classic-temp	Vhost with a description and tags, default queue type classic	classic	[tag1, tag2]
test_desc_no_tags_stream-temp	Vhost with a description but no tags, default queue type stream	stream	[]
test_tags_and_desc_quorum-temp	Vhost with an amended description and tags, default queue type quorum	quorum	[tag1, tag2]
test_tags_and_desc_stream-temp	Vhost with a description and tags, default queue type stream	stream	[tag1, tag2]
test_no_desc_or_tags_stream-temp		stream	[]

@jimmybigcommerce jimmybigcommerce marked this pull request as draft November 20, 2023 22:42
@jimmybigcommerce jimmybigcommerce force-pushed the vhost_flag_support branch 7 times, most recently from aa9af1c to 43859b8 Compare November 27, 2023 01:01
@jimmybigcommerce jimmybigcommerce force-pushed the vhost_flag_support branch 14 times, most recently from 63f1af4 to 9f41d56 Compare December 4, 2023 05:17
@wyardley
Copy link
Contributor

wyardley commented Dec 4, 2023

If you get the local setup and pre-commit checks setup, will probably help with some of the roundtrips.
With that current failure about reference.md being outdated, you need to run the rake command to update it after your changes - I think bundle exec rake strings:generate:reference

@jimmybigcommerce jimmybigcommerce force-pushed the vhost_flag_support branch 5 times, most recently from fb9cec9 to f27ac3e Compare December 4, 2023 06:53
@jimmybigcommerce jimmybigcommerce changed the title WIP INFRA-15528 Add support for Vhost metadata WIP Add support for Vhost metadata Dec 4, 2023
@jimmybigcommerce jimmybigcommerce force-pushed the vhost_flag_support branch 16 times, most recently from 5ff4187 to 9632d42 Compare December 6, 2023 05:25
@jimmybigcommerce jimmybigcommerce changed the title WIP Add support for Vhost metadata Add support for Vhost metadata Dec 6, 2023
@jimmybigcommerce jimmybigcommerce marked this pull request as ready for review December 6, 2023 05:52
Copy link
Contributor

@wyardley wyardley 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 to me from what I can see 👍 Thanks for all the hard work on this.

It would be nice to have an acceptance test for this, but I'm guessing the version supported currently doesn't support this feature anyway.

@wyardley wyardley merged commit ce13eb5 into voxpupuli:master Dec 7, 2023
6 checks passed
@jimmybigcommerce
Copy link
Contributor Author

@wyardley Thanks for your help with this mate! Are you cool if I cut a release PR for this? Should it be 13.2.0?

@jimmybigcommerce jimmybigcommerce deleted the vhost_flag_support branch December 7, 2023 23:25
@wyardley
Copy link
Contributor

wyardley commented Dec 8, 2023

Are you cool if I cut a release PR for this? Should it be 13.2.0?

Yes please, and yes. You've tested your recent changes on actual infrastructure, right?

@jimmybigcommerce
Copy link
Contributor Author

jimmybigcommerce commented Dec 8, 2023

Are you cool if I cut a release PR for this? Should it be 13.2.0?

Yes please, and yes. You've tested your recent changes on actual infrastructure, right?

👍 Yes, it's been tested thoroughly on real infra. Once the release is cut, we we roll out everywhere. If we encounter any unforseen issues, I'll immediately create an issue/submit a patch in this repo, however so far it's been rock solid.

@jimmybigcommerce jimmybigcommerce mentioned this pull request Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing support for Vhost Metadata
2 participants