Skip to content

fix: Fully replace pipelines on Writable.Pipeline update#1748

Open
jesson1 wants to merge 1 commit intoedgexfoundry:mainfrom
jesson1:fix/pipline-updates
Open

fix: Fully replace pipelines on Writable.Pipeline update#1748
jesson1 wants to merge 1 commit intoedgexfoundry:mainfrom
jesson1:fix/pipline-updates

Conversation

@jesson1
Copy link

@jesson1 jesson1 commented Sep 17, 2025

Problem

When Writable.Pipeline is updated, the runtime previously only updated topics/transforms per pipeline ID. This PR changes the update to a full replacement: pipelines absent from the new config are removed (and their metrics unregistered) and new pipelines are created and registered. Incoming topics are expanded with the message-bus base prefix.

What changed

  • Build full topics using base topic prefix before applying config.
  • Replace per-field setters with UpdateFunctionsPipelines(...).
  • UpdateFunctionsPipelines:
    • acquires a lock,
    • unregisters metrics and deletes pipelines not in the new config,
    • creates new FunctionPipeline instances and registers their metrics.

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/app-functions-sdk-go/blob/main/.github/CONTRIBUTING.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)

Testing Instructions

New Dependency Instructions (If applicable)

@codecov-commenter
Copy link

codecov-commenter commented Sep 17, 2025

Codecov Report

❌ Patch coverage is 0% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.23%. Comparing base (a15e946) to head (26d5ce6).

Files with missing lines Patch % Lines
internal/runtime/runtime.go 0.00% 16 Missing ⚠️
internal/app/configupdates.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1748      +/-   ##
==========================================
- Coverage   43.41%   43.23%   -0.19%     
==========================================
  Files          64       64              
  Lines        4959     4980      +21     
==========================================
  Hits         2153     2153              
- Misses       2663     2684      +21     
  Partials      143      143              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jesson1 jesson1 changed the title Fully replace pipelines on Writable.Pipeline update fix: Fully replace pipelines on Writable.Pipeline update Sep 19, 2025
@jesson1 jesson1 force-pushed the fix/pipline-updates branch from 2a716a1 to b704129 Compare September 19, 2025 07:58
Previously only updated topics/transforms per pipeline ID.
Now perform full replacement: remove pipelines not in config (unregister metrics),
create/register new pipelines, and build full topics with base prefix.

Signed-off-by: jiasheng.yu <jiashengyu@deepglint.com>
@jesson1 jesson1 force-pushed the fix/pipline-updates branch from b704129 to 26d5ce6 Compare January 10, 2026 03:54
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.

3 participants