Skip to content

Commit 287673b

Browse files
author
chadcarlson
committed
Dedicated not enterprise.
1 parent 99ba74f commit 287673b

3 files changed

Lines changed: 40 additions & 20 deletions

File tree

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,17 @@ config.inBuild();
6161

6262
config.inRuntime();
6363

64-
config.onEnterprise();
64+
config.onDedicated();
6565

6666
config.onProduction();
6767
```
6868

69+
> **Note:**
70+
>
71+
> Platform.sh will no longer refer to its [99.99% uptime SLA product](https://platform.sh/solutions/) as "Enterprise", but rather as "Dedicated". Configuration Reader libraries have in turn been updated to include an `onDedicated` method to replace `onEnterprise`. For now `onEnterprise` remains available. It now calls the new method and no breaking changes have been introduced.
72+
>
73+
> It is recommended that you update your projects to use `onDedicated` as soon as possible, as `onEnterprise` will be removed in a future version of this library.
74+
6975
### Read environment variables
7076

7177
The following magic properties return the corresponding environment variable value. See the [Platform.sh documentation](https://docs.platform.sh/development/variables.html) for a description of each.

src/platformsh.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,27 @@ class Config {
148148
}
149149

150150
/**
151-
* Determines if the current environment is a Platform.sh Enterprise environment.
151+
* TO BE DEPRECATED: Determines if the current environment is a Platform.sh Enterprise environment.
152+
*
153+
* The Platform.sh "Enterprise" will soon be referred to exclusively as "Dedicated". the `onEnterprise` method
154+
* remains available for now, but it will be removed in a future version of this library.
155+
*
156+
* It is recommended that you update your projects to use `onDedicated` as soon as possible.
152157
*
153158
* @return {boolean}
154-
* True on an Enterprise environment, False otherwise.
159+
* True on an Dedicated environment, False otherwise.
155160
*/
156161
onEnterprise() {
162+
return this.onDedicated();
163+
}
164+
165+
/**
166+
* Determines if the current environment is a Platform.sh Dedicated environment.
167+
*
168+
* @return {boolean}
169+
* True on an Dedicated environment, False otherwise.
170+
*/
171+
onDedicated() {
157172
return this.isValidPlatform() && this._getValue('MODE') === 'enterprise';
158173
}
159174

@@ -613,4 +628,3 @@ module.exports = {
613628
if (process.env.NODE_ENV === 'test') {
614629
module.exports.Config = Config;
615630
}
616-

test/tests.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,41 +92,41 @@ describe("Config tests", () => {
9292
});
9393
});
9494

95-
describe("onEnterprise() tests", () => {
95+
describe("onDedicated() tests", () => {
9696

97-
it('Returns true in enterprise environment', () => {
98-
let mockEnvironmentEnterprise = deepClone(mockEnvironmentRuntime);
99-
mockEnvironmentEnterprise['PLATFORM_MODE'] = 'enterprise';
97+
it('Returns true in Dedicated environment', () => {
98+
let mockEnvironmentDedicated = deepClone(mockEnvironmentRuntime);
99+
mockEnvironmentDedicated['PLATFORM_MODE'] = 'enterprise';
100100

101-
let c = new psh.Config(mockEnvironmentEnterprise);
101+
let c = new psh.Config(mockEnvironmentDedicated);
102102

103-
assert.ok(c.onEnterprise());
103+
assert.ok(c.onDedicated());
104104
});
105105

106106
it('Returns false in standard environment', () => {
107107
let c = new psh.Config(mockEnvironmentRuntime);
108108

109-
assert.ok(!c.onEnterprise());
109+
assert.ok(!c.onDedicated());
110110
});
111111
});
112112

113113
describe("onProduction() tests", () => {
114114

115-
it('Returns true on enterprise production', () => {
116-
let mockEnvironmentEnterprise = deepClone(mockEnvironmentRuntime);
117-
mockEnvironmentEnterprise['PLATFORM_MODE'] = 'enterprise';
118-
mockEnvironmentEnterprise['PLATFORM_BRANCH'] = 'production';
115+
it('Returns true on Dedicated production', () => {
116+
let mockEnvironmentDedicated = deepClone(mockEnvironmentRuntime);
117+
mockEnvironmentDedicated['PLATFORM_MODE'] = 'enterprise';
118+
mockEnvironmentDedicated['PLATFORM_BRANCH'] = 'production';
119119

120-
let c = new psh.Config(mockEnvironmentEnterprise);
120+
let c = new psh.Config(mockEnvironmentDedicated);
121121

122122
assert.ok(c.onProduction());
123123
});
124124

125-
it('Returns false on enterprise staging', () => {
126-
let mockEnvironmentEnterprise = deepClone(mockEnvironmentRuntime);
127-
mockEnvironmentEnterprise['PLATFORM_MODE'] = 'enterprise';
125+
it('Returns false on Dedicated staging', () => {
126+
let mockEnvironmentDedicated = deepClone(mockEnvironmentRuntime);
127+
mockEnvironmentDedicated['PLATFORM_MODE'] = 'enterprise';
128128

129-
let c = new psh.Config(mockEnvironmentEnterprise);
129+
let c = new psh.Config(mockEnvironmentDedicated);
130130

131131
assert.ok(!c.onProduction());
132132
});

0 commit comments

Comments
 (0)