fabric8-services / fabric8-wit

wit stands for Work Item Tracker
http://devdoc.almighty.io/
Apache License 2.0
45 stars 86 forks source link

Fixup for bbd8f88c789943293680644ae8a49b5342a55575 #2334 #2336

Closed kwk closed 5 years ago

kwk commented 5 years ago

Previously the deployment failed:

failed to overwrite default of old field type with None (string):
failed to set default value of enum type to None (string):
value: None (string) is not part of allowed enum values:
[Done Duplicate Incomplete Description Can not Reproduce Deferred Won't Fix Out of Date Verified]
file: spacetemplate/importer/repository.go
line: 91

We've updated the resolution enum to have a new value and that is also the new default. That new value didn't exist in the old enum type but we tried to make it the new default for the old type anyways. That didn't work because the FieldType.SetDefault() implementation for enums checks if the given value is part of the allowed enum values.

The overall intention is to check if too enums are the same but ignore the default value. That is why we temporarily make both defaults the same before we call FieldType.Equal().

With this change we simply reverse the assignment of the new default to the old type. Instead we temporarily assign the old default to the new type. The result is that a call to FieldType.Equal() will return true.

alien-ike commented 5 years ago

Ike Plugins (test-keeper)

Thank you @kwk for this contribution!

It seems that this PR already contains some added or changed tests. Good job!

For more information please head over to official documentation. You can find there how to configure the plugin.

codecov[bot] commented 5 years ago

Codecov Report

Merging #2336 into master will not change coverage. The diff coverage is 80%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2336   +/-   ##
=======================================
  Coverage   70.17%   70.17%           
=======================================
  Files         171      171           
  Lines       16625    16625           
=======================================
  Hits        11666    11666           
  Misses       3829     3829           
  Partials     1130     1130
Impacted Files Coverage Δ
spacetemplate/importer/repository.go 73.33% <80%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bbd8f88...3502342. Read the comment docs.

codecov-io commented 5 years ago

Codecov Report

Merging #2336 into master will not change coverage. The diff coverage is 80%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2336   +/-   ##
=======================================
  Coverage   70.17%   70.17%           
=======================================
  Files         171      171           
  Lines       16625    16625           
=======================================
  Hits        11666    11666           
  Misses       3829     3829           
  Partials     1130     1130
Impacted Files Coverage Δ
spacetemplate/importer/repository.go 73.33% <80%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bbd8f88...b663508. Read the comment docs.