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 enum types to be set to empty string #499

Closed
wants to merge 1 commit into from

Conversation

pietern
Copy link
Contributor

@pietern pietern commented Jun 14, 2023

Changes

The default value of these enum types is an empty string, which means that once set, they cannot be unset. With this change they can always be reverted back to their initial value. This is needed to set/unset flags in the CLI.

Tests

  • make test passing
  • make fmt applied
  • relevant integration tests applied

@pietern pietern requested review from nfx and shreyas-goenka June 14, 2023 10:00
@codecov-commenter
Copy link

Codecov Report

Patch coverage has no change and project coverage change: -0.94 ⚠️

Comparison is base (b5bbc1c) 18.82% compared to head (2d5bb45) 17.89%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #499      +/-   ##
==========================================
- Coverage   18.82%   17.89%   -0.94%     
==========================================
  Files          83       83              
  Lines        9003     9471     +468     
==========================================
  Hits         1695     1695              
- Misses       7160     7628     +468     
  Partials      148      148              
Impacted Files Coverage Δ
service/billing/model.go 0.00% <0.00%> (ø)
service/catalog/model.go 0.00% <0.00%> (ø)
service/compute/model.go 0.00% <0.00%> (ø)
service/iam/model.go 0.00% <0.00%> (ø)
service/jobs/model.go 0.00% <0.00%> (ø)
service/ml/model.go 0.00% <0.00%> (ø)
service/pipelines/model.go 0.00% <0.00%> (ø)
service/provisioning/model.go 0.00% <0.00%> (ø)
service/settings/model.go 0.00% <0.00%> (ø)
service/sharing/model.go 0.00% <0.00%> (ø)
... and 2 more

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

.codegen/model.go.tmpl Show resolved Hide resolved
.codegen/model.go.tmpl Show resolved Hide resolved
@pietern
Copy link
Contributor Author

pietern commented Jun 14, 2023

We have an alternative approach that uses reflection to achieve the same, which appears to work.

We can revisit this if needed.

@pietern pietern closed this Jun 14, 2023
@pietern pietern deleted the allow-enums-to-be-set-to-empty-string branch June 14, 2023 12:10
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.

4 participants