Skip to content

Conversation

@thomas-lebeau
Copy link
Collaborator

@thomas-lebeau thomas-lebeau commented Dec 17, 2025

Motivation

We want to avoid hardcoding the list of datacenter in the release process. This will remove the need for creating a PR for new DCs.

For this we discover the list of DC and their corresponding site using ddtool Runtime Metadata Service.

PR stacked on top of #3973

Changes

  • Refactor a bit to normalize usage of datacenter vs uploadPath and try to make things more clear
  • Added unit tests for deploy-prod-dc script.
  • removed siteByDatacenter in favor of a ddtool command a call to Runtime Metadata Service

Todos

  • install ddtool on the CI (or find another way) used Runtime Metadata Service
  • fix upload-source-maps test failing. for some reason the mock seems to initialize too late

Test instructions

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.

@datadog-official
Copy link

datadog-official bot commented Dec 17, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage
Patch Coverage: 100.00%
Overall Coverage: 77.28% (+0.00%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 2f8cb69 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@thomas-lebeau thomas-lebeau force-pushed the thomas.lebeau/better-release-monitor-check branch from 9e7570b to 247005e Compare December 17, 2025 09:50
@thomas-lebeau thomas-lebeau force-pushed the thomas.lebeau/no-hardcoded-list-of-dc branch 3 times, most recently from 8611867 to 3517742 Compare December 18, 2025 15:28
@cit-pr-commenter
Copy link

cit-pr-commenter bot commented Dec 18, 2025

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 164.29 KiB 164.29 KiB 0 B 0.00%
Rum Profiler 4.33 KiB 4.33 KiB 0 B 0.00%
Rum Recorder 20.01 KiB 20.01 KiB 0 B 0.00%
Logs 56.10 KiB 56.10 KiB 0 B 0.00%
Flagging 944 B 944 B 0 B 0.00%
Rum Slim 121.50 KiB 121.50 KiB 0 B 0.00%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance

Pending...

🧠 Memory Performance

Pending...

🔗 RealWorld

@thomas-lebeau thomas-lebeau force-pushed the thomas.lebeau/better-release-monitor-check branch from f018b53 to 931ed9e Compare December 19, 2025 09:47
@thomas-lebeau thomas-lebeau force-pushed the thomas.lebeau/no-hardcoded-list-of-dc branch from 0dfbe94 to 1f23c10 Compare December 22, 2025 08:30
…tching

Replace the ddtool command-line tool with direct fetch calls to the
runtime-metadata-service API. This enables the scripts to work in CI
environments where ddtool is not available.

Key changes:
- Refactored datacenter.ts to use fetchHandlingError with Vault token
  authentication instead of ddtool command
- Made all datacenter functions async with lazy initialization
- Added comprehensive test coverage for datacenter module
@thomas-lebeau thomas-lebeau marked this pull request as ready for review January 7, 2026 12:48
@thomas-lebeau thomas-lebeau requested a review from a team as a code owner January 7, 2026 12:48
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38ec673ee6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Base automatically changed from thomas.lebeau/better-release-monitor-check to main January 8, 2026 07:57
Comment on lines 35 to 40
let cachedDatacenters: Record<string, Datacenter> | undefined

async function getAllDatacentersMetadata(): Promise<Record<string, Datacenter>> {
if (cachedDatacenters) {
return cachedDatacenters
}
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: calling getAllDatacentersMetadata multiple times synchronously won't leverage the cache.

Suggested change
let cachedDatacenters: Record<string, Datacenter> | undefined
async function getAllDatacentersMetadata(): Promise<Record<string, Datacenter>> {
if (cachedDatacenters) {
return cachedDatacenters
}
let cachedDatacenters: Promise<Record<string, Datacenter>> | undefined
async function getAllDatacentersMetadata(): Promise<Record<string, Datacenter>> {
if (cachedDatacenters) {
return cachedDatacenters
}
cachedDatacenters = fetchDatacentersFromRuntimeMetadataService().then(...)

Comment on lines 150 to 153
return Promise.resolve({
ok: true,
json: () => Promise.resolve({}),
} as unknown as Response)
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: it could be nice to have a createMockResponse function with defaults, like this:

function createMockResopnse({ status = 200, json }: { status?: number, json?: any }) {
    return {
        ok: status < 300,
        status,
        json: () => Promise.resolve(json),
        text: () => Promise.resolve(JSON.stringify(json))
    }
}

Comment on lines 18 to 20
export async function getAllMinorDcs(): Promise<string[]> {
return (await getAllDatacenters()).filter((dc) => !MAJOR_DCS.includes(dc) && !dc.startsWith('pr'))
}
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: maybe introduce something like:

enum DatacenterType {
  // ... what is a minor dc ...
  Minor,
  // ... what is a major dc ..
  Major,
  // ... what is a private region ...
  PrivateRegion
}

return getDatacenterType(name: string) {
  // ...
}

Comment on lines 26 to 29
interface Datacenter {
name: string
site: string
}
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: why not exposing this type more, so we don't need call getSite as much and things would be a bit less async

name could be the shortName, as we never use the full name anywhere?

Also (referring to my previous comment) we could add the type:

Suggested change
interface Datacenter {
name: string
site: string
}
interface Datacenter {
name: string
site: string
type: DatacenterType
}

@thomas-lebeau thomas-lebeau merged commit 9c75f5e into main Jan 14, 2026
21 checks passed
@thomas-lebeau thomas-lebeau deleted the thomas.lebeau/no-hardcoded-list-of-dc branch January 14, 2026 07:00
@github-actions github-actions bot locked and limited conversation to collaborators Jan 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants