Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

// Enable DataDog application tracing
const tracer = require('dd-trace').init();
tracer.use('http', {
client: {
// The standardized-skills API rejects Datadog propagation headers on this endpoint.
propagationBlocklist: [/api\.topcoder-dev\.com\/v5\/standardized-skills/]
Comment on lines +9 to +10

Copilot AI Apr 14, 2026

Copy link

Choose a reason for hiding this comment

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

propagationBlocklist is hard-coded to the dev domain (api.topcoder-dev.com). If this service is pointed at a different Topcoder API host (e.g., prod via TOPCODER_API_URL), Datadog propagation headers will still be injected and the crash/400s may persist. Consider matching on the standardized-skills path regardless of host (or deriving the host from configuration and supporting both dev/prod).

Suggested change
// The standardized-skills API rejects Datadog propagation headers on this endpoint.
propagationBlocklist: [/api\.topcoder-dev\.com\/v5\/standardized-skills/]
// The standardized-skills API rejects Datadog propagation headers on this endpoint,
// regardless of which Topcoder API host is configured.
propagationBlocklist: [/\/v5\/standardized-skills(?:\/|$|\?)/]

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@jmgasper there is a point here. We need to capture for prod env too...

}
})

require('./app-bootstrap')

Expand Down
2 changes: 2 additions & 0 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ module.exports = {
PORT: process.env.PORT || 3001,
// used to properly set the header response to api calls for services behind a load balancer
API_BASE_URL: process.env.API_BASE_URL || 'http://localhost:3000',
// used for outbound calls to Topcoder platform APIs
TOPCODER_API_URL: process.env.TOPCODER_API_URL || 'https://api.topcoder-dev.com',

Copilot AI Apr 14, 2026

Copy link

Choose a reason for hiding this comment

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

TOPCODER_API_URL defaults to the dev API domain. Since config/ only contains default.js and test.js, a missing TOPCODER_API_URL env var in a prod deployment would silently route outbound calls to dev. Consider defaulting to the production domain and overriding for dev via env/config, or adding an environment-specific config (e.g., config/production.js/config/development.js) to make the intended target explicit.

Suggested change
TOPCODER_API_URL: process.env.TOPCODER_API_URL || 'https://api.topcoder-dev.com',
TOPCODER_API_URL: process.env.TOPCODER_API_URL || 'https://api.topcoder.com',

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@jmgasper reminder to set this one to ParameterStore in prod & update the ECS task def to pick it up...

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.

Done

API_VERSION: process.env.API_VERSION || 'v5',
AUTH_SECRET: process.env.AUTH_SECRET || 'mysecret',
VALID_ISSUERS: process.env.VALID_ISSUERS ||
Expand Down
2 changes: 2 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
node = "22"
Loading