Skip to content

feat(#4313): apply connector config defaults at resolve time - #4314

Open
fullsend-ai-coder[bot] wants to merge 2 commits into
mainfrom
agent/4313-connector-config-defaults
Open

feat(#4313): apply connector config defaults at resolve time#4314
fullsend-ai-coder[bot] wants to merge 2 commits into
mainfrom
agent/4313-connector-config-defaults

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Add optional defaultValue field to ConfigFieldMeta and apply it as a third precedence layer in RuntimeConfigResolver: DB override → YAML baseline → field default → undefined.

Default values per OpenSpec task 1.8:

  • schedule.intervalMs: 300000 (5 min) — jira, github, gitlab
  • batchSize: 100 — jira, github, gitlab
  • timeout.connectionMs: 30000 (30 s) — jira only

Defaults are NOT added via Zod .default() to preserve "unset" semantics: validateConfigValue(key, undefined) still returns undefined, and resolver precedence is respected. Instead, the defaultValue property on ConfigFieldMeta is read by a new getFieldDefault() helper, which the resolver calls when neither DB nor YAML provides a value.

Fields without defaults (enabled, endpoint, schedule.cron) continue to return undefined when absent.

Bumps BOOST_CONFIG_SCHEMA_VERSION from 4 to 5.


Closes #4313

Post-script verification

  • Branch is not main/master (agent/4313-connector-config-defaults)
  • Secret scan passed (gitleaks — e6c850f7dd03d646d614fb0c74f80e7e4b9d0026..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

Add optional `defaultValue` field to `ConfigFieldMeta` and apply
it as a third precedence layer in `RuntimeConfigResolver`:
DB override → YAML baseline → field default → undefined.

Default values per OpenSpec task 1.8:
- schedule.intervalMs: 300000 (5 min) — jira, github, gitlab
- batchSize: 100 — jira, github, gitlab
- timeout.connectionMs: 30000 (30 s) — jira only

Defaults are NOT added via Zod `.default()` to preserve "unset"
semantics: `validateConfigValue(key, undefined)` still returns
undefined, and resolver precedence is respected. Instead, the
`defaultValue` property on `ConfigFieldMeta` is read by a new
`getFieldDefault()` helper, which the resolver calls when neither
DB nor YAML provides a value.

Fields without defaults (`enabled`, `endpoint`, `schedule.cron`)
continue to return `undefined` when absent.

Bumps BOOST_CONFIG_SCHEMA_VERSION from 4 to 5.

Closes #4313
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Agent PR ready for human review label Aug 14, 2026
@rhdh-gh-app

rhdh-gh-app Bot commented Aug 14, 2026

Copy link
Copy Markdown

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-boost-backend workspaces/boost/plugins/boost-backend minor v0.4.0

@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.24%. Comparing base (e6c850f) to head (e079b54).
⚠️ Report is 21 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4314      +/-   ##
==========================================
+ Coverage   61.23%   61.24%   +0.01%     
==========================================
  Files        2507     2513       +6     
  Lines      100386   100513     +127     
  Branches    28131    28185      +54     
==========================================
+ Hits        61468    61558      +90     
- Misses      37104    37141      +37     
  Partials     1814     1814              
Flag Coverage Δ *Carryforward flag
adoption-insights 84.55% <ø> (ø) Carriedforward from e6c850f
ai-integrations 71.04% <ø> (ø) Carriedforward from e6c850f
app-defaults 69.79% <ø> (ø) Carriedforward from e6c850f
augment 46.67% <ø> (ø) Carriedforward from e6c850f
boost 78.37% <100.00%> (-0.27%) ⬇️
bulk-import 72.79% <ø> (ø) Carriedforward from e6c850f
cost-management 13.55% <ø> (ø) Carriedforward from e6c850f
dcm 67.21% <ø> (ø) Carriedforward from e6c850f
e2e-adoption-insights 60.00% <ø> (ø) Carriedforward from e6c850f
e2e-extensions 62.13% <ø> (ø) Carriedforward from e6c850f
e2e-global-header 49.45% <ø> (ø) Carriedforward from e6c850f
e2e-homepage 43.49% <ø> (ø) Carriedforward from e6c850f
e2e-intelligent-assistant 46.74% <ø> (ø) Carriedforward from e6c850f
e2e-orchestrator 50.42% <ø> (ø) Carriedforward from e6c850f
e2e-quickstart 55.21% <ø> (ø) Carriedforward from e6c850f
e2e-scorecard 50.21% <ø> (ø) Carriedforward from e6c850f
e2e-theme 17.11% <ø> (ø) Carriedforward from e6c850f
extensions 56.59% <ø> (ø) Carriedforward from e6c850f
global-floating-action-button 71.18% <ø> (ø) Carriedforward from e6c850f
global-header 66.50% <ø> (ø) Carriedforward from e6c850f
homepage 47.50% <ø> (ø) Carriedforward from e6c850f
install-dynamic-plugins 59.95% <ø> (ø) Carriedforward from e6c850f
intelligent-assistant 75.42% <ø> (ø) Carriedforward from e6c850f
konflux 91.98% <ø> (ø) Carriedforward from e6c850f
lightspeed 69.02% <ø> (ø) Carriedforward from e6c850f
mcp-integrations 83.40% <ø> (ø) Carriedforward from e6c850f
orchestrator 70.87% <ø> (ø) Carriedforward from e6c850f
quickstart 63.74% <ø> (ø) Carriedforward from e6c850f
sandbox 79.56% <ø> (ø) Carriedforward from e6c850f
scorecard 87.09% <ø> (ø) Carriedforward from e6c850f
theme 88.14% <ø> (ø) Carriedforward from e6c850f
translations 5.12% <ø> (ø) Carriedforward from e6c850f
x2a 79.20% <ø> (ø) Carriedforward from e6c850f

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e6c850f...e079b54. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mareklibra

Copy link
Copy Markdown
Member

/fs-fix changeset and all known issues so far (like CI)

@fullsend-ai-coder

fullsend-ai-coder Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 6:51 AM UTC · Completed 7:10 AM UTC

Commit: e6a4a06 · View workflow run →

- Add changeset for connector config defaults feature (minor bump)
- Remove stale changeset from previous release (already consumed on main)
- Regenerate frontend report.api.md to match API Extractor output,
  fixing the CI "check api reports" step failure

Addresses review feedback on #4314
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (human-triggered)

Addressed both issues from /fs-fix instruction: (1) added proper changeset for the connector config defaults feature and removed the stale changeset from a previous release, (2) fixed CI by regenerating the frontend API report to match API Extractor output.

Fixed (2):

  1. missing changeset for boost-backend package: Created new changeset connector-config-defaults.md for the defaults feature (minor bump). Removed stale connector-config-schemas.md that was already consumed by Version Packages on main.
  2. CI failure in check api reports and generate API reference step: Regenerated frontend report.api.md (plugins/boost/report.api.md) to match API Extractor output. The committed version had incorrect property ordering that did not match what backstage-repo-tools api-reports generates with tsc:full compilation.

Tests: passed

Updated by fullsend fix agent

@sonarqubecloud

Copy link
Copy Markdown

@mareklibra

Copy link
Copy Markdown
Member

/fs-review

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 17, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 7:32 AM UTC · Completed 7:49 AM UTC

Commit: e079b54 · View workflow run →

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [stale-doc] workspaces/boost/AGENTS.md:83 — The "Adding new config fields" checklist instructs contributors to register fields with "a Zod schema, configScope, and description" but does not mention the new optional defaultValue property on ConfigFieldMeta. Contributors adding fields with defaults may not discover this property from the checklist alone.
    Remediation: Update step 2 to mention defaultValue as an optional property.

Low

  • [edge-case] workspaces/boost/plugins/boost-backend/src/config/RuntimeConfigResolver.tsresolve() guards the field-default fallback with value !== undefined, while resolveAll() uses !effective.has(key). These differ if a key is present in the map with an explicit undefined value. Currently unreachable (the map never stores undefined), but the inconsistent idiom is worth harmonizing.

  • [stale-doc] Several openspec documents describe RuntimeConfigResolver as a "two-layer" model (DB override + YAML baseline). With the addition of field defaults, this is now a three-layer model:

    • openspec/changes/platform-operations-deployment/specs/runtime-config/spec.md
    • openspec/changes/connector-config-hot-reload/specs/config-schemas/spec.md
    • openspec/changes/connector-config-hot-reload/design.md
    • openspec/changes/connector-config-hot-reload/proposal.md
  • [incomplete-doc] workspaces/boost/openspec/changes/connector-config-hot-reload/specs/config-schemas/spec.md:95 — The "Default Values" requirement says "schema provides default value" without clarifying the mechanism. Now that defaults use ConfigFieldMeta.defaultValue (not Zod .default()), clarifying this would prevent future misunderstanding.

@fullsend-ai-review fullsend-ai-review 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.

See the review comment for full details.


Note: The following inline comments could not be posted on the diff (GitHub returned 422) and are included here instead:

  • workspaces/boost/plugins/boost-backend/src/config/RuntimeConfigResolver.ts (file-level): Line 53 · [low] edge-case

resolve() guards the field-default fallback with value !== undefined, while resolveAll() uses !effective.has(key). These differ if a key is present in the map with an explicit undefined value. Currently unreachable but the inconsistent idiom could become a subtle bug if a future code path stores undefined into the map.

Suggested fix: Use the same guard in both methods.

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Agent PR ready for human review requires-manual-review Review requires human judgment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connector Config — Apply optional-field defaults at resolve time (OpenSpec task 1.8)

1 participant