Skip to content

refactor(express): split pingExpress into v1 and v2#8563

Open
rishikeshdadam136 wants to merge 1 commit intomasterfrom
WCI-188
Open

refactor(express): split pingExpress into v1 and v2#8563
rishikeshdadam136 wants to merge 1 commit intomasterfrom
WCI-188

Conversation

@rishikeshdadam136
Copy link
Copy Markdown
Contributor

Ticket: WCI-188

Context - https://bitgo.slack.com/archives/C057BHBRG4B/p1764020095794829?thread_ts=1764018507.602879&cid=C057BHBRG4B

The API behavior is not changing. We are splitting the combined v[12] route into two separate V1 and V2 routes, so both will continue to work and clients will not be affected.

@linear
Copy link
Copy Markdown

linear Bot commented Apr 19, 2026

@rishikeshdadam136 rishikeshdadam136 changed the title docs(express): split pingExpress into v1 and v2 refcactor(express): split pingExpress into v1 and v2 Apr 21, 2026
@rishikeshdadam136 rishikeshdadam136 changed the title refcactor(express): split pingExpress into v1 and v2 refactor(express): split pingExpress into v1 and v2 Apr 22, 2026
@rishikeshdadam136 rishikeshdadam136 requested a deployment to breaking-changes-override April 22, 2026 18:14 — with GitHub Actions Waiting
@rishikeshdadam136 rishikeshdadam136 marked this pull request as ready for review April 23, 2026 06:47
@rishikeshdadam136 rishikeshdadam136 requested review from a team as code owners April 23, 2026 06:47
Comment thread modules/express/src/clientRoutes.ts Outdated
}

function handlePingExpress(req: ExpressApiRouteRequest<'express.pingExpress', 'get'>) {
function handlePingExpress(req: ExpressApiRouteRequest<'express.pingexpress', 'get'>) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

handlePingExpress is wired to both express.v1.pingexpress and express.pingexpress, but the parameter type only mentions express.pingexpress. Update to ExpressApiRouteRequest<'express.v1.pingexpress' | 'express.pingexpress', 'get'> so the type matches both registrations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added it

Comment thread modules/express/src/clientRoutes.ts Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Update comments so it matches the split

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add a minimal test that both GET /api/v1/pingexpress and GET /api/v2/pingexpress resolve and return the expected payload

lokesh-bitgo
lokesh-bitgo previously approved these changes Apr 27, 2026
Copy link
Copy Markdown
Contributor

@lokesh-bitgo lokesh-bitgo left a comment

Choose a reason for hiding this comment

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

Looks good

Comment on lines +6 to +15
* Ping BitGo Express
*
* @operationId express.pingExpress
* @tag express
* Ping bitgo express to ensure that it is still running. Unlike /ping, this does not try connecting to bitgo.com.
*
* @operationId express.pingexpress
* @tag Express
* @public
*/
export const GetPingExpress = httpRoute({
path: '/api/v[12]/pingexpress',
export const GetV2PingExpress = httpRoute({
path: '/api/v2/pingexpress',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Ping BitGo Express
*
* @operationId express.pingExpress
* @tag express
* Ping bitgo express to ensure that it is still running. Unlike /ping, this does not try connecting to bitgo.com.
*
* @operationId express.pingexpress
* @tag Express
* @public
*/
export const GetPingExpress = httpRoute({
path: '/api/v[12]/pingexpress',
export const GetV2PingExpress = httpRoute({
path: '/api/v2/pingexpress',
* Ping BitGo Express
*
* Ping BitGo Express to ensure that it's still running. Unlike [Ping](/reference/expressping), this endpoint doesn't connect to bitgo.com.
*
* @operationId express.pingexpress
* @tag Express
* @public
*/
export const GetV2PingExpress = httpRoute({
path: '/api/v2/pingexpress',

I'm still not sure how does this endpoint differs from /api/v2/ping that we currently instruct clients to use. How does it tell if Express is running?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

/api/v2/ping checks if both Express and BitGo servers are reachable — if BitGo is down, it fails even though Express is fine.

/api/v2/pingexpress only checks if Express itself is running — it never contacts BitGo, so it always returns 200 as long as the Express process is alive.

So when pingexpress returns 200 { "status": "express server is ok!" }, that itself is the proof — the fact that the request was received and responded to means Express is alive and handling requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants