Adding New Endpoints

1. Adding to HubCommon#

  1. Create a new branch for your modification;

  2. Add any necessary API endpoints to HubCommon/src/constants/endpoints.js and create a commit. When adding it, please maintain the indentation and the alphabetical order. Note that we have the int suffix here (as an initial suffix);

MyNewApi : 'https://newapiurlint.iqmetrix.net',
  1. Create a Pull Request (PR) to merge the changes and ask someone to take a look before (it doesn't need to be a Hub team member)

  2. When merged, execute gulp bump to generate a new version of HubCommon and commit. Execute the following command to complete the change:

git push && git push –tags

2. Adding to BuildScripts.Common (if you are using TeamCity)#

The scripts will handle the url changing for the new endpoint according to with the environment (int, rc, prod), for this end, you need to modify the BuildScripts.Common and the Buildscripts.Hub. Create your own branch before any modification in these repositories. After you create them, go through the following steps:

  1. Create your service on https://github.com/iQmetrix/BuildScripts.Common/blob/master/config/default.yml. Go in the services inside of tokens. Here you will not put suffixes. Remember the service name because you will need it later.

Example: new_service: https://newapiurl{url_suffix}.iqmetrix.net

  1. If you need environment specific endpoints/suffixes, then change that per environment. You can find all the environments in https://github.com/iQmetrix/BuildScripts.Common/tree/master/config. They are: int.yml, rc.yml, and prod.yml.

  2. Then, do the same in Buildscripts.Hub in https://github.com/iQmetrix/BuildScripts.Hub/tree/master/config. Buildscripts.Common gives the common information while Buildscripts.Hub is what actually ends up editing the Endpoints.js file.

  3. Create a PR for the Buildscripts.Common and Buildscripts.Hubrepository. The role responsible to release it is the Build & Release Pipeline Developer (https://app.glassfrog.com/roles/9911273) and right now, you can tag @seanb to review it. Once it is merged, a new version of the scripts will be generated, and you will need to execute bower update and bundle update to access the new endpoint (in the case of v1 apps)

Last updated on by Paulo Andrade