Skip to content

Harden CI credentials and fix Dependabot submodule failures - #1561

Open
bmehta001 wants to merge 5 commits into
microsoft:mainfrom
bmehta001:harden-ci-credentials
Open

bmehta001 wants to merge 5 commits into
microsoft:mainfrom
bmehta001:harden-ci-credentials

Conversation

@bmehta001

@bmehta001 bmehta001 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Why

Harden CI against credential exposure and fix Dependabot's recursive-clone failures caused by the private modules submodule.

Changes

  • Disable checkout credential persistence except in the SPM release job, which must push its tag, and limit test-vcpkg.yml to contents: read.
  • Stop printing the entire environment in Android/CodeQL jobs, and fail CodeQL and spellcheck if checkout fails.
  • Set .gitmodules lib/modules to update = none so anonymous recursive clones complete; document git submodule update --init --checkout lib/modules for authorized users.
  • Fix two existing CI failures: add the missing integer type include to ICdsFactory.hpp and use atomic shell noclobber in the runner test fixture. Both fixes are also isolated in Fix public-header and runner-contract CI failures #1566 to unblock the private SDK pin first.
  • Remove a stale sanitizer -Wreorder suppression: the SDK-pinned module already initializes those fields in declaration order.

Validation

  • Recursive clones succeeded on Windows and WSL; explicitly checking out the pinned private modules succeeded on Windows.
  • The public-header gate passed with GCC, Clang and MSVC; runner-contract tests passed locally and in CI.
  • The SDK with its exact pinned private modules built with VS 2026; its sanitizer compiled on WSL with both GCC and Clang under -Werror=reorder.
  • Repository CI misspell check and changed-workflow YAML checks passed.
  • The private Android workflow was dispatched against this exact PR revision; both AAR variants included all expected ABIs and the private module symbol.
  • Existing DrMemory jobs still exclude their timing-sensitive SQLite test and BasicFuncTests.killSwitchWorks; this PR does not change those filters.

Coordination

Merge #1566 first, update the private CI's old SDK pin to an approved merged commit and validate it, then merge microsoft/cpp_client_telemetry_modules#375 before this PR. This preserves the private Android AAR when submodule initialization changes.

Both repositories use read-only default workflow tokens and disable Actions PR creation/approval. Existing credentials, including any historical vcpkg publishing token, should be revoked by their owners if still active and no longer needed; the private legacy GIT_PULL_TOKEN must not be deleted until its remaining branch consumers are migrated.

bmehta001 and others added 3 commits November 18, 2026 16:56
actions/checkout writes GITHUB_TOKEN into .git/config by default, so any
later build step, script, or compromised dependency could read it. These
jobs never push, so drop the persisted credential. spm-release.yml keeps it
because it pushes the SPM tag. test-vcpkg.yml also gains an explicit
read-only permissions block so it no longer inherits the repository default.

Files changed:
.github/workflows/build-android.yml
.github/workflows/build-ios-mac.yml
.github/workflows/build-posix-latest.yml
.github/workflows/build-ubuntu-2204.yml
.github/workflows/build-windows-vs2022.yaml
.github/workflows/codeql-analysis.yml
.github/workflows/deploy-docs-pages.yml
.github/workflows/memory-leak-analysis.yml
.github/workflows/spellcheck.yml
.github/workflows/test-embedding.yml
.github/workflows/test-vcpkg.yml
.github/workflows/test-win-latest.yml

Co-authored-by: Copilot <[email protected]>
Copilot-Session: e5009227-6b49-4803-8153-63d8d94037e3
Dependabot clones with --recurse-submodules and cannot access the private
cpp_client_telemetry_modules repository. Git then aborts the submodule
update, leaving third_party/googletest fetched but not checked out. That
dirty submodule makes every Dependabot github_actions update fail when it
tries to commit. Setting update = none for lib/modules lets recursive
clones without access succeed; authorized users fetch it explicitly with
git submodule update --init --checkout lib/modules.

Files changed:
- .gitmodules
- docs/building-with-vcpkg.md
- docs/cpp-start-android.md
- docs/cpp-start-ios.md
- docs/cpp-start-linux.md
- docs/cpp-start-macosx.md
- docs/cpp-start-windows.md
- docs/maintainer-onboarding.md
- docs/xamarin.md

Co-authored-by: Copilot <[email protected]>
Copilot-Session: e5009227-6b49-4803-8153-63d8d94037e3
@bmehta001
bmehta001 requested a review from a team as a code owner November 18, 2026 23:06
@bmehta001 bmehta001 self-assigned this Nov 18, 2026
bmehta001 and others added 2 commits November 18, 2026 17:25
Include the integer type used by the standalone public header, and use an atomic shell noclobber lock in the runner test fixture so concurrent children are distinguished on Ubuntu 26.04.

Files: lib/include/public/ICdsFactory.hpp, tests/build-runner-tests.py

Co-authored-by: Copilot <[email protected]>

Copilot-Session: e5009227-6b49-4803-8153-63d8d94037e3
Stop dumping environment variables, fail CodeQL and spellcheck when checkout fails, and remove a sanitizer warning suppression that the pinned module no longer needs.

Files: .github/workflows/build-android.yml, .github/workflows/codeql-analysis.yml, .github/workflows/spellcheck.yml, lib/CMakeLists.txt.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: e5009227-6b49-4803-8153-63d8d94037e3

This branch has not been deployed

No deployments
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.

1 participant