Skip to content

[13/14] Guide multi-framework GitHub Actions onboarding - #146

Open
anmarchenko wants to merge 3 commits into
anmarchenko/onboarding-12-rubyfrom
anmarchenko/onboarding-13-onboarding
Open

anmarchenko wants to merge 3 commits into
anmarchenko/onboarding-12-rubyfrom
anmarchenko/onboarding-13-onboarding

Conversation

@anmarchenko

@anmarchenko anmarchenko commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

What

Expose ddtest onboard with read-only workflow discovery, framework-specific GitHub Actions guidance selecting the latest tracer and a human credential handoff for all nine supported frameworks. Use the shared read-only DetectPlatform/DetectFramework APIs directly, without a separate test-project detector or flag-selection wrapper. Link the root help to onboarding and exercise onboard before testdrive in the public integration fixtures.

Part 13/14 of the replacement stack for #128. Review against #145, this PR's base. Next: #147.

Why

Customers and coding agents need a clear path from repository detection through local verification to CI setup.

E2E testing

Use this PR’s checkout or its prerelease. When building from source, use Go 1.27.1 (as pinned in go.mod) and run go build -o /tmp/ddtest-qa . from the DDTest root. Commands below use /tmp/ddtest-qa.

Prerequisites: disposable Git repositories covering all nine supported frameworks, installed test dependencies, and sample .github/workflows/*.yml files. Include a workflow with separate lint/test jobs and a repository with multiple test frameworks. Record a clean Git status and manifest/workflow checksums.

  1. Run /tmp/ddtest-qa --help: expect onboarding to be discoverable. Run /tmp/ddtest-qa onboard in each single-framework project. Expect the detected framework, relevant workflow/job, matching setup instructions, and the human credential handoff; no files should change.
  2. In a mixed-framework repository, run without hints: expect a selection diagnostic. Repeat with --framework for each runner and verify its corresponding instructions. Add a Datadog action to a different job and repeat: inspect the resulting guidance against the actual test job’s setup.
  3. Remove workflows and repeat. Expect a clear diagnostic that no GitHub Actions test workflow was found, with no file changes. Add an unrelated lint workflow: it must not be presented as proof of configured test instrumentation.
  4. From a fresh project, manually follow the printed setup instructions on a temporary QA branch, supplying QA credentials through GitHub secrets. Run the suggested GitHub Actions job. Expect the intended tests and instrumentation to run; inspect received tests in the QA Datadog account. Never put secret values in the PR or repository.
  5. Run the local /tmp/ddtest-qa testdrive --yes flow with no Datadog credentials/Agent. Expect local events and a report; a deliberately failing assertion must still produce a report and a nonzero exit status.
  6. Compare the pre-onboard checksums to the immediate post-onboard state (before manual edits): they must match. Remove temporary QA branches/workflows, secrets created only for this exercise, projects, and sessions.

Inspect each generated action example: its language-specific tracer-version input must be an explicitly empty string, overriding the action's pinned default. Follow that example and verify the installed tracer is the latest available release; Python and Ruby must not receive a literal latest version constraint.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-22T11:24:45.709723Z ccace88 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Copy link
Copy Markdown

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: ccace882ef

ℹ️ 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".

Comment thread internal/onboard/onboard.go Outdated
Comment on lines +96 to +97
if strings.Contains(text, githubAction) {
configured = append(configured, relativePath)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Track GitHub Action setup per test job

When one workflow file contains multiple test jobs and only one job uses the Datadog action, this file-level substring check marks the entire workflow as configured. Because RunWithFramework compares counts of workflow files, it then reports that every detected workflow is configured and suppresses the setup instructions even though the other jobs remain uninstrumented. Track configuration at job granularity, consistent with the generated instruction to add the action once per test job.

Useful? React with 👍 / 👎.

Comment thread internal/onboard/onboard.go Outdated
Comment on lines +159 to +160
2. Compose the existing setupNodeEvents callback with require(path.join(tracerRoot, 'ci/cypress/plugin')). Preserve existing event handlers, including after:run and after:spec; do not replace them.
3. In setupNodeEvents, generate a support wrapper under RUNNER_TEMP. Write a literal require of path.join(tracerRoot, 'ci/cypress/support'), followed by a literal require of the existing resolved supportFile (unless it is false). Set the returned config.supportFile to that wrapper. Generating literal absolute imports lets Cypress's browser bundler resolve the isolated tracer without adding it to package.json.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Provide ESM-compatible Cypress instrumentation

For Cypress projects using an ESM configuration such as cypress.config.mjs—which internal/framework/cypress.go explicitly supports—these instructions tell the user to call require(...) from the existing config. Node does not define require in an ES module, so following the onboarding guidance makes Cypress fail while loading its configuration. Provide an import/createRequire variant or direct ESM projects to a generated CommonJS wrapper.

Useful? React with 👍 / 👎.

@datadog-datadog-prod-us1-2

This comment has been minimized.

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: FAIL

The workflow scan can report complete setup when only one job uses the Datadog action. Repository paths with glob syntax and non-US1 API key links also cause incorrect onboarding.

Open Bits AI session

🤖 Bits Code Review · Commit ccace88 · @DataDog review to ask questions

Comment thread internal/onboard/onboard.go Outdated
}
relativePath = filepath.ToSlash(relativePath)
workflows = append(workflows, relativePath)
if strings.Contains(text, githubAction) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Check setup for each test job

The command can report complete setup while some test jobs have no Datadog setup.

Assertion details
  • Input: A workflow file has two test jobs, but only one job uses the Datadog action.
  • Expected: The scan must confirm that each matching test job uses the action for the selected language.
  • Actual: The scan marks the whole workflow file as configured when it finds the action in any job.

Was this helpful? React 👍 or 👎
🤖 Bits Code Review · @DataDog review to ask questions · Open Bits AI session

Comment thread internal/onboard/onboard.go Outdated

func findWorkflows(repositoryRoot, language, name string) ([]string, []string, error) {
patterns := []string{
filepath.Join(repositoryRoot, ".github", "workflows", "*.yml"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Treat the repository root as a literal path

The onboarding command fails for valid repository paths that contain glob metacharacters.

Assertion details
  • Input: The repository path contains a glob metacharacter, such as /tmp/project[old].
  • Expected: The command must treat the repository root as a literal path.
  • Actual: filepath.Glob reads metacharacters in the repository root as pattern syntax. It can miss valid workflow files or return an error.

Was this helpful? React 👍 or 👎
🤖 Bits Code Review · @DataDog review to ask questions · Open Bits AI session

Comment thread internal/onboard/instructions/github.md Outdated

The API key must be created and added to GitHub by a human. Ask the human to:

1. Create a [Datadog API key](https://app.datadoghq.com/organization-settings/api-keys).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Use the correct API key page

A non-US1 user can create a key for the wrong site, and authentication then fails.

Assertion details
  • Input: The organization uses a Datadog site other than US1.
  • Expected: The instructions must use the API key page for the selected Datadog site, or use a site-neutral page.
  • Actual: The link always opens the US1 API key page.

Was this helpful? React 👍 or 👎
🤖 Bits Code Review · @DataDog review to ask questions · Open Bits AI session

@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch from ccace88 to e671731 Compare September 22, 2026 11:53
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch 2 times, most recently from a3bd7e0 to b5c29aa Compare September 22, 2026 14:17
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch 2 times, most recently from 1069220 to 255442b Compare September 22, 2026 14:25
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch 2 times, most recently from 473ea9f to b2cf4fa Compare September 22, 2026 14:39
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch from 255442b to daa3098 Compare September 22, 2026 14:39
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch from b2cf4fa to fa50b49 Compare September 22, 2026 14:50
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch from daa3098 to 9d2e383 Compare September 22, 2026 14:50
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch from fa50b49 to dec4e6c Compare September 22, 2026 14:55
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch 3 times, most recently from e08657e to 58998be Compare September 22, 2026 15:09
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch from 34bfed5 to bb75395 Compare September 22, 2026 15:11
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch from 58998be to 3aea1c4 Compare September 22, 2026 15:11
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch from bb75395 to b3bf7f2 Compare September 22, 2026 15:14
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch from 3aea1c4 to b136b7f Compare September 22, 2026 15:14
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch from b3bf7f2 to 261cfde Compare September 22, 2026 15:22
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch 2 times, most recently from b486438 to fdee281 Compare September 22, 2026 15:26
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch from 261cfde to 0a0d9d9 Compare September 22, 2026 15:26
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch from e36a6c2 to 88ba956 Compare September 23, 2026 15:04
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch from 8ef0075 to 88e5d33 Compare September 23, 2026 15:04
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch from 88ba956 to 54e1358 Compare September 24, 2026 07:31
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch 2 times, most recently from c680eaa to c01b41a Compare September 24, 2026 07:35
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch 2 times, most recently from 56b1e71 to 80fcf17 Compare September 24, 2026 11:16
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch 2 times, most recently from 8dd157c to 8482dc8 Compare September 24, 2026 11:49
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch 2 times, most recently from 43a4eeb to 4ae9e32 Compare September 24, 2026 13:15
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch from 8482dc8 to e041a5f Compare September 24, 2026 13:15
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch from 4ae9e32 to 9708e12 Compare September 24, 2026 13:41
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch 2 times, most recently from 10335a3 to d9f1ebb Compare September 24, 2026 14:02
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch 2 times, most recently from 08563d9 to 8707135 Compare September 24, 2026 14:08
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch from d9f1ebb to e59cd15 Compare September 24, 2026 14:08
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch from 8707135 to 53747d8 Compare September 24, 2026 14:18
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch from e59cd15 to 2a2e620 Compare September 24, 2026 14:18
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch from 53747d8 to a28895e Compare September 24, 2026 14:22
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch from 2a2e620 to 1a6051e Compare September 24, 2026 14:22
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch from a28895e to d94405e Compare September 24, 2026 14:55
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-13-onboarding branch 3 times, most recently from b023bca to db6d1cf Compare September 24, 2026 15:18
@anmarchenko
anmarchenko force-pushed the anmarchenko/onboarding-12-ruby branch from 75d38b2 to 4ba4e93 Compare September 24, 2026 15:18
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