-
Notifications
You must be signed in to change notification settings - Fork 191
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
Increase target name to 128 and target controller id to 256 #849
Changes from 4 commits
5472223
58ef4cc
4d9bd78
853c119
1fde5a0
4700f5b
07a8c4c
70b5ad4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
ALTER TABLE sp_distribution_set ALTER COLUMN name SET DATA TYPE VARCHAR(128); | ||
ALTER TABLE sp_distribution_set_type ALTER COLUMN name SET DATA TYPE VARCHAR(128); | ||
ALTER TABLE sp_distributionset_tag ALTER COLUMN name SET DATA TYPE VARCHAR(128); | ||
ALTER TABLE sp_base_software_module ALTER COLUMN name SET DATA TYPE VARCHAR(128); | ||
ALTER TABLE sp_rollout ALTER COLUMN name SET DATA TYPE VARCHAR(128); | ||
ALTER TABLE sp_rolloutgroup ALTER COLUMN name SET DATA TYPE VARCHAR(128); | ||
ALTER TABLE sp_software_module_type ALTER COLUMN name SET DATA TYPE VARCHAR(128); | ||
ALTER TABLE sp_target ALTER COLUMN name SET DATA TYPE VARCHAR(128); | ||
ALTER TABLE sp_target_filter_query ALTER COLUMN name SET DATA TYPE VARCHAR(128); | ||
ALTER TABLE sp_target_tag ALTER COLUMN name SET DATA TYPE VARCHAR(128); | ||
|
||
|
||
ALTER TABLE sp_target ALTER COLUMN controller_id SET DATA TYPE VARCHAR(256); | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
ALTER TABLE sp_distribution_set ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_distribution_set_type ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_distributionset_tag ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_base_software_module ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_rollout ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_rolloutgroup ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_software_module_type ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_target ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_target_filter_query ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_target_tag ALTER COLUMN name VARCHAR(128); | ||
|
||
|
||
ALTER TABLE sp_target ALTER COLUMN controller_id VARCHAR(256); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add new line at the end of this file, for github |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
ALTER TABLE sp_distribution_set MODIFY name VARCHAR(128); | ||
ALTER TABLE sp_distribution_set_type MODIFY name VARCHAR(128); | ||
ALTER TABLE sp_distributionset_tag MODIFY name VARCHAR(128); | ||
ALTER TABLE sp_base_software_module MODIFY name VARCHAR(128); | ||
ALTER TABLE sp_rollout MODIFY name VARCHAR(128); | ||
ALTER TABLE sp_rolloutgroup MODIFY name VARCHAR(128); | ||
ALTER TABLE sp_software_module_type MODIFY name VARCHAR(128); | ||
ALTER TABLE sp_target MODIFY name VARCHAR(128); | ||
ALTER TABLE sp_target_filter_query MODIFY name VARCHAR(128); | ||
ALTER TABLE sp_target_tag MODIFY name VARCHAR(128); | ||
|
||
|
||
ALTER TABLE sp_target MODIFY controller_id VARCHAR(256); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add new line at the end of this file, for github |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
ALTER TABLE sp_distribution_set ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_distribution_set_type ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_distributionset_tag ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_base_software_module ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_rollout ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_rolloutgroup ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_software_module_type ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_target ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_target_filter_query ALTER COLUMN name VARCHAR(128); | ||
ALTER TABLE sp_target_tag ALTER COLUMN name VARCHAR(128); | ||
|
||
|
||
ALTER TABLE sp_target ALTER COLUMN controller_id VARCHAR(256); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add new line at the end of this file, for github |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ | |
import org.eclipse.hawkbit.repository.model.DistributionSetTag; | ||
import org.eclipse.hawkbit.repository.model.DistributionSetType; | ||
import org.eclipse.hawkbit.repository.model.MetaData; | ||
import org.eclipse.hawkbit.repository.model.NamedEntity; | ||
import org.eclipse.hawkbit.repository.model.SoftwareModule; | ||
import org.eclipse.hawkbit.repository.model.Target; | ||
import org.eclipse.hawkbit.repository.test.matcher.Expect; | ||
|
@@ -218,7 +219,7 @@ private void createAndUpdateDistributionSetWithInvalidName(final DistributionSet | |
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
.isThrownBy(() -> distributionSetManagement.create(entityFactory.distributionSet().create().version("a") | ||
.name(RandomStringUtils.randomAlphanumeric(65)))) | ||
.name(RandomStringUtils.randomAlphanumeric(NamedEntity.NAME_MAX_SIZE + 1)))) | ||
.as("entity with too long name should not be created"); | ||
|
||
assertThatExceptionOfType(ConstraintViolationException.class).isThrownBy( | ||
|
@@ -232,7 +233,7 @@ private void createAndUpdateDistributionSetWithInvalidName(final DistributionSet | |
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
.isThrownBy(() -> distributionSetManagement.update(entityFactory.distributionSet().update(set.getId()) | ||
.name(RandomStringUtils.randomAlphanumeric(65)))) | ||
.name(RandomStringUtils.randomAlphanumeric(NamedEntity.NAME_MAX_SIZE + 1)))) | ||
.as("entity with too long name should not be updated"); | ||
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
|
@@ -251,7 +252,7 @@ private void createAndUpdateDistributionSetWithInvalidVersion(final Distribution | |
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
.isThrownBy(() -> distributionSetManagement.create(entityFactory.distributionSet().create().name("a") | ||
.version(RandomStringUtils.randomAlphanumeric(65)))) | ||
.version(RandomStringUtils.randomAlphanumeric(NamedEntity.NAME_MAX_SIZE + 1)))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wrong field is being tested here, should be |
||
.as("entity with too long name should not be created"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you please fix the assertion error message, |
||
|
||
assertThatExceptionOfType(ConstraintViolationException.class).isThrownBy( | ||
|
@@ -260,7 +261,7 @@ private void createAndUpdateDistributionSetWithInvalidVersion(final Distribution | |
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
.isThrownBy(() -> distributionSetManagement.update(entityFactory.distributionSet().update(set.getId()) | ||
.version(RandomStringUtils.randomAlphanumeric(65)))) | ||
.version(RandomStringUtils.randomAlphanumeric(NamedEntity.NAME_MAX_SIZE + 1)))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wrong field is being tested here, should be |
||
.as("entity with too long name should not be updated"); | ||
|
||
assertThatExceptionOfType(ConstraintViolationException.class).isThrownBy( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ | |
import org.eclipse.hawkbit.repository.jpa.model.JpaDistributionSetType; | ||
import org.eclipse.hawkbit.repository.model.DistributionSet; | ||
import org.eclipse.hawkbit.repository.model.DistributionSetType; | ||
import org.eclipse.hawkbit.repository.model.NamedEntity; | ||
import org.eclipse.hawkbit.repository.test.matcher.Expect; | ||
import org.eclipse.hawkbit.repository.test.matcher.ExpectEvents; | ||
import org.junit.Test; | ||
|
@@ -128,7 +129,7 @@ private void createAndUpdateDistributionSetWithInvalidName(final DistributionSet | |
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
.isThrownBy(() -> distributionSetManagement.create(entityFactory.distributionSet().create().version("a") | ||
.name(RandomStringUtils.randomAlphanumeric(65)))) | ||
.name(RandomStringUtils.randomAlphanumeric(NamedEntity.NAME_MAX_SIZE + 1)))) | ||
.as("set with too long name should not be created"); | ||
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
|
@@ -147,7 +148,7 @@ private void createAndUpdateDistributionSetWithInvalidName(final DistributionSet | |
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
.isThrownBy(() -> distributionSetManagement.update(entityFactory.distributionSet().update(set.getId()) | ||
.name(RandomStringUtils.randomAlphanumeric(65)))) | ||
.name(RandomStringUtils.randomAlphanumeric(NamedEntity.NAME_MAX_SIZE + 1)))) | ||
.as("set with too long name should not be updated"); | ||
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
|
@@ -165,7 +166,7 @@ private void createAndUpdateDistributionSetWithInvalidVersion(final Distribution | |
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
.isThrownBy(() -> distributionSetManagement.create(entityFactory.distributionSet().create().name("a") | ||
.version(RandomStringUtils.randomAlphanumeric(65)))) | ||
.version(RandomStringUtils.randomAlphanumeric(NamedEntity.NAME_MAX_SIZE + 1)))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wrong field is being tested here, should be |
||
.as("set with too long version should not be created"); | ||
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
|
@@ -184,7 +185,7 @@ private void createAndUpdateDistributionSetWithInvalidVersion(final Distribution | |
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
.isThrownBy(() -> distributionSetManagement.update(entityFactory.distributionSet().update(set.getId()) | ||
.version(RandomStringUtils.randomAlphanumeric(65)))) | ||
.version(RandomStringUtils.randomAlphanumeric(NamedEntity.NAME_MAX_SIZE + 1)))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wrong field is being tested here, should be |
||
.as("set with too long version should not be updated"); | ||
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,7 @@ | |
import org.eclipse.hawkbit.repository.model.DistributionSet; | ||
import org.eclipse.hawkbit.repository.model.DistributionSetAssignmentResult; | ||
import org.eclipse.hawkbit.repository.model.MetaData; | ||
import org.eclipse.hawkbit.repository.model.NamedEntity; | ||
import org.eclipse.hawkbit.repository.model.Tag; | ||
import org.eclipse.hawkbit.repository.model.Target; | ||
import org.eclipse.hawkbit.repository.model.TargetMetadata; | ||
|
@@ -251,7 +252,7 @@ private void createAndUpdateTargetWithInvalidName(final Target target) { | |
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
.isThrownBy(() -> targetManagement.create(entityFactory.target().create().controllerId("a") | ||
.name(RandomStringUtils.randomAlphanumeric(65)))) | ||
.name(RandomStringUtils.randomAlphanumeric(NamedEntity.NAME_MAX_SIZE + 1)))) | ||
.as("target with too long name should not be created"); | ||
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
|
@@ -261,7 +262,7 @@ private void createAndUpdateTargetWithInvalidName(final Target target) { | |
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
.isThrownBy(() -> targetManagement.update(entityFactory.target().update(target.getControllerId()) | ||
.name(RandomStringUtils.randomAlphanumeric(65)))) | ||
.name(RandomStringUtils.randomAlphanumeric(NamedEntity.NAME_MAX_SIZE + 1)))) | ||
.as("target with too long name should not be updated"); | ||
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
|
@@ -281,7 +282,7 @@ private void createAndUpdateTargetWithInvalidSecurityToken(final Target target) | |
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
.isThrownBy(() -> targetManagement.create(entityFactory.target().create().controllerId("a") | ||
.securityToken(RandomStringUtils.randomAlphanumeric(129)))) | ||
.securityToken(RandomStringUtils.randomAlphanumeric(NamedEntity.NAME_MAX_SIZE + 1)))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wrong field is being tested here, should be |
||
.as("target with too long token should not be created"); | ||
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
|
@@ -291,7 +292,7 @@ private void createAndUpdateTargetWithInvalidSecurityToken(final Target target) | |
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
.isThrownBy(() -> targetManagement.update(entityFactory.target().update(target.getControllerId()) | ||
.securityToken(RandomStringUtils.randomAlphanumeric(129)))) | ||
.securityToken(RandomStringUtils.randomAlphanumeric(NamedEntity.NAME_MAX_SIZE + 1)))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wrong field is being tested here, should be |
||
.as("target with too long token should not be updated"); | ||
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
|
@@ -340,8 +341,8 @@ private void createTargetWithInvalidControllerId() { | |
.as("target with null controller id should not be created"); | ||
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
.isThrownBy(() -> targetManagement | ||
.create(entityFactory.target().create().controllerId(RandomStringUtils.randomAlphanumeric(65)))) | ||
.isThrownBy(() -> targetManagement.create(entityFactory.target().create() | ||
.controllerId(RandomStringUtils.randomAlphanumeric(Target.CONTROLLER_ID_MAX_SIZE + 1)))) | ||
.as("target with too long controller id should not be created"); | ||
|
||
assertThatExceptionOfType(ConstraintViolationException.class) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add new line at the end of this file, for github