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: use constants #79

Merged
merged 1 commit into from
Jan 31, 2025
Merged

refactor: use constants #79

merged 1 commit into from
Jan 31, 2025

Conversation

tenthirtyam
Copy link
Contributor

@tenthirtyam tenthirtyam commented Jan 31, 2025

In order to have a good experience with our community, we recommend that you read the contributing guidelines for making a pull request.

Summary of Pull Request

This pull request focuses on centralizing constant values by moving them to the constants package and updating the codebase to use these constants. The main changes include importing the constants package where needed, replacing hard-coded values with constants, and adding new constants for various statuses and configurations.

Centralizing Constants

  • hcx/constants/constants.go: Added new constants for VMC statuses, general statuses, network profiles, locations, compute profiles, SSO provider types, and role mappings.

Updating Imports

Replacing Hard-Coded Values

Minor Improvements

Type of Pull Request

  • This is a bug fix.
  • This is an enhancement or feature.
  • This is a code style/formatting update.
  • This is a documentation update.
  • This is a refactoring update.
  • This is a chore update
  • This is something else.
    Please describe:

Related to Existing Issues

Issue Number: N/A

Test and Documentation Coverage

For bug fixes or features:

  • Tests have been completed.
  • Documentation has been added/updated.

Breaking Changes?

  • Yes, there are breaking changes.
  • No, there are no breaking changes.

@tenthirtyam tenthirtyam added refactor Refactor technical-debt Technical Debt labels Jan 31, 2025
@tenthirtyam tenthirtyam added this to the v0.6.0 milestone Jan 31, 2025
@tenthirtyam tenthirtyam self-assigned this Jan 31, 2025
@github-actions github-actions bot added the needs-review Needs Review label Jan 31, 2025
@tenthirtyam tenthirtyam mentioned this pull request Jan 31, 2025
24 tasks
Copy link

@andybeltz andybeltz 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!

hcx/resource_vmc.go Outdated Show resolved Hide resolved
Applies and update to use constants to avoid repetition.

Signed-off-by: Ryan Johnson <ryan.johnson@broadcom.com>
@tenthirtyam tenthirtyam force-pushed the refactor/use-constants branch from 8f9a2f5 to fde3d12 Compare January 31, 2025 02:52
@tenthirtyam tenthirtyam removed the needs-review Needs Review label Jan 31, 2025
Copy link

@spacegospod spacegospod left a comment

Choose a reason for hiding this comment

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

Found a few time.Sleeps that don't use constants.
You can run a find & replace to check if there are others that may not be visible in this diff

hcx/resource_vcenter.go Show resolved Hide resolved
hcx/resource_site_pairing.go Show resolved Hide resolved
@tenthirtyam tenthirtyam merged commit 0cb25bc into main Jan 31, 2025
4 checks passed
@tenthirtyam tenthirtyam deleted the refactor/use-constants branch January 31, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Refactor technical-debt Technical Debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants