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

Optionally allow specifying 0:n target apps for domain service #39

Merged
merged 4 commits into from
May 13, 2024

Conversation

rahearn
Copy link
Contributor

@rahearn rahearn commented May 8, 2024

Closes #12

Created this as a draft to get feedback on while also testing the upgrade path with a real app.

@rahearn rahearn requested a review from mogul May 8, 2024 19:26
Copy link
Contributor

@mogul mogul 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 approving, but I don't think the trade-off between the single/plural variable options is clear from the documentation strings. As it is, they say that the singular version has primacy, but I think that should be reversed... I think if you say that the singular one is deprecated and the plural one is new and supported going forward, then it's more obvious that the deprecated single method is a subset of what you can do with the new plural method. (It doesn't change the backward compatibility test that you have at main.tf:4; folks not ready to use the new var will still have a non-null value for the singular variable so nothing will break for them... though we should see if there's a way to warn them about the deprecation if they're using it).

domain/variables.tf Outdated Show resolved Hide resolved
domain/variables.tf Outdated Show resolved Hide resolved
@rahearn rahearn requested a review from anna-m-gsa May 9, 2024 12:59
@rahearn
Copy link
Contributor Author

rahearn commented May 9, 2024

though we should see if there's a way to warn them about the deprecation if they're using it

I'm not yet convinced that this should be a deprecation. I think specifying 0 or 1 app is the obvious benefit, and specifying more than 1 is a very niche behavior that I'm not convinced anyone is actually using. The docs say it's for load balancing, but 99% of cases load balancing would be done via horizontal scaling of a single app, not by adding additional apps to your route.

Given that, I don't love forcing everyone to remember that they have to pass that option as an array moving forward.

@mogul
Copy link
Contributor

mogul commented May 9, 2024

Right, I was going to suggest that the default behavior and documented example would just be to pass an array, even if it just has the one app in it. If you don't agree, then it's just a matter of taste. I'm not overseeing any projects using this module, so I certainly defer to you!

@rahearn
Copy link
Contributor Author

rahearn commented May 9, 2024

default behavior and documented example would just be to pass an array

I think that's what I'd do if I was writing the module from scratch today, but since it's niche behavior and we have existing users I think I'll stick with supporting the singular version as preferred. We can always revisit that decision in the future and deprecate/remove at that point.

@mogul
Copy link
Contributor

mogul commented May 9, 2024

Sounds good to me!

@rahearn rahearn marked this pull request as ready for review May 13, 2024 16:40
@rahearn rahearn merged commit e0f0e22 into main May 13, 2024
12 checks passed
@rahearn rahearn deleted the domain-0-n-apps branch May 13, 2024 16:40
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.

domain module should expect 0:n apps
3 participants