Skip to content

IFC-2303: CoreKeyValue schema definitions for webhook custom headers#8590

Merged
polmichel merged 16 commits intopmi-20260227-webhooks-ifc-2272from
pmi-20260312-webhooks-headers-schemas-ifc-2303
Mar 16, 2026
Merged

IFC-2303: CoreKeyValue schema definitions for webhook custom headers#8590
polmichel merged 16 commits intopmi-20260227-webhooks-ifc-2272from
pmi-20260312-webhooks-headers-schemas-ifc-2303

Conversation

@polmichel
Copy link
Copy Markdown
Contributor

@polmichel polmichel commented Mar 12, 2026

Why

Webhooks currently have no way to send custom HTTP headers (authentication tokens, API keys, metadata). This blocks integrations that require auth headers or tenant identification.

This PR adds the schema layer: a CoreKeyValue generic with three node type implementations, and a headers relationship on CoreWebhook.

Non-goals: internal .md documentation resulting from /feedback session with Claude.

Closes IFC-2303

What changed

  • New schema entities: CoreKeyValue generic (name, key, description) with CoreStaticKeyValue, CoreEnvironmentVariableKeyValue node schemas — all branch-agnostic
  • Webhook relationship: Added headers relationship (peer=CoreKeyValue, cardinality=MANY, kind=ATTRIBUTE) to CoreWebhook generic
  • Constants: Added InfrahubKind entries for all three new types
  • Generated files: Regenerated protocols.py and test protocols to reflect new schema

No behavioral changes — this is purely additive schema definitions. API contract unchanged for existing webhooks (headers relationship is optional).

How to review

  1. Start with backend/infrahub/core/schema/definitions/core/key_value.py — the new schema definitions
  2. Then backend/infrahub/core/schema/definitions/core/webhook.py — the headers relationship addition

How to test

uv run invoke backend.generate   # Should succeed with new schemas
uv run invoke format && uv run invoke lint   # Should pass

Impact & rollout

  • Deployment notes: Safe to deploy. Need synchronization with a PR for schema-update from SDK side.

Checklist

  • Tests added/updated
  • External docs updated (if user-facing or ops-facing change)
  • Internal .md docs updated (internal knowledge and AI code tools knowledge)

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 12, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (4)
  • main
  • stable
  • develop
  • release-.*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f9a76bdb-7f4c-46e9-b320-a1afb4f4c3ee

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added type/documentation Improvements or additions to documentation group/backend Issue related to the backend (API Server, Git Agent) labels Mar 12, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 12, 2026

Merging this PR will improve performance by 39.32%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 12 improved benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
test_schemabranch_duplicate 7.2 ms 5.8 ms +25.7%
test_graphql_generate_schema 517.5 ms 371.4 ms +39.32%
test_get_menu 245.2 ms 193.5 ms +26.69%
test_get_schema 325.7 ms 258.2 ms +26.15%
test_relationshipmanager_getpeer 160.8 µs 133.1 µs +20.83%
test_query_one_model 463.6 ms 352.4 ms +31.52%
test_query_rel_one 661.4 ms 500.5 ms +32.14%
test_load_node_to_db_node_schema 66.2 ms 52.1 ms +27.05%
test_schemabranch_process 1,030.1 ms 821.8 ms +25.34%
test_base_schema_duplicate_CoreProposedChange 2.1 ms 1.7 ms +27.88%
test_nodemanager_querypeers 1.5 ms 1.2 ms +22.15%
test_query_rel_many 691.7 ms 522.9 ms +32.3%

Comparing pmi-20260312-webhooks-headers-schemas-ifc-2303 (7a19d96) with stable (298fd37)1

Open in CodSpeed

Footnotes

  1. No successful run was found on pmi-20260227-webhooks-ifc-2272 (44c9479) during the generation of this report, so stable (298fd37) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@polmichel polmichel force-pushed the pmi-20260312-webhooks-headers-schemas-ifc-2303 branch from a9fc2d5 to af3a1ce Compare March 12, 2026 19:55
@github-actions github-actions Bot added the group/frontend Issue related to the frontend (React) label Mar 12, 2026
polmichel and others added 6 commits March 13, 2026 10:00
Introduces CoreKeyValue generic with CoreStaticKeyValue, CorePasswordKeyValue,
and CoreEnvironmentVariableKeyValue node types. Adds headers relationship to
CoreWebhook generic. Registers all new schemas in core_models_mixed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ern equivalents

Use human_friendly_id and display_label (Jinja2 template) instead of the
deprecated default_filter and display_labels on all CoreKeyValue schemas.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@polmichel polmichel force-pushed the pmi-20260312-webhooks-headers-schemas-ifc-2303 branch from 6ac608a to 851ad8b Compare March 13, 2026 09:01
@github-actions github-actions Bot removed the type/documentation Improvements or additions to documentation label Mar 13, 2026
@polmichel polmichel force-pushed the pmi-20260312-webhooks-headers-schemas-ifc-2303 branch from 851ad8b to ad069fc Compare March 13, 2026 09:09
@polmichel polmichel marked this pull request as ready for review March 13, 2026 14:36
@polmichel polmichel requested review from a team as code owners March 13, 2026 14:36
@polmichel polmichel marked this pull request as draft March 13, 2026 14:37
@polmichel polmichel marked this pull request as ready for review March 13, 2026 15:54
@polmichel polmichel changed the title feat: CoreKeyValue schema definitions for webhook custom headers IFC-2303: CoreKeyValue schema definitions for webhook custom headers Mar 13, 2026
@polmichel polmichel self-assigned this Mar 14, 2026
Comment thread backend/infrahub/core/schema/definitions/core/key_value.py
Comment thread backend/infrahub/core/constants/infrahubkind.py Outdated
@polmichel polmichel marked this pull request as draft March 16, 2026 12:18
@polmichel polmichel marked this pull request as ready for review March 16, 2026 13:18
@polmichel polmichel merged commit 4432cd4 into pmi-20260227-webhooks-ifc-2272 Mar 16, 2026
112 of 119 checks passed
@polmichel polmichel deleted the pmi-20260312-webhooks-headers-schemas-ifc-2303 branch March 16, 2026 15:23
polmichel added a commit that referenced this pull request Mar 18, 2026
* IFC-2303: CoreKeyValue schema definitions for webhook custom headers (#8590)

* IFC-2257 new unit test against httpx regression

* IFC-2304: Runtime resolution of webhook custom headers (#8597)

* IFC-2334: Webhook cache invalidation on KeyValue changes (#8602)

* IFC-2337: Invalidate webhook cache on reconcile_all (#8603)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

group/backend Issue related to the backend (API Server, Git Agent) group/frontend Issue related to the frontend (React)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants