Skip to content

Refactor git package#88

Open
anmarchenko wants to merge 3 commits into
mainfrom
anmarchenko/unify-git-helpers-testoptimization
Open

Refactor git package#88
anmarchenko wants to merge 3 commits into
mainfrom
anmarchenko/unify-git-helpers-testoptimization

Conversation

@anmarchenko

@anmarchenko anmarchenko commented Jun 17, 2026

Copy link
Copy Markdown
Member

What

Unify Git metadata constants and helper functions under internal/git, remove the old duplicated Git helper files, and add real-repository integration test coverage for Git-related Test Optimization flows.

Why

This continues the Test Optimization refactor by removing duplicated Git plumbing from internal/utils and civisibility/constants, making the Git integration surface easier to reason about and test. It also moves the disabled-test conversion into the Test Optimization client so planner code depends on client behavior rather than package-level helper leftovers.

E2E testing

In a real Git repository with at least two commits and an origin remote, run ddtest plan for a supported test project and verify that Test Optimization initialization reports repository URL, branch, commit SHA, commit author/committer metadata, and uploads missing Git objects when the backend reports only an older commit as known.

@anmarchenko anmarchenko changed the title Unify git helpers Refactor git package Jun 17, 2026
@anmarchenko anmarchenko marked this pull request as ready for review June 17, 2026 14:50
@anmarchenko anmarchenko requested a review from a team as a code owner June 17, 2026 14:50
@datadog-prod-us1-6

This comment has been minimized.

@anmarchenko

Copy link
Copy Markdown
Member Author

E2E Test Report: SUCCESS

Tested by: Shepherd Agent (autonomous QA for Datadog Test Optimization)

Test Environment

  • Method: Local Shepherd testing against the real Datadog EU backend
  • PR: Refactor git package #88
  • Branch: anmarchenko/unify-git-helpers-testoptimization
  • Revision tested: 5a766f1

Results

Check Status Evidence
ddtest PR branch built and injected PASS crook built ddtest from anmarchenko/unify-git-helpers-testoptimization for each run
Test Optimization settings request includes Git metadata PASS EU settings request included repository_url, branch, and sha for sidekiq and spree
Real backend search_commits path PASS spree run sent 12 commits to /api/v2/git/repository/search_commits and received HTTP 200
Missing-commit pack upload path PASS forced temporary commit b9a6574b0e4d31b46ab610223e88c8264957c7eb triggered /api/v2/git/repository/packfile; backend returned HTTP 204; 212 bytes uploaded
ddtest planning output PASS spree plan discovered 420 files, selected 4 runners, used 417 known durations and 3 defaults
Cross-SDK API shape sanity check PASS ddtest request shapes matched Ruby, JS, and Python clients for search_commits and multipart pushedSha/packfile

Issues Found

None.

Verification

Plan-only ddtest runs do not emit a Test Visibility test session ID, so UI session verification was not applicable. Backend verification was performed directly through real EU API responses in debug logs, including settings, search_commits, skippable tests, suite durations, and packfile upload.

Test Methodology

  1. Ran sidekiq with ddtest-plan against EU to validate basic planning and Test Optimization API traffic.
  2. Ran spree ddtest-plan-core-root against EU to validate repository-root planning, historical durations, and real search_commits response shape.
  3. Created a temporary local empty commit on a disposable spree branch to force a missing commit, reran the EU plan, and verified packfile upload succeeded with HTTP 204.
  4. Restored spree to main and deleted the temporary branch.
  5. Refreshed tracer clones and compared git API request shapes against Ruby, JS, and Python implementations.

This E2E test was performed by Shepherd - autonomous QA agent for Datadog Test Optimization.

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