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

Refactor module_utils/elbv2 listeners and rules comparison #1981

Closed
1 task done
hakbailey opened this issue Feb 20, 2024 · 0 comments · Fixed by #2050
Closed
1 task done

Refactor module_utils/elbv2 listeners and rules comparison #1981

hakbailey opened this issue Feb 20, 2024 · 0 comments · Fixed by #2050
Milestone

Comments

@hakbailey
Copy link
Contributor

Summary

Note: this is not really a new feature but I wanted to create an issue for this work so we can track it.

The elbv2 logic around comparing listeners and listener rules is quite complex, which is unsurprising as the AWS logic is also complex. However, as it is currently written it's very difficult to understand what each of these comparisons is doing. In some cases, methods have been updated over time to fix bugs but the method names and docstrings haven't changed. This makes it prone to errors (see #1877, #1284) and difficult to review new bugfixes. I propose we refactor this with an eye to making our code easier to understand, in particular:

  • Documenting what is the AWS logic/requirements we are trying to enforce when creating or modifying a listener/rule (note that the requirements for creating vs. modifying are not the same).
  • Ensuring that methods/functions have type hints so it's clear what a given method returns.
  • Adding documentation to each method to clarify what it does.
  • Thinking about whether we can break any of these methods down into smaller, more discrete comparison methods with simpler tests.
  • Ensuring we have unit tests covering all the logic we are trying to enforce.

Issue Type

Feature Idea

Component Name

module_utils/elbv2

Additional Information

Refactoring this code would make it easier to maintain, as it is currently challenging to understand and modify.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@tremble tremble added this to the 8.0.0 milestone Feb 21, 2024
softwarefactory-project-zuul bot pushed a commit that referenced this issue Jun 11, 2024
Code refactoring - module_utils/elbv2

SUMMARY

closes #1981

ISSUE TYPE


Feature Pull Request

Reviewed-by: Helen Bailey <[email protected]>
Reviewed-by: Bikouo Aubin
Reviewed-by: Alina Buzachis
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this issue Jun 26, 2024
Code refactoring - module_utils/elbv2

SUMMARY

closes ansible-collections#1981

ISSUE TYPE


Feature Pull Request

Reviewed-by: Helen Bailey <[email protected]>
Reviewed-by: Bikouo Aubin
Reviewed-by: Alina Buzachis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants