Skip to content

[ci]: Add pure database config adapter#6

Draft
hdwhdw wants to merge 6 commits into
masterfrom
ci/pure-sonic-db-config
Draft

[ci]: Add pure database config adapter#6
hdwhdw wants to merge 6 commits into
masterfrom
ci/pure-sonic-db-config

Conversation

@hdwhdw

@hdwhdw hdwhdw commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Why I did it

This is step 1 of the standalone unit-test roadmap, stacked on
sonic-net/sonic-gnmi#719.

Canonical packages need a repeatable pattern for isolating dependencies that
cannot compile outside the SONiC build environment. Database configuration is
the first vertical slice because its namespace API contains useful derived
logic while its implementation depends on swsscommon.

How I did it

  • extracted namespace-based database configuration into internal/dbconfig
  • kept derived behavior untagged behind a repository-owned provider interface
  • added a !pure provider that wraps the existing swsscommon calls
  • added a pure provider that parses database_config.json
  • made the legacy sonic_db_config namespace functions delegate without
    changing their signatures
  • kept DBKey APIs unchanged for a later migration
  • enabled the pure build tag for canonical package validation
  • added CGO-free build proof, dependency leakage checks, and build-tag placement
    checks
  • removed the sibling repository checkout from hosted pure tests
  • shared a provider contract between pure CI and SONiC integration CI

How to verify it

  • make -f pure.mk ci
  • make -f pure.mk junit-xml
  • make -f pure.mk PACKAGES=internal/dbconfig check-deps check-tags build-test test
  • verify make -f pure.mk PACKAGES=sonic_db_config check-deps returns nonzero
  • run make check_gotest_junit in the SONiC integration environment for the
    real-provider contract

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Add the first pure/real adapter seam for standalone database configuration
tests.

Link to config_db schema for YANG module changes

N/A

A picture of a cute animal (not mandatory but encouraged)

@mssonicbld

Copy link
Copy Markdown

/azp run

hdwhdw and others added 2 commits July 22, 2026 09:29
Extract namespace database configuration behind an internal provider seam. The normal build uses swsscommon, while the pure build parses database_config.json and rejects unsupported global configurations explicitly.

Run canonical packages with the pure build tag, prove CGO-free builds, reject SONiC-only dependency leaks, and remove the sibling checkout from hosted pure tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Validate test dependencies and build-tag placement, run a CGO-free build before hosted race tests, and preserve default namespace lookup behavior.

Share the database configuration contract with the real swsscommon provider and publish its integration result separately.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
@hdwhdw
hdwhdw force-pushed the ci/pure-sonic-db-config branch from 284518b to 674034c Compare July 22, 2026 14:32
@hdwhdw
hdwhdw changed the base branch from ci/fix-pure-package-validation to master July 22, 2026 14:32
@mssonicbld

Copy link
Copy Markdown

/azp run

1 similar comment
@mssonicbld

Copy link
Copy Markdown

/azp run

Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
@mssonicbld

Copy link
Copy Markdown

/azp run

Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
@mssonicbld

Copy link
Copy Markdown

/azp run

Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
@mssonicbld

Copy link
Copy Markdown

/azp run

Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
@mssonicbld

Copy link
Copy Markdown

/azp run

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.

2 participants