Skip to content

refactor(api): add deprecation markers for v1.0 API freeze#676

Merged
kcenon merged 2 commits into
mainfrom
refactor/issue-672-api-freeze-audit
Apr 13, 2026
Merged

refactor(api): add deprecation markers for v1.0 API freeze#676
kcenon merged 2 commits into
mainfrom
refactor/issue-672-api-freeze-audit

Conversation

@kcenon

@kcenon kcenon commented Apr 13, 2026

Copy link
Copy Markdown
Owner

Closes #672
Part of #670

Summary

  • Attach [[deprecated]] attributes to legacy thread_logger user-facing methods (log, log_error, set_level, set_enabled, set_lightweight_mode, is_lightweight_mode) so consumers of the legacy logging path see compiler warnings. Internal SDOF-safe helpers (instance, is_shutting_down, prepare_shutdown) remain stable because thread_context still depends on them.
  • Emit #pragma message warnings on include of compatibility.h (namespace aliases thread_system, thread_module, thread_namespace, utility_module) and lockfree/lockfree_queue.h (forwarding header for concurrent_queue.h). Namespace aliases cannot carry a portable [[deprecated]] attribute, so pragma-based warnings are the only viable signal.
  • Provide suppression macros (THREAD_SUPPRESS_LEGACY_NAMESPACE_WARNING, THREAD_SUPPRESS_LEGACY_LOCKFREE_QUEUE_WARNING) for consumers that need a quiet migration window.
  • queue.cppm defines THREAD_SUPPRESS_LEGACY_LOCKFREE_QUEUE_WARNING before including lockfree_queue.h so the module re-export path stays quiet.
  • Add a v1.0.0 API Freeze section to docs/advanced/MIGRATION.md that records the frozen public surface, the legacy APIs scheduled for removal in v2.0.0, and the suppression macros consumers can use during migration.

Context

The v3.0.0 pass removed legacy types (thread::result<T>, result_void, error, logger_interface, monitoring_interface) but left transitional compatibility surfaces without compiler-visible deprecation signals. Issue #672 is the v1.0 freeze audit — surface-wide review of 129 public headers to add [[deprecated]] markers and migration paths before v2.0 can make breaking changes. No dead code was found; the freeze is additive only.

What changed

File Change
include/kcenon/thread/compatibility.h Add #pragma message for namespace aliases + suppression macro
include/kcenon/thread/core/thread_logger.h [[deprecated]] on 7 user-facing methods; strengthen log_level enum doc
include/kcenon/thread/lockfree/lockfree_queue.h Add #pragma message for forwarding header + suppression macro
src/modules/queue.cppm Define suppression macro before legacy include
docs/advanced/MIGRATION.md New v1.0.0 API Freeze section with deprecation table and suppression guide

Test plan

  • cmake --build build-debug succeeds with exit code 0
  • Build emits 11 deprecation warnings from consumers that still touch the legacy methods — proves attributes are effective
  • ctest --test-dir build-debug — 382/383 thread_base_unit tests pass (same pre-existing LifecycleControllerTest.InitialStateIsCreated failure as before Replace throw statements with Result<T> in public API #671; unrelated to this PR)
  • No changes to functional behavior; only attribute/message additions and doc updates
  • queue.cppm module re-export path stays quiet (suppression macro applied before include)

Notes for reviewers

  • The log_level enum itself does not carry [[deprecated]]. Applying it at the enum level would trigger warnings inside thread_logger.h itself (member initializer, internal signatures, level_to_string). The deprecation still propagates because every user-facing method that accepts log_level is itself [[deprecated]]. The rationale is documented in the enum's doc comment.
  • Namespace aliases (thread_system, thread_module, etc.) can't be marked [[deprecated]] in portable C++ — the standard permits the attribute on namespace definitions but not on aliases. #pragma message is the only portable fallback.
  • v3.0.0 migration section in MIGRATION.md is preserved unchanged for historical context. The new v1.0.0 section is additive.

kcenon added 2 commits April 14, 2026 07:56
Mark legacy APIs scheduled for removal in v2.0.0 so consumers see compiler
warnings during the migration window. The v3.0.0 pass removed legacy types
but left transitional surfaces without [[deprecated]] attributes.

- compatibility.h: emit #pragma message for thread_system/thread_module/
  thread_namespace/utility_module aliases (namespace aliases cannot carry
  a portable [[deprecated]] attribute). Suppressible via
  THREAD_SUPPRESS_LEGACY_NAMESPACE_WARNING.
- thread_logger.h: attach [[deprecated]] to user-facing methods
  (log/log_error/set_level/set_enabled/set_lightweight_mode). Keep the
  SDOF-safe helpers (instance/is_shutting_down/prepare_shutdown) stable
  because thread_context still depends on them. Leave log_level enum
  without an attribute to avoid internal self-warnings from member
  declarations; its deprecation propagates through the deprecated
  methods that accept it.
- lockfree/lockfree_queue.h: emit #pragma message on include of the
  forwarding header. Suppressible via
  THREAD_SUPPRESS_LEGACY_LOCKFREE_QUEUE_WARNING.
- queue.cppm: define the suppression macro before including
  lockfree_queue.h so the module re-export path stays quiet.

Part of #670
Closes #672
Add a v1.0.0 section to MIGRATION.md that records the frozen public
surface, the deprecated APIs scheduled for removal in v2.0.0, and the
migration paths and suppression macros consumers can use during the
migration window.

Previously the document only described the v3.0.0 common_system
transition. With v1.0.0 being an API stability commitment, consumers
need a single place that lists what is frozen, what remains
transitional, and how to silence legacy include warnings without
editing upstream headers.

Part of #670
Closes #672
@github-actions

Copy link
Copy Markdown
Contributor

📊 Performance Benchmark Results

Performance Benchmark Report

No benchmark data available.

ℹ️ No baseline reference available

This is the first benchmark run or baseline file is missing.

@kcenon kcenon merged commit 2b21057 into main Apr 13, 2026
27 checks passed
@kcenon kcenon deleted the refactor/issue-672-api-freeze-audit branch April 13, 2026 23:16
kcenon added a commit that referenced this pull request May 3, 2026
Add pre-flight verify-archive job to on-release-sync-registry.yml that
independently re-downloads the release tarball and computes SHA512 before
delegating to the reusable sync-vcpkg-registry workflow in common_system.
The sync job now declares 'needs: verify-archive' so a fetch failure or
unreachable tag short-circuits the entire run before any portfile commit
reaches kcenon/vcpkg-registry.

File-based hashing is required: piping curl into sha512sum masks fetch
failures because SHA512 of empty input is the fixed constant
cf83e1357eefb8bdf..., so a 404 still produces a valid-looking digest.
The download uses curl -fsSL --retry 3 to a mktemp file and exits 1 with
::error:: if the fetch fails or the computed digest is empty.

This closes the detection gap surfaced by microsoft/vcpkg#51511 and
kcenon/vcpkg-registry#87, matching the pattern merged into common_system
via PR #676.

Closes #691
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.

API freeze audit and deprecation cleanup for v1.0

1 participant