Adding New Endpoints
#
1. Adding to HubCommonCreate a new branch for your modification;
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);
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)
When merged, execute
gulp bump
to generate a new version of HubCommon and commit. Execute the following command to complete the change:
#
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:
- Create your service on https://github.com/iQmetrix/BuildScripts.Common/blob/master/config/default.yml. Go in the
services
inside oftokens
. 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
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
, andprod.yml
.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.Create a PR for the
Buildscripts.Common
andBuildscripts.Hub
repository. The role responsible to release it is theBuild & 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)