Skip to content

Commit

Permalink
Feature flag for Self Service portal
Browse files Browse the repository at this point in the history
Protect server and client self service feature with flag

closes #1242

Co-authored-by: tangoyankee <[email protected]>
  • Loading branch information
horatiorosa and TangoYankee committed Sep 24, 2024
1 parent 0a12cc4 commit 0143a9a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
team: ${{secrets.HEROKU_TEAM}}
appdir: server
env:
HD_FEATURE_FLAG_SELF_SERVICE: ${{ vars.FEATURE_FLAG_SELF_SERVICE }}
HD_ADO_PRINCIPAL: ${{ secrets.ADO_PRINCIPAL }}
HD_AUTHORITY_HOST_URL: ${{ secrets.AUTHORITY_HOST_URL }}
HD_CITYPAY_AGENCYID: ${{ secrets.CITYPAY_AGENCYID }}
Expand Down Expand Up @@ -91,6 +92,7 @@ jobs:
url: https://applicants.planninglabs.nyc
runs-on: ubuntu-latest
env:
FEATURE_FLAG_SELF_SERVICE: ${{ vars.FEATURE_FLAG_SELF_SERVICE }}
HOST: ${{ vars.ZAP_API_HOST }}
MAINTENANCE_START: ${{ vars.MAINTENANCE_START }}
MAINTENANCE_END: ${{ vars.MAINTENANCE_END }}
Expand Down Expand Up @@ -130,6 +132,7 @@ jobs:
url: https://applicants.planning.nyc.gov
runs-on: ubuntu-latest
env:
FEATURE_FLAG_SELF_SERVICE: ${{ vars.FEATURE_FLAG_SELF_SERVICE }}
HOST: ${{ vars.ZAP_API_HOST }}
MAINTENANCE_START: ${{ vars.MAINTENANCE_START }}
MAINTENANCE_END: ${{ vars.MAINTENANCE_END }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
team: ${{secrets.HEROKU_TEAM}}
appdir: server
env:
HD_FEATURE_FLAG_SELF_SERVICE: ${{ vars.FEATURE_FLAG_SELF_SERVICE }}
HD_ADO_PRINCIPAL: ${{ secrets.ADO_PRINCIPAL }}
HD_AUTHORITY_HOST_URL: ${{ secrets.AUTHORITY_HOST_URL }}
HD_CITYPAY_AGENCYID: ${{ secrets.CITYPAY_AGENCYID }}
Expand Down Expand Up @@ -87,6 +88,7 @@ jobs:
url: https://qa.applicant-portal.planninglabs.nyc
runs-on: ubuntu-latest
env:
FEATURE_FLAG_SELF_SERVICE: ${{ vars.FEATURE_FLAG_SELF_SERVICE }}
HOST: ${{ vars.ZAP_API_HOST }}
MAINTENANCE_START: ${{ vars.MAINTENANCE_START }}
MAINTENANCE_END: ${{ vars.MAINTENANCE_END }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
team: ${{ secrets.HEROKU_TEAM }}
appdir: server
env:
HD_FEATURE_FLAG_SELF_SERVICE: ${{ vars.FEATURE_FLAG_SELF_SERVICE }}
HD_ADO_PRINCIPAL: ${{ secrets.ADO_PRINCIPAL }}
HD_AUTHORITY_HOST_URL: ${{ secrets.AUTHORITY_HOST_URL }}
HD_CLIENT_ID: ${{ secrets.CLIENT_ID }}
Expand Down Expand Up @@ -78,6 +79,7 @@ jobs:
url: https://staging.applicant-portal.planninglabs.nyc
runs-on: ubuntu-latest
env:
FEATURE_FLAG_SELF_SERVICE: ${{ vars.FEATURE_FLAG_SELF_SERVICE }}
HOST: ${{ vars.ZAP_API_HOST }}
MAINTENANCE_START: ${{ vars.MAINTENANCE_START }}
MAINTENANCE_END: ${{ vars.MAINTENANCE_END }}
Expand Down
26 changes: 16 additions & 10 deletions client/config/environment.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
module.exports = function(environment) {
const ENV = {
modulePrefix: 'client',
modulePrefix: "client",

Check failure on line 3 in client/config/environment.js

View workflow job for this annotation

GitHub Actions / 🧪 Test client code

Strings must use singlequote
environment,
rootURL: '/',
locationType: 'auto',
rootURL: "/",

Check failure on line 5 in client/config/environment.js

View workflow job for this annotation

GitHub Actions / 🧪 Test client code

Strings must use singlequote
locationType: "auto",

Check failure on line 6 in client/config/environment.js

View workflow job for this annotation

GitHub Actions / 🧪 Test client code

Strings must use singlequote
host: getHost(environment),
NYCIDDomain: getOAuthDomain(environment),
NYCIDLocation: getOAuthLoginEndpoint(environment),
maintenanceTimes: getMaintenanceTimes(),
featureFlagSelfService: getFeatureFlagSelfService(),

EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
Expand All @@ -20,9 +22,9 @@ module.exports = function(environment) {
},
fontawesome: {
icons: {
'free-brands-svg-icons': 'all',
'free-regular-svg-icons': 'all',
'free-solid-svg-icons': 'all',
"free-brands-svg-icons": "all",

Check failure on line 25 in client/config/environment.js

View workflow job for this annotation

GitHub Actions / 🧪 Test client code

Strings must use singlequote

Check failure on line 25 in client/config/environment.js

View workflow job for this annotation

GitHub Actions / 🧪 Test client code

Strings must use singlequote
"free-regular-svg-icons": "all",

Check failure on line 26 in client/config/environment.js

View workflow job for this annotation

GitHub Actions / 🧪 Test client code

Strings must use singlequote

Check failure on line 26 in client/config/environment.js

View workflow job for this annotation

GitHub Actions / 🧪 Test client code

Strings must use singlequote
"free-solid-svg-icons": "all",

Check failure on line 27 in client/config/environment.js

View workflow job for this annotation

GitHub Actions / 🧪 Test client code

Strings must use singlequote

Check failure on line 27 in client/config/environment.js

View workflow job for this annotation

GitHub Actions / 🧪 Test client code

Strings must use singlequote
},
},

Expand All @@ -31,10 +33,10 @@ module.exports = function(environment) {
// when it is created
},

'labs-search': {
host: 'https://search-api-production.herokuapp.com',
route: 'search',
helpers: ['geosearch-v2', 'bbl'],
"labs-search": {

Check failure on line 36 in client/config/environment.js

View workflow job for this annotation

GitHub Actions / 🧪 Test client code

Strings must use singlequote
host: "https://search-api-production.herokuapp.com",
route: "search",
helpers: ["geosearch-v2", "bbl"],
},
};

Expand Down Expand Up @@ -139,3 +141,7 @@ function getMaintenanceTimes() {

return [MAINTENANCE_START, MAINTENANCE_END];
}

function getFeatureFlagSelfService() {
return process.env.FEATURE_FLAG_SELF_SERVICE === "ON";
}
6 changes: 6 additions & 0 deletions server/src/config/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@ export class ConfigService {
get(key: string): any {
return this.envConfig[key];
}

get featureFlag() {
return {
selfService: this.envConfig["FEATURE_FLAG_SELF_SERVICE"] === "ON"
}
}
}

0 comments on commit 0143a9a

Please sign in to comment.