Skip to content

Deduplicate Cloud Hypervisor enclave workload profile creation - #11849

Merged
lpcox merged 2 commits into
mainfrom
copilot/fix-duplicate-create-workload-profile
Nov 20, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/fix-duplicate-create-workload-profile

Conversation

@lpcox

@lpcox lpcox commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Two host-enclave modules duplicate the trusted workload-profile factory, risking drift in security-relevant agent-policy and GitHub-capability handling.

  • Consolidation: Retain the workload-profile implementation and re-export it from the executor-policy module, preserving existing imports and behavior.
  • Regression guard: Assert both modules export the same factory function.

@lpcox lpcox changed the title [WIP] Fix duplicate createWorkloadProfile in host-enclave modules Deduplicate Cloud Hypervisor enclave workload profile creation Nov 19, 2026
@lpcox
lpcox marked this pull request as ready for review November 19, 2026 22:56
Copilot AI adaptive review requested due to automatic review settings November 19, 2026 22:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the workload-profile factory consolidation.

No open issues 🎉

What changed in this PR

This PR consolidates the Cloud Hypervisor enclave workload-profile factory, addressing #11845 and reducing the risk of security-relevant policy handling drifting between implementations.

Changes:

  • Replace the executor-policy module’s duplicate factory with a re-export of the shared implementation, preserving existing imports.
  • Add a regression test asserting both modules export the same factory function.
File Description
src/​cloud-hypervisor/​host-enclave-workload-profile.test.ts Adds a factory identity check across both module exports.
src/​cloud-hypervisor/​host-enclave-executor-policy.ts Removes the duplicate factory and unused imports; re-exports the shared implementation.

Review effort: Balanced (adaptive)

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@lpcox Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@lpcox
lpcox merged commit 02bd153 into main Nov 20, 2026
47 of 50 checks passed
@lpcox
lpcox deleted the copilot/fix-duplicate-create-workload-profile branch November 20, 2026 00:13
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.

[Duplicate Code] Duplicate createWorkloadProfile in Cloud Hypervisor host-enclave modules

3 participants