Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

feat: Added Azure Naming Service #221

Merged
merged 2 commits into from
Aug 2, 2019
Merged

Conversation

tbarlow12
Copy link
Contributor

  • Add AzureNamingService
  • Move naming utils to naming service
  • Added getSafeResourceName - used by storageAccount and deploymentName

Resolves [AB#597]

@coveralls
Copy link

coveralls commented Jul 31, 2019

Coverage Status

Coverage increased (+0.1%) to 84.311% when pulling 92e8d0f on tabarlow/new-naming-service into 1df392c on dev.

if (suffix) {
name += `-${suffix}`;
}
return name;
Copy link
Contributor

@pjlittle pjlittle Aug 1, 2019

Choose a reason for hiding this comment

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

I can't think of a great reason why, but would we want to .toLowerCase() this, just to normalize? Also, guessing it's unsupported, but has anyone tried extended ascii or double-byte chars?

nvm.. i think this is answered in getSafeResourceName below...

@pjlittle
Copy link
Contributor

pjlittle commented Aug 1, 2019

LGTM - thanks for centralizing this logic and updating across the board 👍

Copy link
Contributor

@mydiemho mydiemho left a comment

Choose a reason for hiding this comment

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

some nit suggestion

@@ -116,8 +123,8 @@ export abstract class BaseService {
*/
protected getArtifactName(deploymentName: string): string {
return `${deploymentName
.replace("rg-deployment", "artifact")
.replace("deployment", "artifact")}.zip`;
.replace(`rg-${configConstants.naming.suffix.deployment}`, configConstants.naming.suffix.artifact)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: extract configConstants.naming.suffix.deployment and configConstants.naming.suffix.artifact into local variables

Copy link
Contributor

@wbreza wbreza left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -43,7 +44,7 @@ export abstract class BaseService {
this.deploymentConfig = this.getDeploymentConfig();
this.deploymentName = this.getDeploymentName();
this.storageAccountName = StorageAccountResource.getResourceName(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can likely just keep this as 1 line now.

@tbarlow12 tbarlow12 force-pushed the tabarlow/new-naming-service branch from 77804a1 to 17a026d Compare August 2, 2019 15:11
@tbarlow12 tbarlow12 force-pushed the tabarlow/new-naming-service branch from 17a026d to 92e8d0f Compare August 2, 2019 15:14
@tbarlow12 tbarlow12 merged commit b0c5ef7 into dev Aug 2, 2019
@tbarlow12 tbarlow12 deleted the tabarlow/new-naming-service branch August 6, 2019 14:58
tbarlow12 added a commit that referenced this pull request Sep 13, 2019
- [x] Add `AzureNamingService`
- [x] Move naming utils to naming service
- [x] Added `getSafeResourceName` - used by `storageAccount` and `deploymentName`

Resolves [AB#597]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants