Skip to content

Switch inject-browser-sdk to submodule; consolidate deps#61

Merged
pawelchcki merged 5 commits intomainfrom
pc/submodule-deps
Apr 21, 2026
Merged

Switch inject-browser-sdk to submodule; consolidate deps#61
pawelchcki merged 5 commits intomainfrom
pc/submodule-deps

Conversation

@pawelchcki
Copy link
Copy Markdown
Contributor

@pawelchcki pawelchcki commented Apr 21, 2026

Moving back to submodule for inject-browser-sdk, as this simplifies the setup for running integration tests within a container to satisfy permissions within the container.


FetchContent forced cmake to clone inject-browser-sdk (private repo) at configure time, which broke devcontainer builds with no GitHub credentials. Switch to a submodule (pinned at 49245e1c6ed8) so CI's existing GIT_SUBMODULE_STRATEGY: recursive and local checkouts both work with no extra auth.

While here, move fmt and the RUM wiring into deps/CMakeLists.txt so all third-party setup lives in one place, and simplify fmt.cmake to FetchContent_MakeAvailable now that dd-trace-cpp already forces CMake 3.28.

Copy link
Copy Markdown
Contributor Author

pawelchcki commented Apr 21, 2026

@pawelchcki pawelchcki force-pushed the pc/submodule-deps branch 3 times, most recently from 92f2ff9 to 52d97f8 Compare April 21, 2026 09:55
@pawelchcki pawelchcki changed the base branch from pc/devcontainer to graphite-base/61 April 21, 2026 13:45
@pawelchcki pawelchcki changed the base branch from graphite-base/61 to main April 21, 2026 13:45
@pawelchcki pawelchcki marked this pull request as ready for review April 21, 2026 13:51
@pawelchcki pawelchcki requested a review from a team as a code owner April 21, 2026 13:51
@pawelchcki pawelchcki requested review from Copilot and zacharycmontoya and removed request for a team April 21, 2026 13:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates inject-browser-sdk from FetchContent to a git submodule to avoid configure-time cloning (and credential issues), and consolidates third-party dependency wiring under deps/CMakeLists.txt.

Changes:

  • Add deps/inject-browser-sdk as a git submodule and wire it into the build when HTTPD_DATADOG_ENABLE_RUM is enabled.
  • Move fmt + RUM-related dependency setup out of the top-level CMakeLists.txt into deps/CMakeLists.txt.
  • Simplify cmake/deps/fmt.cmake to use FetchContent_MakeAvailable (and add EXCLUDE_FROM_ALL).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

File Description
deps/CMakeLists.txt Centralizes fmt + RUM dependency setup and adds submodule-based inject-browser-sdk integration.
cmake/deps/fmt.cmake Switches fmt fetching to FetchContent_MakeAvailable and marks it EXCLUDE_FROM_ALL.
CMakeLists.txt Removes top-level fmt and RUM FetchContent wiring (now handled under deps/).
.gitmodules Adds the deps/inject-browser-sdk submodule entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmake/deps/fmt.cmake
Comment thread deps/CMakeLists.txt Outdated
Using FetchContent meant cmake had to clone inject-browser-sdk (a
private repo) at configure time, which broke the devcontainer workflow
because the container has no GitHub credentials. Converting it to a
git submodule reuses the existing mechanism the repo already relies on
for dd-trace-cpp and nginx-datadog — CI initializes it via
GIT_SUBMODULE_STRATEGY: recursive, and local dev gets a checked-out
tree with no extra auth. The submodule is pinned at 49245e1c6ed8, the
previous FetchContent GIT_TAG.

Since deps/CMakeLists.txt already handles dd-trace-cpp and is now
handling inject-browser-sdk too, the top-level CMakeLists.txt's
include(cmake/deps/fmt.cmake) and the HTTPD_DATADOG_ENABLE_RUM block
move into deps/CMakeLists.txt so all third-party wiring lives in one
place.

fmt.cmake itself is simplified to FetchContent_MakeAvailable with
EXCLUDE_FROM_ALL in Declare: both features require CMake 3.14 and 3.28
respectively, and dd-trace-cpp already forces 3.28 as the effective
minimum, so the old manual FetchContent_GetProperties +
FetchContent_Populate + add_subdirectory dance is no longer needed.
- cmake/deps/fmt.cmake: drop the FetchContent_MakeAvailable refactor and
  keep main's Populate + add_subdirectory pattern. The refactor used
  EXCLUDE_FROM_ALL as a FetchContent_Declare keyword, which requires
  CMake 3.28+, but the project advertises 3.12+ in both CMakeLists.txt
  and CONTRIBUTING.md. This revert keeps fmt.cmake identical to main
  and drops an ancillary change that wasn't load-bearing for the
  submodule work.
- deps/CMakeLists.txt: quote the path in the EXISTS check so it
  survives spaces/semicolons (Windows paths, etc.).
checkout with submodules: true tried to clone inject-browser-sdk,
which is a private repo that the default GITHUB_TOKEN can't access,
so the build job failed at checkout before cmake ever ran.

None of the GitHub Actions presets (ci-dev, ci-release) enable
HTTPD_DATADOG_ENABLE_RUM, so inject-browser-sdk is never needed in
these workflows. Drop submodules: true and explicitly init the two
submodules the build actually consumes: deps/dd-trace-cpp and
deps/nginx-datadog.
Comment thread .github/workflows/dev.yml
@datadog-datadog-prod-us1
Copy link
Copy Markdown

datadog-datadog-prod-us1 Bot commented Apr 21, 2026

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

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1330904 | Docs | Datadog PR Page | Give us feedback!

Without access to DataDog/inject-browser-sdk, --init --recursive fails
at clone time. Document the two-submodule command that covers standard
builds and mention --recursive as the RUM-build opt-in.
Copy link
Copy Markdown

@zacharycmontoya zacharycmontoya left a comment

Choose a reason for hiding this comment

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

LGTM, assuming CI passes

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmake/deps/fmt.cmake Outdated
Matches the PR description: dd-trace-cpp already forces CMake 3.28 as
the effective minimum, so the manual FetchContent_GetProperties +
FetchContent_Populate + add_subdirectory dance is no longer needed.
EXCLUDE_FROM_ALL moves onto the Declare() call where MakeAvailable
picks it up in 3.28+.
Copy link
Copy Markdown
Contributor Author

pawelchcki commented Apr 21, 2026

Merge activity

  • Apr 21, 6:42 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 21, 6:42 PM UTC: @pawelchcki merged this pull request with Graphite.

@pawelchcki pawelchcki merged commit 3f08c42 into main Apr 21, 2026
10 checks passed
@pawelchcki pawelchcki deleted the pc/submodule-deps branch April 21, 2026 18:42
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