Skip to content

Allow template names upto 255 chars#6768

Merged
yadvr merged 4 commits into
apache:4.17from
shapeblue:templateNameLength
Sep 30, 2022
Merged

Allow template names upto 255 chars#6768
yadvr merged 4 commits into
apache:4.17from
shapeblue:templateNameLength

Conversation

@DaanHoogland

@DaanHoogland DaanHoogland commented Sep 26, 2022

Copy link
Copy Markdown
Contributor

Description

This PR...

Fixes: #6766

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

registere a template with the name thisIsAVerySmallTemplateWithAnExtremelyLongNameThatIsExcesiveInGivingInformationThatIsEitherUsefulOrUtterlyUselessAboutTheTemplateWhichIsReallyNotBigEnoughToSpendTheNameMiniOn and deployed it.
When deployed stop it
From the Root Volume create a template with the name
thisIsAVerySmallTemplateWithAnExtremelyLongNameThatIsExcesiveInGivingInformationThatIsEitherUsefulOrUtterlyUselessAboutTheTemplateWhichIsReallyNotBigEnoughToSpendTheNameMiniOnEither

The last step would fail in without this fix.

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

Comment thread server/src/main/java/com/cloud/template/TemplateManagerImpl.java Outdated
@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖️ el7 ✖️ el8 ✖️ debian ✖️ suse15. SL-JID 4286

@codecov

codecov Bot commented Sep 26, 2022

Copy link
Copy Markdown

Codecov Report

Merging #6768 (57e0317) into 4.17 (64316d5) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##               4.17    #6768      +/-   ##
============================================
- Coverage     10.34%   10.34%   -0.01%     
  Complexity     6610     6610              
============================================
  Files          2451     2451              
  Lines        242339   242340       +1     
  Branches      37923    37924       +1     
============================================
  Hits          25058    25058              
  Misses       214195   214195              
- Partials       3086     3087       +1     
Impacted Files Coverage Δ
...n/java/com/cloud/template/TemplateManagerImpl.java 11.02% <0.00%> (-0.02%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 4291

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-5030)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 38159 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6768-t5030-kvm-centos7.zip
Smoke tests completed. 101 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@DaanHoogland
DaanHoogland marked this pull request as ready for review September 28, 2022 07:19
@yadvr

yadvr commented Sep 28, 2022

Copy link
Copy Markdown
Member

@DaanHoogland have you checked if there are any DB constraints (see create table rules?) for the column that stores the name (now 255 chars)? If not, then let's merge this.

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@DaanHoogland have you checked if there are any DB constraints (see create table rules?) for the column that stores the name (now 255 chars)? If not, then let's merge this.

@rohityadavcloud for template registration 255 chars are already allowed. This limitation was only there when creating a template from a volume.

@yadvr

yadvr commented Sep 28, 2022

Copy link
Copy Markdown
Member

Ah okay thanks for checking @DaanHoogland

@yadvr yadvr added this to the 4.18.0.0 milestone Sep 28, 2022
String name = cmd.getTemplateName();
if ((name == null) || (name.length() > 32)) {
throw new InvalidParameterValueException("Template name cannot be null and should be less than 32 characters");
if ((name == null) || (name.length() > 255)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

would be good to define a const ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, but that constant would have to be used in more than just this method (also for registiring/editting of a template. That would be a bit beyond the scope of this change.

@DaanHoogland DaanHoogland Sep 29, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

did it anyway, I didn´t implement it in the other APIs though)

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖️ el7 ✖️ el8 ✖️ debian ✖️ suse15. SL-JID 4315

@shwstppr

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

40.0% 40.0% Coverage
0.0% 0.0% Duplication

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 4317

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 4318

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-5052)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 43787 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6768-t5052-kvm-centos7.zip
Smoke tests completed. 101 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@yadvr
yadvr merged commit 89d9a70 into apache:4.17 Sep 30, 2022
@yadvr yadvr modified the milestones: 4.18.0.0, 4.17.2.0 Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants