diff --git a/.azurepipelines/.bish-index b/.azurepipelines/.bish-index
new file mode 100644
index 0000000..50c9413
--- /dev/null
+++ b/.azurepipelines/.bish-index
@@ -0,0 +1,2 @@
+./templates/ReadMe.md
+./ReadMe.md
diff --git a/.azurepipelines/.bish.sqlite b/.azurepipelines/.bish.sqlite
new file mode 100644
index 0000000..8ddaa3b
Binary files /dev/null and b/.azurepipelines/.bish.sqlite differ
diff --git a/.bish-index b/.bish-index
new file mode 100644
index 0000000..43d1e2f
--- /dev/null
+++ b/.bish-index
@@ -0,0 +1,93 @@
+./pf.py
+./.azurepipelines/ReadMe.md
+./verify_script.sh
+./.pf_fix.py
+./create-secureboot-bootable-media.sh
+./scripts/README.md
+./scripts/system-setup.sh
+./tests/PROGRESSIVE_RECOVERY.md
+./tests/progressive_planfile_check.sh
+./tests/test_pf_tasks_sanity.sh
+./tests/test_secureboot_enablement.sh
+./.pytool/CISettings.py
+./.pytool/Readme.md
+./utils/APFS_SIGNING_DEMO.md
+./utils/README.md
+./utils/README_SECURITY_TOOLS.md
+./utils/cert_inventory.py
+./utils/firmware_checksum_db.py
+./utils/kernel_config_profiles.py
+./utils/kernel_config_remediation.py
+./utils/kernel_hardening_analyzer.py
+./utils/pgmodsign.py
+./utils/test_efi_parser.py
+./utils/test_integration.py
+./utils/update_just_help.sh
+./web/hardware_database_server.py
+./pf_grammar.py
+./pf_parser.py
+./containers/README.md
+./sign-kernel-modules.sh
+./docs/ARCHITECTURE_DIAGRAM.md
+./docs/BEFORE_AND_AFTER.md
+./docs/GPT5_CODE_ANALYSIS_2025-12-22.md
+./docs/BOOT_SEQUENCE_AND_ATTACK_SURFACES.md
+./docs/ISSUE_RESOLUTION_SUMMARY.md
+./docs/COMPLETE_SYSTEM_UNDERSTANDING.md
+./docs/CONFIG.md
+./docs/CONTAINER_ARCHITECTURE.md
+./docs/CONTAINER_SETUP.md
+./docs/E2E_TESTING.md
+./docs/FIRMWARE_RECOVERY.md
+./docs/HARDWARE_ACCESS_DEEP_DIVE.md
+./docs/IMPLEMENTATION_SUMMARY.md
+./docs/JUSTFILE_MODULARIZATION.md
+./docs/KERNEL_HARDENING_GUIDE.md
+./docs/MIGRATION_GUIDE.md
+./docs/NUCLEAR_BOOT_CD.md
+./docs/PASSTHROUGH.md
+./docs/PF_TASKS.md
+./docs/PROGRESSIVE_RECOVERY.md
+./docs/LICENSE.md
+./docs/PROGRESSIVE_RECOVERY_TECHNICAL.md
+./docs/PROJECT_STRUCTURE.md
+./docs/QUICK_REFERENCE.md
+./docs/README.md
+./docs/SECUREBOOT_BOOTABLE_MEDIA.md
+./docs/PF_TASK_CHECK_SUMMARY.md
+./docs/SECUREBOOT_ENABLEMENT_KEXEC.md
+./docs/SECURE_BOOT.md
+./docs/SECURE_BOOT_GUARDING.md
+./docs/SECURE_ENV_COMMAND.md
+./docs/SECURITY_CONSIDERATIONS.md
+./docs/TESTING_GUIDE.md
+./docs/TUI_GUIDE.md
+./docs/QUICKSTART.md
+./docs/UNDERSTANDING_BOOT_ARTIFACTS.md
+./docs/UUEFI_DEBUG_MODE.md
+./docs/UUEFI_ENHANCED.md
+./docs/UUEFI_INVESTIGATION.md
+./docs/UUEFI_V3_FEATURES.md
+./docs/UUEFI_V3_GUIDE.md
+./docs/copilot-instructions.md
+./docs/AMAZON_Q_REVIEW_2025-12-22.md
+./docs/AMAZON_Q_REVIEW_COMPLETION.md
+./docs/ARCHITECTURE.md
+./docs/BOOTKIT_DEFENSE_WORKFLOW.md
+./docs/CHANGELOG.md
+./docs/CICD_REVIEW_ROLLUP_2025-12-27.md
+./docs/CODE_OF_CONDUCT.md
+./docs/CONTRIBUTING.md
+./docs/DOCUMENTATION_CLEANUP_SUMMARY.md
+./docs/FEATURES.md
+./docs/GETTING_STARTED.md
+./docs/SECURE_BOOT_IMPLEMENTATION_SUMMARY.md
+./docs/SECUREBOOT_QUICKSTART.md
+./docs/SECURITY.md
+./docs/SECURITY_REVIEW_2025-12-07.md
+./docs/TESTING_SUMMARY.md
+./docs/WARP.md
+./phoenixboot-tui.sh
+./phoenixboot-wizard.sh
+./.pytest_cache/README.md
+./keys/README.md
diff --git a/.bish.sqlite b/.bish.sqlite
new file mode 100644
index 0000000..f8b60b9
Binary files /dev/null and b/.bish.sqlite differ
diff --git a/CHANGELOG.md b/.devcontainer/.bish-index
similarity index 100%
rename from CHANGELOG.md
rename to .devcontainer/.bish-index
diff --git a/.devcontainer/.bish.sqlite b/.devcontainer/.bish.sqlite
new file mode 100644
index 0000000..3da7589
Binary files /dev/null and b/.devcontainer/.bish.sqlite differ
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
deleted file mode 100644
index bdacdd8..0000000
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ /dev/null
@@ -1,220 +0,0 @@
-# TianoCore edk2 GitHub Bug Report Template
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-
-name: ๐ Bug Report
-description: File a bug report
-title: "[Bug]:
"
-labels: ["type:bug", "state:needs-triage"]
-
-body:
- - type: markdown
- attributes:
- value: |
- ๐ Thanks for taking the time to fill out this bug report!
-
- - type: checkboxes
- attributes:
- label: Is there an existing issue for this?
- description: |
- Please search to see if an issue already exists for the bug you encountered.
- [Seach existing issues](https://github.com/tianocore/edk2/issues)
- options:
- - label: I have searched existing issues
- required: true
-
- - type: checkboxes
- id: bug_type
- attributes:
- label: Bug Type
- description: |
- What type of code does this bug affect?
- options:
- - label: Firmware
- - label: Tool
- - label: Unit Test
-
- - type: dropdown
- id: packages_impacted
- attributes:
- label: What packages are impacted?
- description: |
- *Select all that apply*
- multiple: true
- options:
- - ArmPkg
- - ArmPlatformPkg
- - ArmVirtPkg
- - BaseTools
- - Build or CI Code
- - CryptoPkg
- - DynamicTablesPkg
- - EmbeddedPkg
- - EmulatorPkg
- - FatPkg
- - FmpDevicePkg
- - IntelFsp2Pkg
- - IntelFsp2WrapperPkg
- - MdeModulePkg
- - MdePkg
- - NetworkPkg
- - OvmfPkg
- - PcAtChipsetPkg
- - PrmPkg
- - RedfishPkg
- - SecurityPkg
- - ShellPkg
- - SignedCapsulePkg
- - SourceLevelDebugPkg
- - StandaloneMmPkg
- - UefiCpuPkg
- - UefiPayloadPkg
- - UnitTestFrameworkPkg
- - Other
- validations:
- required: true
-
- - type: dropdown
- id: targets_impacted
- attributes:
- label: Which targets are impacted by this bug?
- description: |
- *Select all that apply*
- multiple: true
- options:
- - DEBUG
- - NO-TARGET
- - NOOPT
- - RELEASE
-
- - type: textarea
- id: current_behavior
- attributes:
- label: Current Behavior
- description: A concise description of the bug that you're experiencing.
- validations:
- required: true
-
- - type: textarea
- id: expected_behavior
- attributes:
- label: Expected Behavior
- description: A concise description of what you expected to happen.
- validations:
- required: true
-
- - type: textarea
- id: steps_to_reproduce
- attributes:
- label: Steps To Reproduce
- description: Steps to reproduce the behavior.
- placeholder: |
-
- 1. In this environment (OS, toolchain, platform info, etc.)...
- 2. Acquire the source code using these commands...
- 3. Build the code using these commands...
- 4. Flash the image using these commands...
- 5. Boot using this process...
- 6. Change option(s)...
- 7. See error...
- validations:
- required: true
-
- - type: textarea
- id: build_environment
- attributes:
- label: Build Environment
- description: |
- Examples:
- - **OS**: Ubuntu 24.04 or Windows 11...
- - **Tool Chain**: GCC5 or VS2022 or CLANGPDB...
- value: |
- - OS(s):
- - Tool Chain(s):
- render: markdown
- validations:
- required: true
-
- - type: textarea
- id: version_info
- attributes:
- label: Version Information
- description: >
- What version of this repo is known to reproduce the problem?
-
-
- The problem is assumed to be present from this version and later. If an earlier version is not known other than
- the latest commit, indicate that and put the current *edk2/master* commit SHA.
- placeholder: |
- Commit:
- -or-
- Tag:
- render: text
- validations:
- required: true
-
- - type: markdown
- attributes:
- value: |
- **Urgency Key**
- - ๐ข **Low**
- - A minor change with little to no important functional impact
- - It is not important to fix this in a specific time frame
- - ๐ก **Medium**
- - An important change with a functional impact
- - Will be prioritized above *low* issues in the normal course of development
- - ๐ฅ **High**
- - A critical change that has a significant functional impact
- - Must be fixed immediately
-
- - type: dropdown
- id: urgency
- attributes:
- label: Urgency
- description: How urgent is it to fix this bug?
- multiple: false
- options:
- - Low
- - Medium
- - High
- validations:
- required: true
-
- - type: dropdown
- id: fix_owner
- attributes:
- label: Are you going to fix this?
- description: Indicate if you are going to fix this or requesting someone else fix it.
- multiple: false
- options:
- - I will fix it
- - Someone else needs to fix it
- validations:
- required: true
-
- - type: dropdown
- id: needs_maintainer_feedback
- attributes:
- label: Do you need maintainer feedback?
- description: Indicate if you would like a maintainer to provide feedback on this submission.
- multiple: false
- options:
- - No maintainer feedback needed
- - Maintainer feedback requested
- validations:
- required: true
-
- - type: textarea
- id: anything_else
- attributes:
- label: Anything else?
- description: |
- Links? References? Anything that will give us more context about the issue you are encountering.
-
- Serial debug logs and/or debugger logs are especially helpful!
-
- Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
- validations:
- required: false
diff --git a/.github/ISSUE_TEMPLATE/code_first.yml b/.github/ISSUE_TEMPLATE/code_first.yml
deleted file mode 100644
index 29b02e4..0000000
--- a/.github/ISSUE_TEMPLATE/code_first.yml
+++ /dev/null
@@ -1,122 +0,0 @@
-# TianoCore edk2 GitHub Code First Template
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-
-name: > Code First
-description: Code first tracking issue
-title: "[Code First]: "
-labels: ["type:code-first"]
-
-body:
- - type: markdown
- attributes:
- value: |
- ๐ Only use this issue form for changes following the "code first" process described in [EDK II Code First Process](https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Code-First-Process).
-
- **Read that document before filing this issue.**
-
- - type: textarea
- id: overview
- attributes:
- label: Code First Item Overview
- description: Provide a brief overview of the overall code first change.
- validations:
- required: true
-
- - type: dropdown
- id: specs_impacted
- attributes:
- label: What specification(s) are directly related?
- description: |
- *Select all that apply*
- multiple: true
- options:
- - ACPI
- - Platform Initialization (PI)
- - UEFI
- - UEFI PI Distribution Packaging
- - UEFI Shell
- validations:
- required: true
-
- - type: markdown
- attributes:
- value: |
- **Specification Draft Template**
-
- For the template below, the title and complete description of the specification changes must be provided in the
- specification text along with the name and version of the specification the change applies. The `Status` of the
- specification change always starts in the `Draft` state and is updated based on feedback from the industry
- standard forums. The contents of the specification text are required to use the
- [Creative Commons Attribution 4.0 International](https://spdx.org/licenses/CC-BY-4.0.html) license using a
- `SPDX-License-Identifier` statement.
-
- - "Required" sections must be completed.
- - Include a modified template for each specification impacted (if more than one).
- - Include a copy of the completed template in a markdown file in the code changes.
- - If more than one template is completed, place each in a separate markdown file.
-
- ---
-
- Template text for reference (using the GitHub flavor of markdown):
-
- ```markdown
- # Title: [Must be Filled In]
-
- ## Status: [Status]
-
- [Status] must be one of the following:
- - Draft
- - Submitted to industry standard forum
- - Accepted by industry standard forum
- - Accepted by industry standard forum with modifications
- - Rejected by industry standard forum
-
- ## Document: [Title and Version]
-
- Here are some examples of [Title and Version]:
- - UEFI Specification Version 2.8
- - ACPI Specification Version 6.3
- - UEFI Shell Specification Version 2.2
- - UEFI Platform Initialization Specification Version 1.7
- - UEFI Platform Initialization Distribution Packaging Specification Version 1.1
-
- ## License
-
- SPDX-License-Identifier: CC-BY-4.0
-
- ## Submitter: [TianoCore Community](https://www.tianocore.org)
-
- ## Summary of the change
-
- Required Section
-
- ## Benefits of the change
-
- Required Section
-
- ## Impact of the change
-
- Required Section
-
- ## Detailed description of the change [normative updates]
-
- Required Section
-
- ## Special Instructions
-
- Optional Section
- ```
-
- - type: textarea
- id: anything_else
- attributes:
- label: Anything else?
- description: |
- Links? References? Anything that will give us more context about the code first change.
-
- Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
- validations:
- required: false
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
deleted file mode 100644
index dd30f07..0000000
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-## @file
-# GitHub issue configuration file.
-#
-# This file is meant to direct contributors familiar with GitHub's issue tracker
-# to the external resources used by TianoCore.
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-##
-
-contact_links:
- - name: Reporting Security Issues
- url: https://github.com/tianocore/tianocore.github.io/wiki/Reporting-Security-Issues
- about: Read the wiki page that describes the process here
- - name: EDK II Development Mailing List
- url: https://edk2.groups.io/g/devel
- about: Ask questions on the mailing list (devel@edk2.groups.io)
- - name: EDK II Discussions
- url: https://github.com/tianocore/edk2/discussions
- about: You can also reach out on the Discussion section of this repository
diff --git a/.github/ISSUE_TEMPLATE/documentation_request.yml b/.github/ISSUE_TEMPLATE/documentation_request.yml
deleted file mode 100644
index 21a9e63..0000000
--- a/.github/ISSUE_TEMPLATE/documentation_request.yml
+++ /dev/null
@@ -1,78 +0,0 @@
-# TianoCore edk2 GitHub Documentation Request Template
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-
-name: ๐ Documentation Request
-description: Request a documentation change
-title: "[Documentation]: "
-labels: ["type:documentation-request", "state:needs-triage"]
-
-body:
- - type: markdown
- attributes:
- value: >
- ๐ Thanks for taking the time to help us improve our documentation!
-
-
- This form is used to request documentation changes that should be contributed to the **edk2** repository.
-
-
- For example, to improve API documentation in a library class header file or add a markdown file to sit
- alongside the code implementation of a particularly complex feature or module.
-
-
- - To file an issue for a TianoCore specification, refer to [these instructions](https://github.com/tianocore-docs/edk2-TemplateSpecification/wiki/TianoCore-Documents-GitBook-Overview)
- and reference the specifications In the [TianoCore Docs organization](https://github.com/tianocore-docs).
-
- - For UEFI specifications, refer to the [UEFI Forum](https://uefi.org/specifications) website.
-
- - type: markdown
- attributes:
- value: |
- ---
-
- - type: textarea
- id: request_description
- attributes:
- label: Request Description
- description: |
- A clear and concise description of what needs to change (*insert images or attachments if relevant*)
- validations:
- required: true
-
- - type: dropdown
- id: request_owner
- attributes:
- label: Are you going to make the change?
- description: Indicate if you are going to make this change or requesting someone else make it.
- multiple: false
- options:
- - I will make the change
- - Someone else needs to make the change
- validations:
- required: true
-
- - type: dropdown
- id: needs_maintainer_feedback
- attributes:
- label: Do you need maintainer feedback?
- description: Indicate if you would like a maintainer to provide feedback on this submission.
- multiple: false
- options:
- - No maintainer feedback needed
- - Maintainer feedback requested
- validations:
- required: true
-
- - type: textarea
- id: anything_else
- attributes:
- label: Anything else?
- description: |
- Links? References? Anything that will give us more context about the request.
-
- Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
- validations:
- required: false
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
deleted file mode 100644
index 5247dbe..0000000
--- a/.github/ISSUE_TEMPLATE/feature_request.yml
+++ /dev/null
@@ -1,142 +0,0 @@
-# TianoCore edk2 GitHub Feature Request Template
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-
-name: ๐ Feature Request
-description: Request a feature change
-title: "[Feature]: "
-labels: ["type:feature-request", "state:needs-triage"]
-
-body:
- - type: markdown
- attributes:
- value: |
- ๐ Thanks for taking the time to help us improve our features!
-
- - type: textarea
- id: feature_overview
- attributes:
- label: Feature Overview
- description: Provide a high-level summary of your feature request.
- validations:
- required: true
-
- - type: textarea
- id: solution_overview
- attributes:
- label: Solution Overview
- description: Give a clear and concise description of what you want to happen.
- validations:
- required: true
-
- - type: textarea
- id: alternatives_considered
- attributes:
- label: Alternatives Considered
- description: Describe alternatives you've considered.
- validations:
- required: false
-
- - type: dropdown
- id: packages_impacted
- attributes:
- label: What packages are impacted?
- description: |
- *Select all that apply*
- multiple: true
- options:
- - ArmPkg
- - ArmPlatformPkg
- - ArmVirtPkg
- - BaseTools
- - Build or CI Code
- - CryptoPkg
- - DynamicTablesPkg
- - EmbeddedPkg
- - EmulatorPkg
- - FatPkg
- - FmpDevicePkg
- - IntelFsp2Pkg
- - IntelFsp2WrapperPkg
- - MdeModulePkg
- - MdePkg
- - NetworkPkg
- - OvmfPkg
- - PcAtChipsetPkg
- - PrmPkg
- - RedfishPkg
- - SecurityPkg
- - ShellPkg
- - SignedCapsulePkg
- - SourceLevelDebugPkg
- - StandaloneMmPkg
- - UefiCpuPkg
- - UefiPayloadPkg
- - UnitTestFrameworkPkg
- - Other
- validations:
- required: true
-
- - type: markdown
- attributes:
- value: |
- **Urgency Key**
- - ๐ข **Low**
- - A minor enhancement
- - It is not important to address this request in a specific time frame
- - ๐ก **Medium**
- - An important enhancement
- - Will be prioritized above *low* requests in the normal course of development
- - ๐ฅ **High**
- - A critical enhancement with significant value
- - Should be prioritized above *low* and *medium* requests
-
- - type: dropdown
- id: urgency
- attributes:
- label: Urgency
- description: How urgent is it to resolve this feature request?
- multiple: false
- options:
- - Low
- - Medium
- - High
- validations:
- required: true
-
- - type: dropdown
- id: request_owner
- attributes:
- label: Are you going to implement the feature request?
- description: Indicate if you are going to do the work to close this feature request.
- multiple: false
- options:
- - I will implement the feature
- - Someone else needs to implement the feature
- validations:
- required: true
-
- - type: dropdown
- id: needs_maintainer_feedback
- attributes:
- label: Do you need maintainer feedback?
- description: Indicate if you would like a maintainer to provide feedback on this submission.
- multiple: false
- options:
- - No maintainer feedback needed
- - Maintainer feedback requested
- validations:
- required: true
-
- - type: textarea
- id: anything_else
- attributes:
- label: Anything else?
- description: |
- Links? References? Anything that will give us more context about the feature you are requesting.
-
- Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
- validations:
- required: false
diff --git a/.github/advanced-issue-labeler.yml b/.github/advanced-issue-labeler.yml
deleted file mode 100644
index bd798b0..0000000
--- a/.github/advanced-issue-labeler.yml
+++ /dev/null
@@ -1,108 +0,0 @@
-# Defines the mappings between GitHub issue responses and labels applied to the issue.
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-# For more information, see:
-# https://github.com/redhat-plumbers-in-action/advanced-issue-labeler
-
-policy:
- - section:
-
- # Issue Template - Urgency Dropdown
- - id: ['urgency']
- block-list: []
- label:
- - name: 'priority:low'
- keys: ['Low']
- - name: 'priority:medium'
- keys: ['Medium']
- - name: 'priority:high'
- keys: ['High']
-
- # Issue Template - Fix Owner Dropdown
- - id: ['fix_owner', 'request_owner']
- block-list: []
- label:
- - name: 'state:needs-owner'
- keys: [
- 'Someone else needs to fix it',
- 'Someone else needs to make the change',
- 'Someone else needs to implement the feature'
- ]
- - name: 'state:needs-triage'
- keys: [
- 'Someone else needs to fix it',
- 'Someone else needs to make the change',
- 'Someone else needs to implement the feature'
- ]
-
- # Issue Template - Needs Maintainer Feedback Dropdown
- - id: ['needs_maintainer_feedback']
- block-list: []
- label:
- - name: 'state:needs-maintainer-feedback'
- keys: ['Maintainer feedback requested']
-
- # Issue Template - Packages Impacted
- - id: ['packages_impacted']
- block-list: []
- label:
- - name: 'package:armpkg'
- keys: ['ArmPkg']
- - name: 'package:armplatformpkg'
- keys: ['ArmPlatformPkg']
- - name: 'package:armvirtpkg'
- keys: ['ArmVirtPkg']
- - name: 'package:basetools'
- keys: ['BaseTools']
- - name: 'package:build-or-ci-code'
- keys: ['Build or CI Code']
- - name: 'package:cryptopkg'
- keys: ['CryptoPkg']
- - name: 'package:dynamictablespkg'
- keys: ['DynamicTablesPkg']
- - name: 'package:embeddedpkg'
- keys: ['EmbeddedPkg']
- - name: 'package:emulatorpkg'
- keys: ['EmulatorPkg']
- - name: 'package:fatpkg'
- keys: ['FatPkg']
- - name: 'package:fmpdevicepkg'
- keys: ['FmpDevicePkg']
- - name: 'package:intelfsp2pkg'
- keys: ['IntelFsp2Pkg']
- - name: 'package:intelfsp2wrapperpkg'
- keys: ['IntelFsp2WrapperPkg']
- - name: 'package:mdemodulepkg'
- keys: ['MdeModulePkg']
- - name: 'package:mdepkg'
- keys: ['MdePkg']
- - name: 'package:networkpkg'
- keys: ['NetworkPkg']
- - name: 'package:ovmfpkg'
- keys: ['OvmfPkg']
- - name: 'package:pcatchipsetpkg'
- keys: ['PcAtChipsetPkg']
- - name: 'package:prmpkg'
- keys: ['PrmPkg']
- - name: 'package:redfishpkg'
- keys: ['RedfishPkg']
- - name: 'package:securitypkg'
- keys: ['SecurityPkg']
- - name: 'package:shellpkg'
- keys: ['ShellPkg']
- - name: 'package:signedcapsulepkg'
- keys: ['SignedCapsulePkg']
- - name: 'package:sourceleveldebugpkg'
- keys: ['SourceLevelDebugPkg']
- - name: 'package:standalonemmpkg'
- keys: ['StandaloneMmPkg']
- - name: 'package:ueficpupkg'
- keys: ['UefiCpuPkg']
- - name: 'package:uefipayloadpkg'
- keys: ['UefiPayloadPkg']
- - name: 'package:unittestframeworkpkg'
- keys: ['UnitTestFrameworkPkg']
- - name: 'package:other'
- keys: ['Other']
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index 479440f..0000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-## @file
-# Dependabot configuration file to enable GitHub services for managing and updating
-# dependencies.
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-# Please see the documentation for all configuration options:
-# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
-##
-version: 2
-updates:
- - package-ecosystem: "pip"
- directory: "/"
- schedule:
- interval: "daily"
- commit-message:
- prefix: "pip"
- reviewers:
- - "makubacki"
- - "mdkinney"
- - "spbrogan"
- rebase-strategy: "disabled"
-
- - package-ecosystem: "github-actions"
- directory: "/"
- schedule:
- interval: "weekly"
- day: "monday"
- commit-message:
- prefix: "GitHub Action"
- reviewers:
- - "makubacki"
- - "mdkinney"
- - "spbrogan"
- rebase-strategy: "disabled"
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
deleted file mode 100644
index 3ecabed..0000000
--- a/.github/pull_request_template.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Description
-
-<_Include a description of the change and why this change was made._>
-
-<_For each item, place an "x" in between `[` and `]` if true. Example: `[x]` (you can also check items in GitHub UI)_>
-
-<_Create the PR as a Draft PR if it is only created to run CI checks._>
-
-<_Delete lines in \<\> tags before creating the PR._>
-
-- [ ] Breaking change?
- - **Breaking change** - Does this PR cause a break in build or boot behavior?
- - Examples: Does it add a new library class or move a module to a different repo.
-- [ ] Impacts security?
- - **Security** - Does this PR have a direct security impact?
- - Examples: Crypto algorithm change or buffer overflow fix.
-- [ ] Includes tests?
- - **Tests** - Does this PR include any explicit test code?
- - Examples: Unit tests or integration tests.
-
-## How This Was Tested
-
-<_Describe the test(s) that were run to verify the changes._>
-
-## Integration Instructions
-
-<_Describe how these changes should be integrated. Use N/A if nothing is required._>
diff --git a/.github/scripts/GitHub.py b/.github/scripts/GitHub.py
deleted file mode 100644
index c6de620..0000000
--- a/.github/scripts/GitHub.py
+++ /dev/null
@@ -1,288 +0,0 @@
-## @file
-# GitHub API helper functions.
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-
-import git
-import logging
-import re
-
-from collections import OrderedDict
-from edk2toollib.utility_functions import RunPythonScript
-from github import Auth, Github, GithubException
-from io import StringIO
-from typing import List
-
-
-"""GitHub API helper functions."""
-
-
-def _authenticate(token: str):
- """Authenticate to GitHub using a token.
-
- Returns a GitHub instance that is authenticated using the provided
- token.
-
- Args:
- token (str): The GitHub token to use for authentication.
-
- Returns:
- Github: A GitHub instance.
- """
- auth = Auth.Token(token)
- return Github(auth=auth)
-
-
-def _get_pr(token: str, owner: str, repo: str, pr_number: int):
- """Get the PR object from GitHub.
-
- Args:
- token (str): The GitHub token to use for authentication.
- owner (str): The GitHub owner (organization) name.
- repo (str): The GitHub repository name (e.g. 'edk2').
- pr_number (int): The pull request number.
-
- Returns:
- PullRequest: A PyGithub PullRequest object for the given pull request
- or None if the attempt to get the PR fails.
- """
- try:
- g = _authenticate(token)
- return g.get_repo(f"{owner}/{repo}").get_pull(pr_number)
- except GithubException as ge:
- print(
- f"::error title=Error Getting PR {pr_number} Info!::"
- f"{ge.data['message']}"
- )
- return None
-
-
-def leave_pr_comment(
- token: str, owner: str, repo: str, pr_number: int, comment_body: str
-):
- """Leaves a comment on a PR.
-
- Args:
- token (str): The GitHub token to use for authentication.
- owner (str): The GitHub owner (organization) name.
- repo (str): The GitHub repository name (e.g. 'edk2').
- pr_number (int): The pull request number.
- comment_body (str): The comment text. Markdown is supported.
- """
- if pr := _get_pr(token, owner, repo, pr_number):
- try:
- pr.create_issue_comment(comment_body)
- except GithubException as ge:
- print(
- f"::error title=Error Commenting on PR {pr_number}!::"
- f"{ge.data['message']}"
- )
-
-
-def get_reviewers_for_range(
- workspace_path: str,
- maintainer_file_path: str,
- range_start: str = "master",
- range_end: str = "HEAD",
-) -> List[str]:
- """Get the reviewers for the current branch.
-
- !!! note
- This function accepts a range of commits and returns the reviewers
- for that set of commits as a single list of GitHub usernames. To get
- the reviewers for a single commit, set `range_start` and `range_end`
- to the commit SHA.
-
- Args:
- workspace_path (str): The workspace path.
- maintainer_file_path (str): The maintainer file path.
- range_start (str, optional): The range start ref. Defaults to "master".
- range_end (str, optional): The range end ref. Defaults to "HEAD".
-
- Returns:
- List[str]: A list of GitHub usernames.
- """
- if range_start == range_end:
- commits = [range_start]
- else:
- commits = [
- c.hexsha
- for c in git.Repo(workspace_path).iter_commits(
- f"{range_start}..{range_end}"
- )
- ]
-
- raw_reviewers = []
- for commit_sha in commits:
- reviewer_stream_buffer = StringIO()
- cmd_ret = RunPythonScript(
- maintainer_file_path,
- f"-g {commit_sha}",
- workingdir=workspace_path,
- outstream=reviewer_stream_buffer,
- logging_level=logging.INFO,
- )
- if cmd_ret != 0:
- print(
- f"::error title=Reviewer Lookup Error!::Error calling "
- f"GetMaintainer.py: [{cmd_ret}]: "
- f"{reviewer_stream_buffer.getvalue()}"
- )
- return []
-
- commit_reviewers = reviewer_stream_buffer.getvalue()
-
- pattern = r"\[(.*?)\]"
- matches = re.findall(pattern, commit_reviewers)
- if not matches:
- return []
-
- print(
- f"::debug title=Commit {commit_sha[:7]} "
- f"Reviewer(s)::{', '.join(matches)}"
- )
-
- raw_reviewers.extend(matches)
-
- reviewers = list(OrderedDict.fromkeys([r.strip() for r in raw_reviewers]))
-
- print(f"::debug title=Total Reviewer Set::{', '.join(reviewers)}")
-
- return reviewers
-
-
-def get_pr_sha(token: str, owner: str, repo: str, pr_number: int) -> str:
- """Returns the commit SHA of given PR branch.
-
- This returns the SHA of the merge commit that GitHub creates from a
- PR branch. This commit contains all of the files in the PR branch in
- a single commit.
-
- Args:
- token (str): The GitHub token to use for authentication.
- owner (str): The GitHub owner (organization) name.
- repo (str): The GitHub repository name (e.g. 'edk2').
- pr_number (int): The pull request number.
-
- Returns:
- str: The commit SHA of the PR branch. An empty string is returned
- if the request fails.
- """
- if pr := _get_pr(token, owner, repo, pr_number):
- merge_commit_sha = pr.merge_commit_sha
- print(f"::debug title=PR {pr_number} Merge Commit SHA::{merge_commit_sha}")
- return merge_commit_sha
-
- return ""
-
-
-def add_reviewers_to_pr(
- token: str, owner: str, repo: str, pr_number: int, user_names: List[str]
-) -> List[str]:
- """Adds the set of GitHub usernames as reviewers to the PR.
-
- Args:
- token (str): The GitHub token to use for authentication.
- owner (str): The GitHub owner (organization) name.
- repo (str): The GitHub repository name (e.g. 'edk2').
- pr_number (int): The pull request number.
- user_names (List[str]): List of GitHub usernames to add as reviewers.
-
- Returns:
- List[str]: A list of GitHub usernames that were successfully added as
- reviewers to the PR. This list will exclude any reviewers
- from the list provided if they are not relevant to the PR.
- """
- if not user_names:
- print(
- "::debug title=No PR Reviewers Requested!::"
- "The list of PR reviewers is empty so not adding any reviewers."
- )
- return []
-
- try:
- g = _authenticate(token)
- repo_gh = g.get_repo(f"{owner}/{repo}")
- pr = repo_gh.get_pull(pr_number)
- except GithubException as ge:
- print(
- f"::error title=Error Getting PR {pr_number} Info!::"
- f"{ge.data['message']}"
- )
- return None
-
- # The pull request author cannot be a reviewer.
- pr_author = pr.user.login.strip()
-
- # The current PR reviewers do not need to be requested again.
- current_pr_requested_reviewers = [
- r.login.strip() for r in pr.get_review_requests()[0] if r
- ]
- current_pr_reviewed_reviewers = [
- r.user.login.strip() for r in pr.get_reviews() if r and r.user
- ]
- current_pr_reviewers = list(
- set(current_pr_requested_reviewers + current_pr_reviewed_reviewers)
- )
-
- # A user can only be added if they are a collaborator of the repository.
- repo_collaborators = [c.login.strip().lower() for c in repo_gh.get_collaborators() if c]
- non_collaborators = [u for u in user_names if u.lower() not in repo_collaborators]
-
- excluded_pr_reviewers = [pr_author] + current_pr_reviewers + non_collaborators
- new_pr_reviewers = [u for u in user_names if u not in excluded_pr_reviewers]
-
- # Notify the admins of the repository if non-collaborators are requested.
- if non_collaborators:
- print(
- f"::warning title=Non-Collaborator Reviewers Found!::"
- f"{', '.join(non_collaborators)}"
- )
-
- for comment in pr.get_issue_comments():
- # If a comment has already been made for these non-collaborators,
- # do not make another comment.
- if (
- comment.user
- and comment.user.login == "tianocore-assign-reviewers[bot]"
- and "WARNING: Cannot add some reviewers" in comment.body
- and all(u in comment.body for u in non_collaborators)
- ):
- break
- else:
- repo_admins = [
- a.login for a in repo_gh.get_collaborators(permission="admin") if a
- ]
-
- leave_pr_comment(
- token,
- owner,
- repo,
- pr_number,
- f"⚠ **WARNING: Cannot add some reviewers**: A user "
- f"specified as a reviewer for this PR is not a collaborator "
- f"of the repository. Please add them as a collaborator to "
- f"the repository so they can be requested in the future.\n\n"
- f"Non-collaborators requested:\n"
- f"{'\n'.join([f'- @{c}' for c in non_collaborators])}"
- f"\n\nAttn Admins:\n"
- f"{'\n'.join([f'- @{a}' for a in repo_admins])}\n---\n"
- f"**Admin Instructions:**\n"
- f"- Add the non-collaborators as collaborators to the "
- f"appropriate team(s) listed in "
- f"[teams](https://github.com/orgs/tianocore/teams)\n"
- f"- If they are no longer needed as reviewers, remove them "
- f"from [`Maintainers.txt`](https://github.com/tianocore/edk2/blob/HEAD/Maintainers.txt)",
- )
-
- # Add any new reviewers to the PR if needed.
- if new_pr_reviewers:
- print(
- f"::debug title=Adding New PR Reviewers::" f"{', '.join(new_pr_reviewers)}"
- )
-
- pr.create_review_request(reviewers=new_pr_reviewers)
-
- return new_pr_reviewers
diff --git a/.github/scripts/RequestPrReviewers.py b/.github/scripts/RequestPrReviewers.py
deleted file mode 100644
index fdff657..0000000
--- a/.github/scripts/RequestPrReviewers.py
+++ /dev/null
@@ -1,98 +0,0 @@
-## @file
-# Used in a CI workflow to request reviewers for a pull request.
-#
-# Refer to the following link for a list of pre-defined GitHub workflow
-# environment variables:
-# https://docs.github.com/actions/reference/environment-variables
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-
-import git
-import GitHub
-import os
-import sys
-
-
-"""Request Pull Request Reviewers Helpers"""
-
-
-def request_pr_reviewers():
- """Request pull request reviewers for a GitHub PR.
-
- This function is intended to be used in a GitHub Actions workflow to
- request reviewers for a pull request triggered by a GitHub event. The
- function makes assumptions about GitHub workflow environment variables and
- the pull request context in which it is run.
-
- The function will exit with a non-zero status indicating an error if a
- critical error occurs during execution so the workflow fails.
-
- The following environment variables are expected to be set before calling
- this function. The recommend GitHub context values are show for reference:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- ORG_NAME: ${{ github.repository_owner }}
- PR_NUMBER: ${{ github.event.number}}
- REPO_NAME: ${{ github.event.pull_request.base.repo.name }}
- TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}
- WORKSPACE_PATH: ${{ github.workspace }}
- """
- WORKSPACE_PATH = os.environ["WORKSPACE_PATH"]
- GET_MAINTAINER_LOCAL_PATH = os.path.join(
- WORKSPACE_PATH, os.environ["GET_MAINTAINER_REL_PATH"]
- )
-
- # Step 1: Get the GitHub created PR commit SHA (contains all changes in a single commit)
- pr_commit_sha = GitHub.get_pr_sha(
- os.environ["GH_TOKEN"],
- os.environ["ORG_NAME"],
- os.environ["REPO_NAME"],
- int(os.environ["PR_NUMBER"]),
- )
- if not pr_commit_sha:
- sys.exit(1)
-
- print(
- f"::notice title=PR Commit SHA::Looking at files in consolidated PR commit: {pr_commit_sha}"
- )
-
- # Step 2: Fetch only the PR commit to get the files changed in the PR
- git.Repo(WORKSPACE_PATH).remotes.origin.fetch(pr_commit_sha, depth=1)
-
- # Step 3: Get the list of reviewers for the PR
- reviewers = GitHub.get_reviewers_for_range(
- WORKSPACE_PATH, GET_MAINTAINER_LOCAL_PATH, pr_commit_sha, pr_commit_sha
- )
- if not reviewers:
- print("::notice title=No New Reviewers Found!::No reviewers found for this PR.")
- sys.exit(0)
-
- print(
- f"::notice title=Preliminary Reviewer List::Total reviewer candidates for "
- f"PR {os.environ['PR_NUMBER']}: {', '.join(reviewers)}"
- )
-
- # Step 4: Add the reviewers to the PR
- # Note the final requested reviewer list in the workflow run for reference
- new_reviewers = GitHub.add_reviewers_to_pr(
- os.environ["GH_TOKEN"],
- os.environ["ORG_NAME"],
- os.environ["REPO_NAME"],
- int(os.environ["PR_NUMBER"]),
- reviewers,
- )
- if new_reviewers:
- print(
- f"::notice title=New Reviewers Added::New reviewers requested for PR "
- f"{os.environ['PR_NUMBER']}: {', '.join(new_reviewers)}"
- )
- else:
- print(
- "::notice title=No New Reviewers Added::No reviewers were found that "
- "should be newly requested."
- )
-
-
-if __name__ == '__main__':
- request_pr_reviewers()
diff --git a/.github/scripts/requirements.txt b/.github/scripts/requirements.txt
deleted file mode 100644
index c589084..0000000
--- a/.github/scripts/requirements.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-## @file
-# GitHub Helpers Python PIP requirements file
-#
-# This file provides the list of python components used in GitHub scripts in this repository.
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-##
-
-edk2-pytool-library==0.*
-GitPython==3.*
-PyGithub==2.*
diff --git a/.github/workflows/BuildPlatform.yml b/.github/workflows/BuildPlatform.yml
deleted file mode 100644
index 4f8a527..0000000
--- a/.github/workflows/BuildPlatform.yml
+++ /dev/null
@@ -1,113 +0,0 @@
-# @file BuildPlatform.yml
-#
-# A reusable workflow that builds an EDKII platform and uploads it's artifacts.
-#
-##
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-##
-
-name: Build Platform
-
-on:
- workflow_call:
- inputs:
- python-version:
- required: true
- description: 'The version of Python to use for the job'
- type: string
- default: '3.12'
- runs-on:
- required: true
- description: 'The runner type to use for the job'
- type: string
- default: 'ubuntu-latest'
- build-file:
- required: true
- description: 'The path to the stuart build script'
- type: string
- tool-chain:
- required: true
- description: 'The tool chain to use for the build'
- type: string
- target:
- required: true
- description: 'The target to build'
- type: string
- extra-build-args:
- required: false
- description: 'Extra arguments to pass to the build script'
- type: string
- default: ''
- extra-pip-requirements:
- required: false
- description: 'Extra pip requirements to install'
- type: string
- default: ''
- extra-setup-cmd:
- required: false
- description: 'Extra setup commands to run'
- type: string
- default: ''
- extra-artifact-path:
- required: false
- description: 'Extra artifact paths to upload'
- type: string
- default: ''
-
-jobs:
- build:
- name: Build Platform
-
- runs-on: ${{ inputs.runs-on }}
- container:
- image: ${{ startswith(inputs.runs-on, 'ubuntu') && 'ghcr.io/tianocore/containers/fedora-40-dev:latest' || '' }}
-
- steps:
- - name: Checkout
- uses: actions/checkout@v6
-
- - run: |
- git config --global --add safe.directory '*'
- name: 'Set Safe Directory'
- if: ${{ startsWith(inputs.runs-on, 'ubuntu') }}
-
- - name: Set up Python ${{ inputs.python-version }}
- uses: actions/setup-python@v6
- with:
- python-version: ${{ inputs.python-version }}
- if: ${{ !startsWith(inputs.runs-on, 'ubuntu') }}
-
- - run: |
- pip install --upgrade ${{ inputs.extra-pip-requirements }} -r pip-requirements.txt
- name: 'Install/Upgrade pip modules'
-
- - run: ${{ inputs.extra-setup-cmd }}
- name: 'Extra Setup Commands'
- if: ${{ inputs.extra-setup-cmd != '' }}
-
- - run: |
- stuart_setup -c ${{ inputs.build-file }}
- name: 'Clone Submodules'
-
- - run: |
- stuart_update -c ${{ inputs.build-file }}
- name: 'Download External Dependencies'
-
- - run: |
- python BaseTools/Edk2ToolsBuild.py -t ${{ inputs.tool-chain }}
- name: 'Build BaseTools'
-
- - run: |
- stuart_build -c ${{ inputs.build-file }} TARGET=${{ inputs.target}} TOOL_CHAIN_TAG=${{ inputs.tool-chain }} ${{ inputs.extra-build-args }}
- name: 'Build Platform'
-
- - name: Upload Platform Build Logs
- uses: actions/upload-artifact@v6
- with:
- name: Platform Build Logs ${{ inputs.tool-chain }} ${{ inputs.target }} ${{ inputs.extra-build-args }}
- path: |
- Build/*.txt
- BaseTools/BaseToolsBuild/*
- ${{ inputs.extra-artifact-path }}
- if: always()
diff --git a/.github/workflows/auto-amazonq-review.yml b/.github/workflows/auto-amazonq-review.yml
deleted file mode 100644
index 98e349c..0000000
--- a/.github/workflows/auto-amazonq-review.yml
+++ /dev/null
@@ -1,277 +0,0 @@
-name: "AmazonQ Review after GitHub Copilot"
-
-on:
- # Triggered when GitHub Copilot workflows complete
- workflow_run:
- workflows:
- - "Periodic Code Cleanliness Review"
- - "Comprehensive Test Review with Playwright"
- - "Code Functionality and Documentation Review"
- - "Org-wide: Copilot Playwright Test, Review, Auto-fix, PR, Merge"
- - "Complete CI/CD Agent Review Pipeline"
- types:
- - completed
- workflow_dispatch:
-
-permissions:
- contents: write
- pull-requests: write
- issues: write
- actions: read
-
-jobs:
- wait-for-copilot-agents:
- runs-on: ubuntu-latest
- if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
- steps:
- - name: Checkout code
- uses: actions/checkout@main
-
- - name: Wait for any pending Copilot PRs
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- // Wait a bit for Copilot agents to potentially create PRs
- console.log('Waiting for Copilot agents to complete...');
- await new Promise(resolve => setTimeout(resolve, 30000)); // 30 second delay
-
- // Check for recent Copilot PRs
- const prs = await github.rest.pulls.list({
- owner: context.repo.owner,
- repo: context.repo.repo,
- state: 'open',
- sort: 'created',
- direction: 'desc',
- per_page: 10
- });
-
- const copilotPRs = prs.data.filter(pr =>
- pr.title.includes('Copilot') ||
- pr.head.ref.includes('copilot') ||
- pr.user.login === 'github-actions[bot]'
- );
-
- if (copilotPRs.length > 0) {
- console.log(`Found ${copilotPRs.length} recent Copilot PRs`);
- copilotPRs.forEach(pr => {
- console.log(` - PR #${pr.number}: ${pr.title}`);
- });
- } else {
- console.log('No recent Copilot PRs found');
- }
-
- amazonq-code-review:
- runs-on: ubuntu-latest
- needs: wait-for-copilot-agents
- steps:
- - name: Checkout code
- uses: actions/checkout@main
- with:
- fetch-depth: 0
-
- - name: Setup AWS credentials for Amazon Q
- uses: aws-actions/configure-aws-credentials@main
- with:
- aws-region: us-east-1
- # Note: AWS credentials should be configured in repository secrets
- # AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
- continue-on-error: true
-
- - name: Prepare code for Amazon Q review
- id: prepare
- run: |
- echo "## Amazon Q Code Review Preparation" > /tmp/amazonq-prep.md
- echo "" >> /tmp/amazonq-prep.md
- echo "Repository: ${{ github.repository }}" >> /tmp/amazonq-prep.md
- echo "Branch: ${{ github.ref_name }}" >> /tmp/amazonq-prep.md
- echo "Triggered by: ${{ github.event.workflow_run.name || 'Manual trigger' }}" >> /tmp/amazonq-prep.md
- echo "" >> /tmp/amazonq-prep.md
-
- # Get list of recent changes
- echo "### Recent Changes:" >> /tmp/amazonq-prep.md
- git log --oneline -10 >> /tmp/amazonq-prep.md || echo "No recent commits" >> /tmp/amazonq-prep.md
-
- echo "" >> /tmp/amazonq-prep.md
- echo "### Files Changed Recently:" >> /tmp/amazonq-prep.md
- git diff --name-only HEAD~5..HEAD 2>/dev/null >> /tmp/amazonq-prep.md || echo "No changes in last 5 commits" >> /tmp/amazonq-prep.md
-
- cat /tmp/amazonq-prep.md
-
- - name: Run Amazon Q Code Review
- id: amazonq
- run: |
- echo "Running Amazon Q code review..."
-
- # Create review report
- echo "## Amazon Q Code Review Report" > /tmp/amazonq-report.md
- echo "" >> /tmp/amazonq-report.md
- echo "**Review Date:** $(date -u +"%Y-%m-%d %H:%M:%S UTC")" >> /tmp/amazonq-report.md
- echo "" >> /tmp/amazonq-report.md
-
- # Note: This is a placeholder for actual Amazon Q integration
- # Amazon Q CLI or SDK integration would go here
- # For now, we'll create a comprehensive analysis structure
-
- echo "### Code Quality Assessment" >> /tmp/amazonq-report.md
- echo "" >> /tmp/amazonq-report.md
- echo "Following the GitHub Copilot agent reviews, Amazon Q provides additional insights:" >> /tmp/amazonq-report.md
- echo "" >> /tmp/amazonq-report.md
-
- # Analyze code structure
- echo "#### Code Structure Analysis" >> /tmp/amazonq-report.md
- find . -type f \( -name "*.py" -o -name "*.js" -o -name "*.ts" -o -name "*.java" -o -name "*.go" \) \
- ! -path "*/node_modules/*" \
- ! -path "*/.venv/*" \
- ! -path "*/dist/*" \
- ! -path "*/build/*" \
- | wc -l > /tmp/file_count.txt
-
- FILE_COUNT=$(cat /tmp/file_count.txt)
- echo "- Total source files analyzed: $FILE_COUNT" >> /tmp/amazonq-report.md
- echo "" >> /tmp/amazonq-report.md
-
- echo "#### Security Considerations" >> /tmp/amazonq-report.md
- echo "- Credential scanning: Check for hardcoded secrets" >> /tmp/amazonq-report.md
- echo "- Dependency vulnerabilities: Review package versions" >> /tmp/amazonq-report.md
- echo "- Code injection risks: Validate input handling" >> /tmp/amazonq-report.md
- echo "" >> /tmp/amazonq-report.md
-
- echo "#### Performance Optimization Opportunities" >> /tmp/amazonq-report.md
- echo "- Algorithm efficiency: Review computational complexity" >> /tmp/amazonq-report.md
- echo "- Resource management: Check for memory leaks and resource cleanup" >> /tmp/amazonq-report.md
- echo "- Caching opportunities: Identify repeated computations" >> /tmp/amazonq-report.md
- echo "" >> /tmp/amazonq-report.md
-
- echo "#### Architecture and Design Patterns" >> /tmp/amazonq-report.md
- echo "- Design patterns usage: Verify appropriate pattern application" >> /tmp/amazonq-report.md
- echo "- Separation of concerns: Check module boundaries" >> /tmp/amazonq-report.md
- echo "- Dependency management: Review coupling and cohesion" >> /tmp/amazonq-report.md
- echo "" >> /tmp/amazonq-report.md
-
- echo "### Integration with Previous Reviews" >> /tmp/amazonq-report.md
- echo "" >> /tmp/amazonq-report.md
- echo "This review complements the GitHub Copilot agent findings with:" >> /tmp/amazonq-report.md
- echo "- Additional security analysis" >> /tmp/amazonq-report.md
- echo "- AWS best practices recommendations" >> /tmp/amazonq-report.md
- echo "- Performance optimization suggestions" >> /tmp/amazonq-report.md
- echo "- Enterprise architecture patterns" >> /tmp/amazonq-report.md
- echo "" >> /tmp/amazonq-report.md
-
- echo "### Next Steps" >> /tmp/amazonq-report.md
- echo "" >> /tmp/amazonq-report.md
- echo "1. Review findings from both GitHub Copilot and Amazon Q" >> /tmp/amazonq-report.md
- echo "2. Prioritize issues based on severity and impact" >> /tmp/amazonq-report.md
- echo "3. Create action items for high-priority findings" >> /tmp/amazonq-report.md
- echo "4. Schedule follow-up reviews for resolved items" >> /tmp/amazonq-report.md
- echo "" >> /tmp/amazonq-report.md
-
- # Note: Actual Amazon Q integration would use AWS SDK or CLI
- # Example (when Amazon Q API is available):
- # aws codewhisperer review --repository-path . --output json > /tmp/amazonq-results.json
- # Or use Amazon Q Developer CLI when available
-
- cat /tmp/amazonq-report.md
- continue-on-error: true
-
- - name: Create Amazon Q Review Issue
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- const fs = require('fs');
- const report = fs.readFileSync('/tmp/amazonq-report.md', 'utf8');
-
- const date = new Date().toISOString().split('T')[0];
- const title = `Amazon Q Code Review - ${date}`;
-
- const body = `# Amazon Q Code Review Report
-
- This review was triggered after GitHub Copilot agent workflows completed.
-
- ${report}
-
- ## Review Context
-
- - **Triggered by:** ${{ github.event.workflow_run.name || 'Manual workflow dispatch' }}
- - **Repository:** ${{ github.repository }}
- - **Branch:** ${{ github.ref_name }}
- - **Commit:** ${{ github.sha }}
-
- ## Related Reviews
-
- Check for related issues with these labels:
- - \`code-cleanliness\` - Code structure and organization
- - \`test-coverage\` - Test quality and Playwright usage
- - \`documentation\` - Documentation completeness
-
- ## Instructions for Amazon Q Integration
-
- To enable full Amazon Q integration:
-
- 1. **Set up AWS credentials** in repository secrets:
- - \`AWS_ACCESS_KEY_ID\`
- - \`AWS_SECRET_ACCESS_KEY\`
-
- 2. **Install Amazon Q Developer CLI** (when available):
- - Follow AWS documentation for Amazon Q setup
- - Configure repository access
-
- 3. **Enable Amazon CodeWhisperer** for security scanning
-
- 4. **Configure custom review rules** based on your needs
-
- ## Action Items
-
- - [ ] Review Amazon Q findings
- - [ ] Compare with GitHub Copilot recommendations
- - [ ] Prioritize and assign issues
- - [ ] Implement high-priority fixes
- - [ ] Update documentation as needed
-
- ---
- *This issue was automatically generated by the Amazon Q Review workflow.*
- `;
-
- // Check for existing Amazon Q review issues
- const issues = await github.rest.issues.listForRepo({
- owner: context.repo.owner,
- repo: context.repo.repo,
- state: 'open',
- labels: ['amazon-q', 'automated'],
- per_page: 10
- });
-
- const recentIssue = issues.data.find(issue => {
- const createdAt = new Date(issue.created_at);
- const daysSinceCreation = (Date.now() - createdAt) / (1000 * 60 * 60 * 24);
- return daysSinceCreation < 7;
- });
-
- if (recentIssue) {
- console.log(`Recent issue found: #${recentIssue.number}, updating`);
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: recentIssue.number,
- body: `## Updated Review (${date})\n\n${report}`
- });
- } else {
- await github.rest.issues.create({
- owner: context.repo.owner,
- repo: context.repo.repo,
- title: title,
- body: body,
- labels: ['amazon-q', 'automated', 'code-review', 'needs-review']
- });
- }
-
- - name: Upload Amazon Q Report
- uses: actions/upload-artifact@main
- with:
- name: amazonq-review-report
- path: |
- /tmp/amazonq-report.md
- /tmp/amazonq-prep.md
- retention-days: 90
- continue-on-error: true
diff --git a/.github/workflows/auto-assign-copilot.yml b/.github/workflows/auto-assign-copilot.yml
deleted file mode 100644
index dae7007..0000000
--- a/.github/workflows/auto-assign-copilot.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-name: Auto Assign Copilot to Issues
-
-on:
- issues:
- types:
- - opened
- - labeled
-
-permissions:
- issues: write
-
-jobs:
- auto-assign:
- runs-on: ubuntu-latest
- permissions:
- issues: write
- if: contains(github.event.issue.labels.*.name, 'copilot')
- steps:
- - name: Assign Copilot to new issues
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- const copilotUsername = "copilot";
-
- // Check if issue is already assigned to copilot
- const currentAssignees = context.payload.issue.assignees.map(u => u.login);
-
- if (!currentAssignees.includes(copilotUsername)) {
- console.log(`Issue has 'copilot' label. Assigning @${copilotUsername}...`);
-
- try {
- await github.rest.issues.addAssignees({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- assignees: [copilotUsername]
- });
- console.log(`โ
Assigned @${copilotUsername} to issue #${context.issue.number}`);
- } catch (error) {
- console.log(`โ ๏ธ Failed to assign Copilot: ${error.message}`);
- console.log("Note: You must have a Copilot seat assigned to your account/org for this to work.");
- }
- } else {
- console.log(`โน๏ธ @${copilotUsername} is already assigned to issue #${context.issue.number}`);
- }
\ No newline at end of file
diff --git a/.github/workflows/auto-assign-pr.yml b/.github/workflows/auto-assign-pr.yml
deleted file mode 100644
index e3b1551..0000000
--- a/.github/workflows/auto-assign-pr.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-# Auto Assign Copilot (or any username) to every new pull request.
-# Tweak the username(s) below as needed!
-
-name: Auto Assign Copilot to PRs
-
-on:
- pull_request:
- types: [opened]
-
-permissions:
- issues: write
- pull-requests: write
-
-jobs:
- auto-assign:
- runs-on: ubuntu-latest
- permissions:
- issues: write
- pull-requests: write
- steps:
- - name: Assign Copilot (or others) to new PRs
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- // Assign PRs to Copilot or other users
- const copilotUsername = "copilot"; // <-- TUNE ME!
- const assignees = [copilotUsername]; // Or: ["copilot","anotheruser"]
- const currentAssignees = context.payload.pull_request.assignees.map(u => u.login);
- if (!assignees.every(a => currentAssignees.includes(a))) {
- await github.rest.issues.addAssignees({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.payload.pull_request.number,
- assignees
- });
- console.log(`Assigned ${assignees.join(", ")} to PR #${context.payload.pull_request.number}`);
- } else {
- console.log(`Already assigned: ${assignees.join(", ")} on PR #${context.payload.pull_request.number}`);
- }
\ No newline at end of file
diff --git a/.github/workflows/auto-bug-report.yml b/.github/workflows/auto-bug-report.yml
deleted file mode 100644
index bcae8f1..0000000
--- a/.github/workflows/auto-bug-report.yml
+++ /dev/null
@@ -1,19 +0,0 @@
----
-name: Bug report
-about: Create a bug report to help us improve
-title: "Bug: "
-labels: ["bug", "triage", "copilot"]
-assignees: ["copilot"] # <-- TUNE ME
----
-
-**Describe the bug**
-A clear and concise description of what the bug is.
-
-**To Reproduce**
-Steps to reproduce the behavior.
-
-**Expected behavior**
-A clear and concise description of what you expected to happen.
-
-**Additional context**
-Add any other context or screenshots about the bug here.
\ No newline at end of file
diff --git a/.github/workflows/auto-close-issues.yml b/.github/workflows/auto-close-issues.yml
deleted file mode 100644
index 5486c63..0000000
--- a/.github/workflows/auto-close-issues.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-name: "Close stale issues and PRs once a week"
-on:
- schedule:
- - cron: '0 0 * * 0'
-jobs:
- close_stale:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/stale@main
- with:
- days-before-stale: 21
- days-before-close: 7
- stale-issue-message: "This issue has been marked stale and will be closed in 7 days unless updated."
- close-issue-message: "Closing as stale, feel free to reopen!"
- stale-pr-message: "This PR has been marked stale and will be closed in 7 days unless updated."
- close-pr-message: "Closing as stale, feel free to reopen!"
- exempt-issue-labels: "pinned,security"
\ No newline at end of file
diff --git a/.github/workflows/auto-complete-cicd-review.yml b/.github/workflows/auto-complete-cicd-review.yml
deleted file mode 100644
index f1577bb..0000000
--- a/.github/workflows/auto-complete-cicd-review.yml
+++ /dev/null
@@ -1,424 +0,0 @@
-name: "Complete CI/CD Agent Review Pipeline"
-
-on:
- schedule:
- # Run every 12 hours (at 00:00 and 12:00 UTC)
- - cron: '0 0,12 * * *'
- push:
- branches:
- - main
- - master
- pull_request:
- types: [opened, synchronize, reopened]
- workflow_dispatch:
- inputs:
- skip_tests:
- description: 'Skip test execution'
- required: false
- default: 'false'
- type: boolean
- skip_docs:
- description: 'Skip documentation review'
- required: false
- default: 'false'
- type: boolean
-
-permissions:
- contents: write
- pull-requests: write
- issues: write
- checks: write
- actions: read
-
-jobs:
- # Step 1: Code Cleanliness Review
- code-cleanliness:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@main
- with:
- fetch-depth: 0
-
- - name: Run Code Cleanliness Analysis
- run: |
- echo "๐ Running code cleanliness analysis..."
-
- # Create results directory
- mkdir -p /tmp/review-results
-
- echo "## Code Cleanliness Analysis" > /tmp/review-results/cleanliness.md
- echo "" >> /tmp/review-results/cleanliness.md
-
- # Find large files
- echo "### Large Files (>500 lines):" >> /tmp/review-results/cleanliness.md
- find . -type f \( -name "*.py" -o -name "*.js" -o -name "*.ts" -o -name "*.java" -o -name "*.go" -o -name "*.cs" \) \
- ! -path "*/node_modules/*" ! -path "*/dist/*" ! -path "*/build/*" ! -path "*/.venv/*" \
- -exec sh -c 'lines=$(wc -l < "$1"); if [ "$lines" -gt 500 ]; then echo "$lines lines: $1"; fi' _ {} \; \
- | sort -rn >> /tmp/review-results/cleanliness.md || echo "No large files found" >> /tmp/review-results/cleanliness.md
-
- echo "โ
Code cleanliness analysis complete"
-
- - name: Upload Cleanliness Report
- uses: actions/upload-artifact@main
- with:
- name: cleanliness-report
- path: /tmp/review-results/cleanliness.md
- retention-days: 30
-
- # Step 2: Test Review and Execution
- test-review:
- runs-on: ubuntu-latest
- if: github.event.inputs.skip_tests != 'true'
- strategy:
- fail-fast: false
- matrix:
- test-type: [unit, integration, e2e]
- steps:
- - name: Checkout code
- uses: actions/checkout@main
-
- - name: Setup Test Environment
- run: |
- echo "๐งช Setting up test environment for ${{ matrix.test-type }} tests..."
- mkdir -p /tmp/review-results
-
- - name: Setup Node.js
- uses: actions/setup-node@main
- with:
- node-version: '20'
- continue-on-error: true
-
- - name: Setup Python
- uses: actions/setup-python@main
- with:
- python-version: '3.11'
- continue-on-error: true
-
- - name: Install Playwright for E2E
- if: matrix.test-type == 'e2e'
- run: |
- if [ -f "package.json" ]; then
- npm install
- npm install -D @playwright/test playwright
- npx playwright install --with-deps chromium firefox webkit
- fi
- pip install pytest playwright pytest-playwright
- python -m playwright install --with-deps chromium firefox webkit
- continue-on-error: true
-
- - name: Run Tests - ${{ matrix.test-type }}
- run: |
- echo "Running ${{ matrix.test-type }} tests..."
-
- case "${{ matrix.test-type }}" in
- unit)
- if [ -f "package.json" ] && grep -q '"test"' package.json; then
- npm test -- --testPathPattern="unit" || npm test || echo "Unit tests not configured"
- fi
- pytest tests/unit/ 2>/dev/null || echo "Python unit tests not configured"
- ;;
- integration)
- pytest tests/integration/ 2>/dev/null || echo "Integration tests not configured"
- npm test -- --testPathPattern="integration" 2>/dev/null || echo "JS integration tests not configured"
- ;;
- e2e)
- # Playwright tests
- npx playwright test 2>/dev/null || echo "Playwright JS tests not configured"
- pytest tests/e2e/ 2>/dev/null || pytest --browser chromium 2>/dev/null || echo "Playwright Python tests not configured"
- ;;
- esac
- continue-on-error: true
-
- - name: Upload Test Results
- uses: actions/upload-artifact@main
- if: always()
- with:
- name: test-results-${{ matrix.test-type }}
- path: |
- test-results/
- playwright-report/
- .pytest_cache/
- coverage/
- retention-days: 30
- continue-on-error: true
-
- # Step 3: Documentation Review
- documentation-review:
- runs-on: ubuntu-latest
- if: github.event.inputs.skip_docs != 'true'
- steps:
- - name: Checkout code
- uses: actions/checkout@main
-
- - name: Analyze Documentation
- run: |
- echo "๐ Analyzing documentation..."
-
- mkdir -p /tmp/review-results
-
- echo "## Documentation Analysis" > /tmp/review-results/documentation.md
- echo "" >> /tmp/review-results/documentation.md
-
- # Check for essential files
- echo "### Essential Documentation Files:" >> /tmp/review-results/documentation.md
- for doc in README.md CONTRIBUTING.md LICENSE.md CHANGELOG.md CODE_OF_CONDUCT.md SECURITY.md; do
- if [ -f "$doc" ]; then
- word_count=$(wc -w < "$doc" 2>/dev/null || echo 0)
- echo "โ
$doc ($word_count words)" >> /tmp/review-results/documentation.md
- else
- echo "โ $doc (missing)" >> /tmp/review-results/documentation.md
- fi
- done
-
- # Check README quality
- if [ -f "README.md" ]; then
- echo "" >> /tmp/review-results/documentation.md
- echo "### README.md Content Check:" >> /tmp/review-results/documentation.md
- for section in "Installation" "Usage" "Features" "Contributing" "License" "Documentation" "Examples" "API"; do
- if grep -qi "$section" README.md; then
- echo "โ
Contains '$section' section" >> /tmp/review-results/documentation.md
- else
- echo "โ ๏ธ Missing '$section' section" >> /tmp/review-results/documentation.md
- fi
- done
- fi
-
- echo "โ
Documentation analysis complete"
-
- - name: Upload Documentation Report
- uses: actions/upload-artifact@main
- with:
- name: documentation-report
- path: /tmp/review-results/documentation.md
- retention-days: 30
-
- # Step 4: Build and Functionality Check
- build-check:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@main
-
- - name: Setup Build Environment
- run: |
- echo "๐๏ธ Setting up build environment..."
-
- - name: Setup Node.js
- uses: actions/setup-node@main
- with:
- node-version: '20'
- continue-on-error: true
-
- - name: Setup Python
- uses: actions/setup-python@main
- with:
- python-version: '3.11'
- continue-on-error: true
-
- - name: Setup Go
- uses: actions/setup-go@main
- with:
- go-version: 'stable'
- continue-on-error: true
-
- - name: Build Project
- id: build
- run: |
- echo "BUILD_SUCCESS=false" >> $GITHUB_OUTPUT
-
- # Node.js
- if [ -f "package.json" ]; then
- npm install
- if grep -q '"build"' package.json; then
- npm run build && echo "BUILD_SUCCESS=true" >> $GITHUB_OUTPUT
- else
- echo "BUILD_SUCCESS=no-build-script" >> $GITHUB_OUTPUT
- fi
- fi
-
- # Python
- if [ -f "requirements.txt" ]; then
- pip install -r requirements.txt && echo "BUILD_SUCCESS=true" >> $GITHUB_OUTPUT
- fi
-
- # Go
- if [ -f "go.mod" ]; then
- go build ./... && echo "BUILD_SUCCESS=true" >> $GITHUB_OUTPUT
- fi
- continue-on-error: true
-
- - name: Upload Build Status
- run: |
- mkdir -p /tmp/review-results
- echo "## Build Status" > /tmp/review-results/build.md
- echo "" >> /tmp/review-results/build.md
- echo "Build result: ${{ steps.build.outputs.BUILD_SUCCESS }}" >> /tmp/review-results/build.md
-
- - name: Upload Build Report
- uses: actions/upload-artifact@main
- with:
- name: build-report
- path: /tmp/review-results/build.md
- retention-days: 30
-
- # Step 5: Consolidate Results and Create Report
- consolidate-results:
- runs-on: ubuntu-latest
- needs: [code-cleanliness, test-review, documentation-review, build-check]
- if: always()
- steps:
- - name: Checkout code
- uses: actions/checkout@main
-
- - name: Download All Reports
- uses: actions/download-artifact@main
- with:
- path: /tmp/all-reports
- continue-on-error: true
-
- - name: Consolidate Reports
- run: |
- echo "๐ Consolidating all reports..."
-
- mkdir -p /tmp/final-report
-
- cat > /tmp/final-report/complete-review.md << 'EOF'
- # Complete CI/CD Agent Review Report
-
- **Review Date:** $(date -u +"%Y-%m-%d %H:%M:%S UTC")
- **Repository:** ${{ github.repository }}
- **Branch:** ${{ github.ref_name }}
- **Trigger:** ${{ github.event_name }}
-
- ## Executive Summary
-
- This comprehensive review covers:
- - โ
Code cleanliness and file size analysis
- - โ
Test coverage and Playwright integration
- - โ
Documentation completeness and quality
- - โ
Build functionality verification
-
- EOF
-
- # Append individual reports
- if [ -d "/tmp/all-reports" ]; then
- echo "" >> /tmp/final-report/complete-review.md
- echo "## Detailed Findings" >> /tmp/final-report/complete-review.md
-
- for report in /tmp/all-reports/*/*.md; do
- if [ -f "$report" ]; then
- echo "" >> /tmp/final-report/complete-review.md
- cat "$report" >> /tmp/final-report/complete-review.md
- echo "" >> /tmp/final-report/complete-review.md
- fi
- done
- fi
-
- cat /tmp/final-report/complete-review.md
-
- - name: Create or Update Review Issue
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- const fs = require('fs');
- let report = '';
-
- try {
- report = fs.readFileSync('/tmp/final-report/complete-review.md', 'utf8');
- } catch (error) {
- report = '## Review Report\n\nError consolidating reports. Please check workflow logs.';
- }
-
- const date = new Date().toISOString().split('T')[0];
- const title = `Complete CI/CD Review - ${date}`;
-
- const body = `${report}
-
- ## Next Steps - Amazon Q Review
-
- After reviewing these GitHub Copilot agent findings, Amazon Q will provide additional insights:
- - Security analysis
- - Performance optimization opportunities
- - AWS best practices
- - Enterprise architecture patterns
-
- ## Action Items Summary
-
- - [ ] Review and address code cleanliness issues
- - [ ] Fix or improve test coverage
- - [ ] Update documentation as needed
- - [ ] Resolve build issues
- - [ ] Wait for Amazon Q review for additional insights
-
- ---
- *This issue was automatically generated by the Complete CI/CD Review workflow.*
- *Amazon Q review will follow automatically.*
- `;
-
- // Check for existing review issues
- const issues = await github.rest.issues.listForRepo({
- owner: context.repo.owner,
- repo: context.repo.repo,
- state: 'open',
- labels: ['ci-cd-review', 'automated'],
- per_page: 10
- });
-
- const recentIssue = issues.data.find(issue => {
- const createdAt = new Date(issue.created_at);
- const hoursSinceCreation = (Date.now() - createdAt) / (1000 * 60 * 60);
- return hoursSinceCreation < 24;
- });
-
- if (recentIssue) {
- console.log(`Recent issue found: #${recentIssue.number}, updating`);
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: recentIssue.number,
- body: `## Updated Review (${date})\n\n${report}`
- });
- } else {
- await github.rest.issues.create({
- owner: context.repo.owner,
- repo: context.repo.repo,
- title: title,
- body: body,
- labels: ['ci-cd-review', 'automated', 'needs-review']
- });
- }
-
- - name: Upload Final Report
- uses: actions/upload-artifact@main
- with:
- name: complete-review-report
- path: /tmp/final-report/complete-review.md
- retention-days: 90
-
- # Step 6: Trigger Amazon Q Review
- trigger-amazonq:
- runs-on: ubuntu-latest
- needs: consolidate-results
- if: always()
- steps:
- - name: Trigger Amazon Q Review Workflow
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- console.log('Triggering Amazon Q review workflow...');
-
- try {
- await github.rest.actions.createWorkflowDispatch({
- owner: context.repo.owner,
- repo: context.repo.repo,
- workflow_id: 'auto-amazonq-review.yml',
- ref: context.ref
- });
- console.log('โ
Amazon Q review workflow triggered successfully');
- } catch (error) {
- console.log(`โ ๏ธ Could not trigger Amazon Q review: ${error.message}`);
- console.log('Amazon Q workflow may not be installed yet');
- }
diff --git a/.github/workflows/auto-copilot-code-cleanliness-review.yml b/.github/workflows/auto-copilot-code-cleanliness-review.yml
deleted file mode 100644
index b0ce8f9..0000000
--- a/.github/workflows/auto-copilot-code-cleanliness-review.yml
+++ /dev/null
@@ -1,245 +0,0 @@
-name: "Periodic Code Cleanliness Review"
-
-# REQUIREMENTS:
-# - A GitHub Personal Access Token with Copilot access must be created and stored as a repository secret named COPILOT_TOKEN
-# - See COPILOT_TOKEN_SETUP.md for detailed setup instructions
-
-on:
- schedule:
- # Run every 12 hours (at 00:00 and 12:00 UTC)
- - cron: '0 0,12 * * *'
- workflow_dispatch: # Allow manual trigger
-
-permissions:
- contents: write
- pull-requests: write
- issues: write
-
-jobs:
- code-cleanliness-review:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@main
- with:
- fetch-depth: 0 # Full history for better analysis
-
- - name: Analyze Large Files
- id: analyze
- run: |
- echo "## Large Files Analysis" > /tmp/analysis.md
- echo "" >> /tmp/analysis.md
- echo "Files larger than 500 lines that may benefit from splitting:" >> /tmp/analysis.md
- echo "" >> /tmp/analysis.md
-
- # Find files larger than 500 lines (excluding common large files)
- find . -type f \( -name "*.py" -o -name "*.js" -o -name "*.ts" -o -name "*.java" -o -name "*.go" -o -name "*.cs" -o -name "*.rb" \) \
- ! -path "*/node_modules/*" \
- ! -path "*/dist/*" \
- ! -path "*/build/*" \
- ! -path "*/.venv/*" \
- ! -path "*/vendor/*" \
- -exec wc -l {} \; | \
- awk '$1 > 500 {print $1 " lines: " $2}' | \
- sort -rn >> /tmp/analysis.md || echo "No large files found" >> /tmp/analysis.md
-
- echo "" >> /tmp/analysis.md
- echo "## Code Complexity Analysis" >> /tmp/analysis.md
- echo "" >> /tmp/analysis.md
- echo "Files with potential complexity issues:" >> /tmp/analysis.md
-
- # Find files with many functions/classes (basic heuristic)
- for ext in py js ts java go cs rb; do
- if [ "$ext" = "py" ]; then
- pattern="^def |^class "
- elif [ "$ext" = "js" ] || [ "$ext" = "ts" ]; then
- pattern="^function |^class |const.*=.*=>|function.*{$"
- else
- pattern="^class |^def |^func "
- fi
-
- find . -type f -name "*.$ext" \
- ! -path "*/node_modules/*" \
- ! -path "*/dist/*" \
- ! -path "*/build/*" \
- ! -path "*/.venv/*" \
- ! -path "*/vendor/*" \
- -exec sh -c 'count=$(grep -c "$1" "$2" 2>/dev/null || echo 0); if [ "$count" -gt 20 ]; then echo "$count definitions in $2"; fi' _ "$pattern" {} \; \
- 2>/dev/null || true
- done | sort -rn >> /tmp/analysis.md
-
- cat /tmp/analysis.md
-
- # NOTE: Commented out due to potentially non-existent action github/copilot-cli-action@main
- # This action may not exist in the GitHub marketplace (similar to copilot-cli-actions)
- # - name: GitHub Copilot Code Review
- # uses: github/copilot-cli-action@main
- # with:
- # query: |
- # Review the codebase for code cleanliness issues:
- # 1. Identify files that are too large (>500 lines) and suggest how to split them into smaller, focused modules
- # 2. Look for code duplication and suggest refactoring opportunities
- # 3. Check for consistent code style and formatting
- # 4. Identify complex functions that could be simplified
- # 5. Suggest improvements for code organization and structure
- # 6. Check for proper separation of concerns
- #
- # Provide actionable recommendations with specific file names and line numbers.
- # env:
- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- # continue-on-error: true
- - name: GitHub Copilot Code Review
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- // Simulate code cleanliness review with file analysis
- const fs = require('fs');
- const { execSync } = require('child_process');
-
- console.log("Performing code cleanliness review...");
-
- let cleanlinessReview = `## Code Cleanliness Review Results\n\n`;
-
- try {
- // Analyze file sizes
- const largeFiles = execSync("find . -name '*.py' -o -name '*.js' -o -name '*.ts' -o -name '*.c' -o -name '*.cpp' | xargs wc -l | sort -rn | head -10").toString().trim().split('\n');
-
- cleanlinessReview += `### File Size Analysis\n`;
- cleanlinessReview += `Top files by line count:\n`;
- largeFiles.forEach(line => {
- const parts = line.trim().split(/\s+/);
- if (parts.length >= 2 && !isNaN(parts[0])) {
- const lineCount = parseInt(parts[0]);
- const filename = parts.slice(1).join(' ');
- if (lineCount > 500) {
- cleanlinessReview += `- โ ๏ธ ${filename}: ${lineCount} lines (consider splitting)\n`;
- } else if (lineCount > 200) {
- cleanlinessReview += `- โ
${filename}: ${lineCount} lines (acceptable)\n`;
- }
- }
- });
-
- cleanlinessReview += `\n### Code Organization Recommendations\n`;
- cleanlinessReview += `- Split large files (>500 lines) into smaller, focused modules\n`;
- cleanlinessReview += `- Extract common functionality into utility modules\n`;
- cleanlinessReview += `- Ensure proper separation of concerns\n`;
- cleanlinessReview += `- Use consistent naming conventions throughout the codebase\n`;
-
- cleanlinessReview += `\n### Code Quality Suggestions\n`;
- cleanlinessReview += `- Remove commented-out code blocks\n`;
- cleanlinessReview += `- Eliminate code duplication through refactoring\n`;
- cleanlinessReview += `- Add proper error handling and logging\n`;
- cleanlinessReview += `- Ensure consistent code formatting and style\n`;
- cleanlinessReview += `- Break down complex functions into smaller, testable units\n`;
-
- // Check for potential code smells
- try {
- const todoCount = execSync("grep -r 'TODO\\|FIXME\\|HACK' --include='*.py' --include='*.js' --include='*.ts' --include='*.c' . | wc -l").toString().trim();
- if (parseInt(todoCount) > 0) {
- cleanlinessReview += `\n### Technical Debt\n`;
- cleanlinessReview += `- Found ${todoCount} TODO/FIXME/HACK comments\n`;
- cleanlinessReview += `- Consider addressing these technical debt items\n`;
- }
- } catch (error) {
- // Ignore if grep fails
- }
-
- } catch (error) {
- cleanlinessReview += `Code cleanliness review completed with basic recommendations.\n`;
- }
-
- // Append to existing analysis file
- try {
- const existingAnalysis = fs.readFileSync('/tmp/analysis.md', 'utf8');
- fs.writeFileSync('/tmp/analysis.md', existingAnalysis + '\n\n' + cleanlinessReview);
- } catch (error) {
- fs.writeFileSync('/tmp/analysis.md', cleanlinessReview);
- }
-
- console.log("Code cleanliness review completed");
- uses: austenstone/copilot-cli-action@v2
- with:
- copilot-token: ${{ secrets.COPILOT_TOKEN }}
- prompt: |
- Review the codebase for code cleanliness issues:
- 1. Identify files that are too large (>500 lines) and suggest how to split them into smaller, focused modules
- 2. Look for code duplication and suggest refactoring opportunities
- 3. Check for consistent code style and formatting
- 4. Identify complex functions that could be simplified
- 5. Suggest improvements for code organization and structure
- 6. Check for proper separation of concerns
-
- Provide actionable recommendations with specific file names and line numbers.
- continue-on-error: true
-
- - name: Create Issue for Code Cleanliness Review
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- const fs = require('fs');
- const analysis = fs.readFileSync('/tmp/analysis.md', 'utf8');
-
- const date = new Date().toISOString().split('T')[0];
- const title = `Code Cleanliness Review - ${date}`;
-
- const body = `# Periodic Code Cleanliness Review
-
- This is an automated review conducted every 12 hours to maintain code quality.
-
- ${analysis}
-
- ## Recommendations
-
- Please review the analysis above and:
- 1. Split large files (>500 lines) into smaller, focused modules
- 2. Refactor complex functions into smaller, testable units
- 3. Remove code duplication
- 4. Ensure consistent code style
- 5. Improve code organization and structure
-
- ## Next Steps
-
- - Assign this issue to relevant team members
- - Create follow-up PRs to address findings
- - Document any architectural decisions
-
- ---
- *This issue was automatically generated by the Code Cleanliness Review workflow.*
- `;
-
- // Check if similar issue exists (open, created in last 24 hours)
- const issues = await github.rest.issues.listForRepo({
- owner: context.repo.owner,
- repo: context.repo.repo,
- state: 'open',
- labels: ['code-cleanliness', 'automated'],
- per_page: 10
- });
-
- const recentIssue = issues.data.find(issue => {
- const createdAt = new Date(issue.created_at);
- const hoursSinceCreation = (Date.now() - createdAt) / (1000 * 60 * 60);
- return hoursSinceCreation < 24;
- });
-
- if (recentIssue) {
- console.log(`Recent issue found: #${recentIssue.number}, skipping creation`);
- // Update existing issue with new analysis
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: recentIssue.number,
- body: `## Updated Analysis (${date})\n\n${analysis}`
- });
- } else {
- // Create new issue
- await github.rest.issues.create({
- owner: context.repo.owner,
- repo: context.repo.repo,
- title: title,
- body: body,
- labels: ['code-cleanliness', 'automated', 'needs-review']
- });
- }
diff --git a/.github/workflows/auto-copilot-functionality-docs-review.yml b/.github/workflows/auto-copilot-functionality-docs-review.yml
deleted file mode 100644
index 5fe1efc..0000000
--- a/.github/workflows/auto-copilot-functionality-docs-review.yml
+++ /dev/null
@@ -1,398 +0,0 @@
-name: "Code Functionality and Documentation Review"
-
-on:
- push:
- branches:
- - main
- - master
- pull_request:
- types: [opened, synchronize, reopened]
- workflow_dispatch:
-
-permissions:
- contents: write
- pull-requests: write
- issues: write
-
-jobs:
- functionality-check:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@main
-
- - name: Setup Node.js
- uses: actions/setup-node@main
- with:
- node-version: '20'
- continue-on-error: true
-
- - name: Setup Python
- uses: actions/setup-python@main
- with:
- python-version: '3.11'
- continue-on-error: true
-
- - name: Setup Go
- uses: actions/setup-go@main
- with:
- go-version: 'stable'
- continue-on-error: true
-
- - name: Install Dependencies and Build
- id: build
- run: |
- echo "BUILD_STATUS=unknown" >> $GITHUB_OUTPUT
-
- # Node.js project
- if [ -f "package.json" ]; then
- echo "Detected Node.js project"
- npm install || echo "npm install failed"
-
- if grep -q '"build"' package.json; then
- npm run build && echo "BUILD_STATUS=success" >> $GITHUB_OUTPUT || echo "BUILD_STATUS=failed" >> $GITHUB_OUTPUT
- else
- echo "BUILD_STATUS=no-build-script" >> $GITHUB_OUTPUT
- fi
- fi
-
- # Python project
- if [ -f "requirements.txt" ] || [ -f "setup.py" ] || [ -f "pyproject.toml" ]; then
- echo "Detected Python project"
- if [ -f "requirements.txt" ]; then
- pip install -r requirements.txt || echo "pip install failed"
- fi
- if [ -f "setup.py" ]; then
- pip install -e . || echo "setup.py install failed"
- fi
- echo "BUILD_STATUS=success" >> $GITHUB_OUTPUT
- fi
-
- # Go project
- if [ -f "go.mod" ]; then
- echo "Detected Go project"
- go build ./... && echo "BUILD_STATUS=success" >> $GITHUB_OUTPUT || echo "BUILD_STATUS=failed" >> $GITHUB_OUTPUT
- fi
-
- # Java/Maven project
- if [ -f "pom.xml" ]; then
- echo "Detected Maven project"
- mvn clean compile && echo "BUILD_STATUS=success" >> $GITHUB_OUTPUT || echo "BUILD_STATUS=failed" >> $GITHUB_OUTPUT
- fi
-
- # Gradle project
- if [ -f "build.gradle" ] || [ -f "build.gradle.kts" ]; then
- echo "Detected Gradle project"
- ./gradlew build -x test && echo "BUILD_STATUS=success" >> $GITHUB_OUTPUT || echo "BUILD_STATUS=failed" >> $GITHUB_OUTPUT
- fi
- continue-on-error: true
-
- - name: Run Basic Functionality Tests
- run: |
- # Try to run tests if they exist
- if [ -f "package.json" ] && grep -q '"test"' package.json; then
- npm test || echo "Tests failed or not configured"
- fi
-
- if [ -f "pytest.ini" ] || [ -d "tests" ]; then
- pytest || echo "Pytest tests failed or not configured"
- fi
-
- if [ -f "go.mod" ]; then
- go test ./... || echo "Go tests failed or not configured"
- fi
- continue-on-error: true
-
- documentation-review:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@main
-
- - name: Analyze Documentation
- id: doc-analysis
- run: |
- echo "## Documentation Analysis" > /tmp/doc-analysis.md
- echo "" >> /tmp/doc-analysis.md
-
- # Check for main documentation files
- echo "### Main Documentation Files:" >> /tmp/doc-analysis.md
- for doc in README.md CONTRIBUTING.md LICENSE.md CHANGELOG.md CODE_OF_CONDUCT.md SECURITY.md; do
- if [ -f "$doc" ]; then
- echo "โ
$doc exists" >> /tmp/doc-analysis.md
- else
- echo "โ $doc is missing" >> /tmp/doc-analysis.md
- fi
- done
-
- echo "" >> /tmp/doc-analysis.md
- echo "### README.md Quality Check:" >> /tmp/doc-analysis.md
-
- if [ -f "README.md" ]; then
- word_count=$(wc -w < README.md)
- echo "- Word count: $word_count" >> /tmp/doc-analysis.md
-
- if [ $word_count -lt 50 ]; then
- echo "โ ๏ธ README.md is very short (< 50 words)" >> /tmp/doc-analysis.md
- else
- echo "โ
README.md has adequate content" >> /tmp/doc-analysis.md
- fi
-
- # Check for common sections
- for section in "Installation" "Usage" "Features" "Contributing" "License" "Documentation"; do
- if grep -qi "$section" README.md; then
- echo "โ
Contains '$section' section" >> /tmp/doc-analysis.md
- else
- echo "โ ๏ธ Missing '$section' section" >> /tmp/doc-analysis.md
- fi
- done
- else
- echo "โ README.md does not exist" >> /tmp/doc-analysis.md
- fi
-
- echo "" >> /tmp/doc-analysis.md
- echo "### Additional Documentation:" >> /tmp/doc-analysis.md
-
- # Find all markdown files
- find . -name "*.md" \
- ! -path "*/node_modules/*" \
- ! -path "*/.venv/*" \
- ! -path "*/vendor/*" \
- -type f | while read -r file; do
- echo "- $file" >> /tmp/doc-analysis.md
- done || echo "No additional markdown files found" >> /tmp/doc-analysis.md
-
- echo "" >> /tmp/doc-analysis.md
- echo "### Code with Missing Documentation:" >> /tmp/doc-analysis.md
-
- # Check for undocumented functions/classes (basic heuristic)
- # Python
- if find . -name "*.py" ! -path "*/.venv/*" ! -path "*/node_modules/*" | grep -q .; then
- echo "" >> /tmp/doc-analysis.md
- echo "#### Python files:" >> /tmp/doc-analysis.md
- find . -name "*.py" \
- ! -path "*/.venv/*" \
- ! -path "*/node_modules/*" \
- ! -path "*/dist/*" \
- ! -name "__init__.py" \
- -type f | while read -r file; do
- # Count functions and classes
- func_count=$(grep -c "^def " "$file" 2>/dev/null || echo 0)
- class_count=$(grep -c "^class " "$file" 2>/dev/null || echo 0)
- docstring_count=$(grep -c '"""' "$file" 2>/dev/null || echo 0)
-
- total=$((func_count + class_count))
- if [ $total -gt 0 ] && [ $docstring_count -eq 0 ]; then
- echo "โ ๏ธ $file: $total definitions, no docstrings" >> /tmp/doc-analysis.md
- fi
- done
- fi
-
- # JavaScript/TypeScript
- if find . \( -name "*.js" -o -name "*.ts" \) ! -path "*/node_modules/*" ! -path "*/dist/*" | grep -q .; then
- echo "" >> /tmp/doc-analysis.md
- echo "#### JavaScript/TypeScript files:" >> /tmp/doc-analysis.md
- find . \( -name "*.js" -o -name "*.ts" \) \
- ! -path "*/node_modules/*" \
- ! -path "*/dist/*" \
- ! -path "*/build/*" \
- -type f | while read -r file; do
- # Count functions and classes
- func_count=$(grep -cE "(^function |^export function |^const .* = .*=>)" "$file" 2>/dev/null || echo 0)
- class_count=$(grep -c "^class " "$file" 2>/dev/null || echo 0)
- jsdoc_count=$(grep -c '/\*\*' "$file" 2>/dev/null || echo 0)
-
- total=$((func_count + class_count))
- if [ $total -gt 5 ] && [ $jsdoc_count -eq 0 ]; then
- echo "โ ๏ธ $file: ~$total definitions, no JSDoc comments" >> /tmp/doc-analysis.md
- fi
- done
- fi
-
- cat /tmp/doc-analysis.md
-
- # NOTE: Commented out due to non-existent action github/copilot-cli-actions@v1
- # This action does not exist in the GitHub marketplace
- # - name: GitHub Copilot Documentation Review
- # uses: github/copilot-cli-actions@v1
- # with:
- # query: |
- # Review the documentation for this repository:
- # 1. Check README.md completeness and quality
- # 2. Verify all features and functionality are documented
- # 3. Check for installation and usage instructions
- # 4. Identify missing or outdated documentation
- # 5. Suggest improvements for clarity and completeness
- # 6. Verify code comments and inline documentation
- # 7. Check for API documentation if applicable
- # 8. Ensure contributing guidelines are present
- #
- # Provide specific recommendations with file names and sections.
- # env:
- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- # continue-on-error: true
- - name: GitHub Copilot Documentation Review
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- // Simulate documentation review with file analysis
- const fs = require('fs');
- const { execSync } = require('child_process');
-
- console.log("Performing documentation review...");
-
- let docReview = `## Documentation Review Results\n\n`;
-
- try {
- // Check for key documentation files
- const docFiles = ['README.md', 'CONTRIBUTING.md', 'LICENSE', 'CHANGELOG.md', 'docs/'];
-
- docReview += `### Documentation Completeness\n`;
-
- docFiles.forEach(file => {
- try {
- const exists = fs.existsSync(file) || fs.existsSync(`./${file}`);
- docReview += `- ${file}: ${exists ? 'โ
Present' : 'โ Missing'}\n`;
- } catch (error) {
- docReview += `- ${file}: โ Unable to check\n`;
- }
- });
-
- docReview += `\n### Recommendations\n`;
- docReview += `- Ensure README.md includes installation instructions\n`;
- docReview += `- Add usage examples and code snippets\n`;
- docReview += `- Include API documentation for public interfaces\n`;
- docReview += `- Add contributing guidelines for new contributors\n`;
- docReview += `- Consider adding inline code comments for complex logic\n`;
-
- // Check for Python docstrings
- try {
- const pyFiles = execSync("find . -name '*.py' | head -5").toString().trim().split('\n').filter(f => f);
- if (pyFiles.length > 0) {
- docReview += `\n### Python Documentation\n`;
- docReview += `- Found ${pyFiles.length} Python files\n`;
- docReview += `- Recommend adding docstrings to all functions and classes\n`;
- }
- } catch (error) {
- // Ignore if no Python files found
- }
-
- } catch (error) {
- docReview += `Documentation review completed with basic recommendations.\n`;
- }
-
- // Append to existing analysis file
- try {
- const existingAnalysis = fs.readFileSync('/tmp/doc-analysis.md', 'utf8');
- fs.writeFileSync('/tmp/doc-analysis.md', existingAnalysis + '\n\n' + docReview);
- } catch (error) {
- fs.writeFileSync('/tmp/doc-analysis.md', docReview);
- }
-
- console.log("Documentation review completed");
- uses: austenstone/copilot-cli-action@v2
- with:
- copilot-token: ${{ secrets.COPILOT_TOKEN }}
- prompt: |
- Review the documentation for this repository:
- 1. Check README.md completeness and quality
- 2. Verify all features and functionality are documented
- 3. Check for installation and usage instructions
- 4. Identify missing or outdated documentation
- 5. Suggest improvements for clarity and completeness
- 6. Verify code comments and inline documentation
- 7. Check for API documentation if applicable
- 8. Ensure contributing guidelines are present
-
- Provide specific recommendations with file names and sections.
- continue-on-error: true
-
- - name: Create Documentation Review Report
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- const fs = require('fs');
- const analysis = fs.readFileSync('/tmp/doc-analysis.md', 'utf8');
-
- const date = new Date().toISOString().split('T')[0];
- const title = `Code Functionality & Documentation Review - ${date}`;
-
- const buildStatus = process.env.BUILD_STATUS || 'unknown';
- const buildEmoji = buildStatus === 'success' ? 'โ
' :
- buildStatus === 'failed' ? 'โ' : 'โ ๏ธ';
-
- const body = `# Code Functionality and Documentation Review
-
- ## Build Status: ${buildEmoji} ${buildStatus}
-
- ${analysis}
-
- ## Functionality Review
-
- - Build status: ${buildStatus}
- - Tests execution: See workflow logs for details
-
- ## Recommendations
-
- ### Documentation:
- 1. **Complete README.md** with all required sections
- 2. **Add missing documentation files** (CONTRIBUTING.md, CHANGELOG.md, etc.)
- 3. **Document all public APIs** and exported functions
- 4. **Add inline code comments** for complex logic
- 5. **Create usage examples** and tutorials
- 6. **Update outdated documentation** to match current code
-
- ### Functionality:
- 1. **Ensure code builds successfully** in CI environment
- 2. **Fix any broken functionality** identified in tests
- 3. **Add error handling** and validation
- 4. **Verify all features work as documented**
-
- ## Action Items
-
- - [ ] Add/update missing documentation files
- - [ ] Improve README.md quality and completeness
- - [ ] Add code comments and docstrings
- - [ ] Fix build issues if any
- - [ ] Verify all features are documented
-
- ---
- *This issue was automatically generated by the Functionality & Documentation Review workflow.*
- `;
-
- // Check for existing issues
- const issues = await github.rest.issues.listForRepo({
- owner: context.repo.owner,
- repo: context.repo.repo,
- state: 'open',
- labels: ['documentation', 'automated'],
- per_page: 10
- });
-
- const recentIssue = issues.data.find(issue => {
- const createdAt = new Date(issue.created_at);
- const daysSinceCreation = (Date.now() - createdAt) / (1000 * 60 * 60 * 24);
- return daysSinceCreation < 7;
- });
-
- if (recentIssue) {
- console.log(`Recent issue found: #${recentIssue.number}, updating`);
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: recentIssue.number,
- body: `## Updated Analysis (${date})\n\nBuild Status: ${buildEmoji} ${buildStatus}\n\n${analysis}`
- });
- } else {
- await github.rest.issues.create({
- owner: context.repo.owner,
- repo: context.repo.repo,
- title: title,
- body: body,
- labels: ['documentation', 'functionality', 'automated', 'needs-review']
- });
- }
- env:
- BUILD_STATUS: ${{ steps.build.outputs.BUILD_STATUS }}
diff --git a/.github/workflows/auto-copilot-org-playwright-loop.yaml b/.github/workflows/auto-copilot-org-playwright-loop.yaml
deleted file mode 100644
index 1847431..0000000
--- a/.github/workflows/auto-copilot-org-playwright-loop.yaml
+++ /dev/null
@@ -1,130 +0,0 @@
-name: "Org-wide: Copilot Playwright Test, Review, Auto-fix, PR, Merge"
-
-on:
- push:
- branches:
- - main
- - master
-
-jobs:
- playwright-review-fix:
- runs-on: ubuntu-latest
- steps:
- # Checkout repository code
- - name: Checkout code
- uses: actions/checkout@main
-
- # Set up Python (change/add for other stacks!)
- - name: Setup Python
- uses: actions/setup-python@main
- with:
- python-version: "3.11"
-
- # Install dependencies (Python example)
- - name: Install dependencies
- run: |
- pip install -r requirements.txt
- pip install pytest playwright pytest-playwright
-
- # Install Playwright browsers
- - name: Install Playwright browsers
- run: |
- python -m playwright install
-
- # Run Playwright tests
- - name: Run Playwright Tests
- run: |
- pytest tests/ || exit 1
- continue-on-error: true
-
- # Copilot PR Agent auto-review (if available for org)
- - name: Copilot PR Agent Review
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- // Simulate PR review functionality
- console.log("Performing automated PR review...");
-
- const prReview = `
- ## Automated PR Review Results
-
- ### Code Quality Assessment
- - โ
Code follows project conventions
- - โ
No obvious security issues detected
- - โ
Tests are included for new functionality
-
- ### Recommendations
- - Ensure all tests pass before merging
- - Verify documentation is updated
- - Check for proper error handling
-
- ### Playwright Test Analysis
- - Tests should cover critical user paths
- - Ensure tests are stable and not flaky
- - Verify cross-browser compatibility
- `;
-
- console.log("PR review completed");
- console.log(prReview);
- continue-on-error: true
-
- # Copilot Agent auto-fix (can loop up to N attempts if tests fail)
- - name: Copilot Auto-fix Failing Playwright Tests
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- // Simulate auto-fix functionality
- console.log("Attempting to auto-fix failing tests...");
-
- const maxAttempts = 3;
- let currentAttempt = 1;
-
- const fixStrategies = [
- "Update selectors to use more stable locators",
- "Add proper wait conditions for dynamic content",
- "Increase timeout values for slow operations"
- ];
-
- console.log(`Starting auto-fix process (max attempts: ${maxAttempts})`);
-
- fixStrategies.forEach((strategy, index) => {
- if (index < maxAttempts) {
- console.log(`Attempt ${index + 1}: ${strategy}`);
- }
- });
-
- const fixReport = `
- ## Auto-Fix Attempt Report
-
- ### Strategies Applied
- ${fixStrategies.map((strategy, index) => `${index + 1}. ${strategy}`).join('\n')}
-
- ### Next Steps
- - Review the suggested fixes
- - Run tests locally to verify fixes
- - Commit any necessary changes
- `;
-
- console.log("Auto-fix process completed");
- console.log(fixReport);
- continue-on-error: true
-
- # Create PR with fixes (if any)
- - name: Create Pull Request for Automated Fixes
- uses: peter-evans/create-pull-request@main
- with:
- branch: "copilot/playwright-fixes"
- title: "Copilot: Auto-fix Playwright Tests"
- body: "Automated Playwright test fixes by Copilot Agent."
- commit-message: "Copilot agent Playwright bugfixes"
- continue-on-error: true
-
- # Automerge PR if passing
- - name: Automerge PR if checks pass
- uses: pascalgn/automerge-action@main
- with:
- merge-method: squash
- github-token: ${{ secrets.GITHUB_TOKEN }}
- continue-on-error: true
\ No newline at end of file
diff --git a/.github/workflows/auto-copilot-org-playwright-loopv2.yaml b/.github/workflows/auto-copilot-org-playwright-loopv2.yaml
deleted file mode 100644
index e9f3761..0000000
--- a/.github/workflows/auto-copilot-org-playwright-loopv2.yaml
+++ /dev/null
@@ -1,154 +0,0 @@
-name: "Org-wide: Copilot Playwright Test, Review, Auto-fix, PR, Merge"
-
-on:
- push:
- branches:
- - main
- - master
-
-jobs:
- playwright-review-fix:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@main
-
- - name: Setup Python
- uses: actions/setup-python@main
- with:
- python-version: "3.11"
-
- - name: Install dependencies
- run: |
- pip install -r requirements.txt
- pip install pytest playwright pytest-playwright
-
- - name: Install Playwright browsers
- run: |
- python -m playwright install
-
- - name: Run Playwright Tests
- run: |
- pytest tests/ || exit 1
- continue-on-error: true
-
- - name: Copilot PR Agent Review
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- // Simulate PR review functionality (v2)
- console.log("Performing enhanced automated PR review...");
-
- const { execSync } = require('child_process');
-
- try {
- // Check for test files
- const testFiles = execSync("find . -name '*.spec.js' -o -name '*.spec.ts' -o -name '*.test.py' | wc -l").toString().trim();
-
- const prReviewV2 = `
- ## Enhanced Automated PR Review (v2)
-
- ### Test Coverage Analysis
- - Found ${testFiles} test files
- - ${testFiles > 0 ? 'โ
' : 'โ'} Test files present
-
- ### Code Quality Checks
- - โ
Automated syntax validation
- - โ
Security scan completed
- - โ
Performance analysis done
-
- ### Playwright Specific Checks
- - Verify test stability and reliability
- - Check for proper page object patterns
- - Ensure cross-browser compatibility
- - Validate test data management
-
- ### Recommendations
- - Run tests in multiple environments
- - Ensure proper error handling in tests
- - Add visual regression testing if applicable
- `;
-
- console.log("Enhanced PR review completed");
- console.log(prReviewV2);
- } catch (error) {
- console.log("PR review completed with basic analysis");
- }
- continue-on-error: true
-
- - name: Copilot Auto-fix Failing Playwright Tests
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- // Enhanced auto-fix functionality (v2)
- console.log("Starting enhanced auto-fix process...");
-
- const maxAttempts = 3;
- const enhancedFixStrategies = [
- {
- attempt: 1,
- strategy: "Analyze test failures and update selectors",
- actions: ["Use data-testid attributes", "Update CSS selectors", "Add aria-label selectors"]
- },
- {
- attempt: 2,
- strategy: "Improve test stability and timing",
- actions: ["Add explicit waits", "Increase timeouts", "Add retry logic"]
- },
- {
- attempt: 3,
- strategy: "Optimize test structure and assertions",
- actions: ["Simplify complex assertions", "Break down large tests", "Add better error messages"]
- }
- ];
-
- console.log(`Enhanced auto-fix process (max attempts: ${maxAttempts})`);
-
- enhancedFixStrategies.forEach(fix => {
- console.log(`\nAttempt ${fix.attempt}: ${fix.strategy}`);
- fix.actions.forEach(action => {
- console.log(` - ${action}`);
- });
- });
-
- const enhancedFixReport = `
- ## Enhanced Auto-Fix Report (v2)
-
- ### Fix Strategies Applied
- ${enhancedFixStrategies.map(fix =>
- `**Attempt ${fix.attempt}**: ${fix.strategy}\n${fix.actions.map(action => ` - ${action}`).join('\n')}`
- ).join('\n\n')}
-
- ### Validation Steps
- 1. Run tests locally to verify fixes
- 2. Check test reports for improvements
- 3. Validate cross-browser compatibility
- 4. Ensure no new test failures introduced
-
- ### Next Actions
- - Review and commit suggested changes
- - Update test documentation if needed
- - Consider adding more comprehensive test coverage
- `;
-
- console.log("\nEnhanced auto-fix process completed");
- console.log(enhancedFixReport);
- continue-on-error: true
-
- - name: Create Pull Request for Automated Fixes
- uses: peter-evans/create-pull-request@main
- with:
- branch: "copilot/playwright-fixes"
- title: "Copilot: Auto-fix Playwright Tests"
- body: "Automated Playwright test fixes by Copilot Agent."
- commit-message: "Copilot agent Playwright bugfixes"
- continue-on-error: true
-
- - name: Automerge PR if checks pass
- uses: pascalgn/automerge-action@main
- with:
- merge-method: squash
- github-token: ${{ secrets.GITHUB_TOKEN }}
- continue-on-error: true
\ No newline at end of file
diff --git a/.github/workflows/auto-copilot-playwright-auto-test.yml b/.github/workflows/auto-copilot-playwright-auto-test.yml
deleted file mode 100644
index c7d67a5..0000000
--- a/.github/workflows/auto-copilot-playwright-auto-test.yml
+++ /dev/null
@@ -1,157 +0,0 @@
-name: "Copilot: Generate and Run Playwright Tests Until Passing"
-
-on:
- push:
- branches:
- - main
- - master
-
-jobs:
- generate-and-test:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@main
-
- - name: Setup Python
- uses: actions/setup-python@main
- with:
- python-version: "3.11"
-
- - name: Install dependencies
- run: |
- pip install -r requirements.txt
- pip install pytest playwright pytest-playwright
-
- - name: Install Playwright browsers
- run: |
- python -m playwright install
-
- - name: Copilot Generate Playwright Scripts
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- // Simulate Playwright script generation
- const fs = require('fs');
-
- console.log("Generating Playwright test recommendations...");
-
- const playwrightTemplate = `
- ## Playwright Test Generation Recommendations
-
- ### Suggested Test Structure
-
- Create test files in the \`tests/\` directory with the following patterns:
-
- 1. **Basic Navigation Tests**
- - Test page loading and basic navigation
- - Verify key elements are present
-
- 2. **User Interaction Tests**
- - Form submissions and validations
- - Button clicks and menu interactions
- - Search functionality
-
- 3. **Authentication Tests**
- - Login/logout workflows
- - Protected route access
-
- 4. **Responsive Design Tests**
- - Mobile and desktop viewport testing
- - Cross-browser compatibility
-
- ### Example Test Template
- \`\`\`javascript
- // tests/example.spec.js
- const { test, expect } = require('@playwright/test');
-
- test('basic navigation test', async ({ page }) => {
- await page.goto('/');
- await expect(page).toHaveTitle(/Expected Title/);
- // Add more assertions
- });
- \`\`\`
-
- ### Next Steps
- - Create test files based on your application's functionality
- - Use Playwright's codegen tool: \`npx playwright codegen\`
- - Run tests with: \`npx playwright test\`
- `;
-
- fs.writeFileSync('PLAYWRIGHT_RECOMMENDATIONS.md', playwrightTemplate);
- console.log("Playwright recommendations generated");
- continue-on-error: true
-
- - name: Run Playwright Tests
- run: |
- pytest tests/ # Or the path to your Playwright scripts
-
- - name: If Tests Fail, Copilot Attempts Fix & Repeats
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- // Simulate test failure analysis and fix recommendations
- const fs = require('fs');
-
- console.log("Analyzing test failures and generating fix recommendations...");
-
- const fixRecommendations = `
- ## Test Failure Analysis and Fix Recommendations
-
- ### Common Playwright Test Issues and Fixes
-
- 1. **Timing Issues**
- - Use proper wait strategies: \`await page.waitForSelector()\`
- - Avoid \`page.waitForTimeout()\` in favor of specific waits
- - Use \`expect().toBeVisible()\` instead of checking existence
-
- 2. **Selector Issues**
- - Use data-testid attributes for reliable element selection
- - Prefer text-based selectors when appropriate
- - Use Playwright's locator strategies
-
- 3. **Flaky Tests**
- - Ensure proper test isolation
- - Reset application state between tests
- - Use retry mechanisms for unstable operations
-
- 4. **Environment Issues**
- - Verify test environment setup
- - Check browser compatibility
- - Ensure proper test data setup
-
- ### Debugging Steps
- 1. Run tests in headed mode: \`npx playwright test --headed\`
- 2. Use debug mode: \`npx playwright test --debug\`
- 3. Generate trace files: \`npx playwright test --trace on\`
- 4. Check test reports: \`npx playwright show-report\`
-
- ### Auto-Fix Attempts (Max: 5)
- - Attempt 1: Update selectors to use data-testid
- - Attempt 2: Add proper wait conditions
- - Attempt 3: Increase timeout values
- - Attempt 4: Add retry logic for flaky operations
- - Attempt 5: Simplify test assertions
- `;
-
- fs.writeFileSync('TEST_FIX_RECOMMENDATIONS.md', fixRecommendations);
- console.log("Test fix recommendations generated");
- continue-on-error: true
-
- - name: Create PR with passing tests or attempted fixes
- uses: peter-evans/create-pull-request@main
- with:
- branch: "copilot/playwright-auto-tests"
- title: "Copilot generated Playwright tests (auto-fixed)"
- body: "Automated Playwright test generation/fix by Copilot agent."
- commit-message: "Copilot agent Playwright tests and fixes"
- continue-on-error: true
-
- - name: Auto-merge if passing
- uses: pascalgn/automerge-action@main
- with:
- merge-method: squash
- github-token: ${{ secrets.GITHUB_TOKEN }}
- continue-on-error: true
\ No newline at end of file
diff --git a/.github/workflows/auto-copilot-test-review-playwright.yml b/.github/workflows/auto-copilot-test-review-playwright.yml
deleted file mode 100644
index d061ab4..0000000
--- a/.github/workflows/auto-copilot-test-review-playwright.yml
+++ /dev/null
@@ -1,338 +0,0 @@
-name: "Comprehensive Test Review with Playwright"
-
-# REQUIREMENTS:
-# - A GitHub Personal Access Token with Copilot access must be created and stored as a repository secret named COPILOT_TOKEN
-# - See COPILOT_TOKEN_SETUP.md for detailed setup instructions
-
-on:
- push:
- branches:
- - main
- - master
- pull_request:
- types: [opened, synchronize, reopened]
- workflow_dispatch:
-
-permissions:
- contents: write
- pull-requests: write
- checks: write
-
-jobs:
- test-review-and-execution:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- browser: [chromium, firefox, webkit]
- mode: [headed, headless]
- steps:
- - name: Checkout code
- uses: actions/checkout@main
-
- - name: Setup Node.js
- uses: actions/setup-node@main
- with:
- node-version: '20'
- cache: 'npm'
- continue-on-error: true
-
- - name: Setup Python
- uses: actions/setup-python@main
- with:
- python-version: '3.11'
- cache: 'pip'
- continue-on-error: true
-
- - name: Install Node.js dependencies
- run: |
- if [ -f "package.json" ]; then
- npm install
- npm install -D @playwright/test playwright
- fi
- continue-on-error: true
-
- - name: Install Python dependencies
- run: |
- if [ -f "requirements.txt" ]; then
- pip install -r requirements.txt
- fi
- pip install pytest playwright pytest-playwright
- continue-on-error: true
-
- - name: Install Playwright browsers
- run: |
- npx playwright install --with-deps ${{ matrix.browser }} || python -m playwright install --with-deps ${{ matrix.browser }}
- continue-on-error: true
-
- - name: Verify Playwright installation
- run: |
- echo "Checking Playwright installation..."
- npx playwright --version || python -m playwright --version || echo "Playwright not installed"
-
- - name: Run Playwright Tests (Headless)
- if: matrix.mode == 'headless'
- run: |
- if [ -f "playwright.config.ts" ] || [ -f "playwright.config.js" ]; then
- npx playwright test --browser=${{ matrix.browser }}
- elif [ -d "tests" ] && find tests -name "*test*.py" -o -name "*_test.py" | grep -q .; then
- pytest tests/ --browser ${{ matrix.browser }} --headed=false
- else
- echo "No Playwright tests found - this is OK if not a web project"
- fi
- env:
- CI: true
- continue-on-error: true
-
- - name: Run Playwright Tests (Headed)
- if: matrix.mode == 'headed'
- run: |
- if [ -f "playwright.config.ts" ] || [ -f "playwright.config.js" ]; then
- npx playwright test --browser=${{ matrix.browser }} --headed
- elif [ -d "tests" ] && find tests -name "*test*.py" -o -name "*_test.py" | grep -q .; then
- pytest tests/ --browser ${{ matrix.browser }} --headed=true
- else
- echo "No Playwright tests found - this is OK if not a web project"
- fi
- env:
- CI: true
- DISPLAY: :99
- continue-on-error: true
-
- - name: Upload Playwright Test Results
- uses: actions/upload-artifact@main
- if: always()
- with:
- name: playwright-results-${{ matrix.browser }}-${{ matrix.mode }}
- path: |
- playwright-report/
- test-results/
- playwright-traces/
- retention-days: 30
- continue-on-error: true
-
- - name: Upload Playwright Screenshots on Failure
- uses: actions/upload-artifact@main
- if: failure()
- with:
- name: playwright-screenshots-${{ matrix.browser }}-${{ matrix.mode }}
- path: |
- screenshots/
- test-results/**/screenshots/
- retention-days: 7
- continue-on-error: true
-
- test-coverage-review:
- runs-on: ubuntu-latest
- needs: test-review-and-execution
- steps:
- - name: Checkout code
- uses: actions/checkout@main
-
- - name: Analyze Test Coverage
- id: coverage
- run: |
- echo "## Test Coverage Analysis" > /tmp/test-analysis.md
- echo "" >> /tmp/test-analysis.md
-
- # Find test files
- echo "### Test Files Found:" >> /tmp/test-analysis.md
- find . -type f \( -name "*test*.js" -o -name "*test*.ts" -o -name "*test*.py" -o -name "*spec*.js" -o -name "*spec*.ts" \) \
- ! -path "*/node_modules/*" \
- ! -path "*/dist/*" \
- ! -path "*/.venv/*" \
- -exec echo "- {}" \; >> /tmp/test-analysis.md || echo "No test files found" >> /tmp/test-analysis.md
-
- echo "" >> /tmp/test-analysis.md
- echo "### Source Files Without Tests:" >> /tmp/test-analysis.md
-
- # Find source files that might need tests
- for file in $(find . -type f \( -name "*.js" -o -name "*.ts" -o -name "*.py" \) \
- ! -path "*/node_modules/*" \
- ! -path "*/dist/*" \
- ! -path "*/build/*" \
- ! -path "*/.venv/*" \
- ! -path "*/vendor/*" \
- ! -name "*test*" \
- ! -name "*spec*"); do
- basename=$(basename "$file" | sed 's/\.[^.]*$//')
-
- # Check if corresponding test file exists
- if ! find . -name "*${basename}*test*" -o -name "*${basename}*spec*" 2>/dev/null | grep -q .; then
- echo "- $file (no corresponding test found)" >> /tmp/test-analysis.md
- fi
- done
-
- cat /tmp/test-analysis.md
-
- # NOTE: Commented out due to potentially non-existent action github/copilot-cli-action@main
- # This action may not exist in the GitHub marketplace (similar to copilot-cli-actions)
- # - name: GitHub Copilot Test Review
- # uses: github/copilot-cli-action@main
- # with:
- # query: |
- # Review the test suite for this repository:
- # 1. Verify all web-based functionality has Playwright tests (both headed and headless)
- # 2. Identify missing test coverage for critical functionality
- # 3. Check test quality and maintainability
- # 4. Suggest improvements for test organization
- # 5. Verify tests follow best practices (isolation, clarity, proper assertions)
- # 6. Check for flaky tests or tests with timing issues
- # 7. Ensure tests are running in CI/CD pipeline
- #
- # For any web tests not using Playwright, recommend migration.
- # Provide specific, actionable recommendations with file names.
- # env:
- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- # continue-on-error: true
- - name: GitHub Copilot Test Review
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- // Simulate test review with file analysis
- const fs = require('fs');
- const { execSync } = require('child_process');
-
- console.log("Performing test suite review...");
-
- let testReview = `## Test Suite Review Results\n\n`;
-
- try {
- // Look for test files
- const playwrightTests = execSync("find . -name '*.spec.js' -o -name '*.spec.ts' -o -name '*.test.js' -o -name '*.test.ts' | head -10").toString().trim().split('\n').filter(f => f);
- const pythonTests = execSync("find . -name '*test*.py' -o -name 'test_*.py' | head -10").toString().trim().split('\n').filter(f => f);
-
- testReview += `### Test Coverage Assessment\n`;
- testReview += `- Found ${playwrightTests.length} JavaScript/TypeScript test files\n`;
- testReview += `- Found ${pythonTests.length} Python test files\n`;
-
- testReview += `\n### Playwright Test Recommendations\n`;
- if (playwrightTests.length > 0) {
- testReview += `- โ
Playwright tests detected\n`;
- testReview += `- Ensure tests cover both headed and headless modes\n`;
- testReview += `- Verify tests are isolated and don't depend on each other\n`;
- testReview += `- Check for proper wait strategies and assertions\n`;
- } else {
- testReview += `- โ No Playwright tests found\n`;
- testReview += `- Consider adding Playwright tests for web functionality\n`;
- testReview += `- Migrate existing web tests to Playwright for better reliability\n`;
- }
-
- testReview += `\n### General Test Quality\n`;
- testReview += `- Ensure tests follow AAA pattern (Arrange, Act, Assert)\n`;
- testReview += `- Add descriptive test names and comments\n`;
- testReview += `- Implement proper test data management\n`;
- testReview += `- Consider adding integration and end-to-end tests\n`;
- testReview += `- Verify tests are running in CI/CD pipeline\n`;
-
- if (playwrightTests.length > 0) {
- testReview += `\n### Existing Test Files\n`;
- playwrightTests.forEach(file => {
- testReview += `- ${file}\n`;
- });
- }
-
- } catch (error) {
- testReview += `Test review completed with basic recommendations.\n`;
- }
-
- // Append to existing analysis file
- try {
- const existingAnalysis = fs.readFileSync('/tmp/test-analysis.md', 'utf8');
- fs.writeFileSync('/tmp/test-analysis.md', existingAnalysis + '\n\n' + testReview);
- } catch (error) {
- fs.writeFileSync('/tmp/test-analysis.md', testReview);
- }
-
- console.log("Test suite review completed");
- uses: austenstone/copilot-cli-action@v2
- with:
- copilot-token: ${{ secrets.COPILOT_TOKEN }}
- prompt: |
- Review the test suite for this repository:
- 1. Verify all web-based functionality has Playwright tests (both headed and headless)
- 2. Identify missing test coverage for critical functionality
- 3. Check test quality and maintainability
- 4. Suggest improvements for test organization
- 5. Verify tests follow best practices (isolation, clarity, proper assertions)
- 6. Check for flaky tests or tests with timing issues
- 7. Ensure tests are running in CI/CD pipeline
-
- For any web tests not using Playwright, recommend migration.
- Provide specific, actionable recommendations with file names.
- continue-on-error: true
-
- - name: Create or Update Test Review Issue
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- const fs = require('fs');
- const analysis = fs.readFileSync('/tmp/test-analysis.md', 'utf8');
-
- const date = new Date().toISOString().split('T')[0];
- const title = `Test Coverage Review - ${date}`;
-
- const body = `# Comprehensive Test Review
-
- This automated review ensures proper test coverage with Playwright for web tests.
-
- ${analysis}
-
- ## Playwright Test Status
-
- โ
Tests run in multiple browsers: Chromium, Firefox, WebKit
- โ
Tests run in both headed and headless modes
-
- ## Recommendations
-
- 1. **Add Playwright tests** for all web-based functionality
- 2. **Migrate existing web tests** to Playwright if not already using it
- 3. **Add tests** for source files without coverage
- 4. **Review test quality** and maintainability
- 5. **Fix flaky tests** and timing issues
- 6. **Ensure CI/CD integration** for all tests
-
- ## Action Items
-
- - [ ] Review files without tests and add coverage
- - [ ] Migrate non-Playwright web tests to Playwright
- - [ ] Fix any failing tests
- - [ ] Add documentation for test setup and execution
-
- ---
- *This issue was automatically generated by the Test Review workflow.*
- `;
-
- // Check if similar issue exists
- const issues = await github.rest.issues.listForRepo({
- owner: context.repo.owner,
- repo: context.repo.repo,
- state: 'open',
- labels: ['test-coverage', 'automated'],
- per_page: 10
- });
-
- const recentIssue = issues.data.find(issue => {
- const createdAt = new Date(issue.created_at);
- const daysSinceCreation = (Date.now() - createdAt) / (1000 * 60 * 60 * 24);
- return daysSinceCreation < 7;
- });
-
- if (recentIssue) {
- console.log(`Recent issue found: #${recentIssue.number}, updating`);
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: recentIssue.number,
- body: `## Updated Analysis (${date})\n\n${analysis}`
- });
- } else {
- await github.rest.issues.create({
- owner: context.repo.owner,
- repo: context.repo.repo,
- title: title,
- body: body,
- labels: ['test-coverage', 'automated', 'playwright', 'needs-review']
- });
- }
diff --git a/.github/workflows/auto-feature-request.yml b/.github/workflows/auto-feature-request.yml
deleted file mode 100644
index 55baed4..0000000
--- a/.github/workflows/auto-feature-request.yml
+++ /dev/null
@@ -1,13 +0,0 @@
----
-name: Feature request
-about: Suggest an idea for this project
-title: "Feature Request: "
-labels: ["enhancement", "copilot"]
-assignees: ["copilot"] # <-- TUNE ME
----
-
-**Describe the solution you'd like**
-A clear and concise description of what you want to happen.
-
-**Additional context**
-Add any other context or screenshots about the feature request here.
\ No newline at end of file
diff --git a/.github/workflows/auto-gpt5-implementation.yml b/.github/workflows/auto-gpt5-implementation.yml
deleted file mode 100644
index 4a12104..0000000
--- a/.github/workflows/auto-gpt5-implementation.yml
+++ /dev/null
@@ -1,332 +0,0 @@
-name: "GPT-5 Implementation Action"
-
-# REQUIREMENTS:
-# - A GitHub Personal Access Token with Copilot access must be created and stored as a repository secret named COPILOT_TOKEN
-# - The default GITHUB_TOKEN does not have Copilot access and cannot be used
-# - To create the token: GitHub Settings -> Developer settings -> Personal access tokens -> Generate new token
-# - The token needs the 'copilot' scope enabled
-
-on:
- push:
- branches:
- - main
- - master
- pull_request:
- types: [opened, synchronize, reopened]
- workflow_dispatch:
-
-permissions:
- contents: write
- pull-requests: write
- issues: write
-
-jobs:
- gpt5-analysis:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@main
-
- - name: Setup Node.js
- uses: actions/setup-node@main
- with:
- node-version: '20'
- continue-on-error: true
-
- - name: Setup Python
- uses: actions/setup-python@main
- with:
- python-version: '3.11'
- continue-on-error: true
-
- - name: Prepare Repository Analysis
- id: prepare-analysis
- run: |
- echo "## GPT-5 Code Analysis" > /tmp/gpt5-analysis.md
- echo "" >> /tmp/gpt5-analysis.md
- echo "### Repository Statistics:" >> /tmp/gpt5-analysis.md
-
- # Count different file types
- python_files=$(find . -name "*.py" ! -path "*/.venv/*" ! -path "*/node_modules/*" | wc -l)
- js_files=$(find . -name "*.js" ! -path "*/node_modules/*" ! -path "*/dist/*" | wc -l)
- ts_files=$(find . -name "*.ts" ! -path "*/node_modules/*" ! -path "*/dist/*" | wc -l)
- go_files=$(find . -name "*.go" ! -path "*/vendor/*" | wc -l)
- java_files=$(find . -name "*.java" ! -path "*/target/*" | wc -l)
-
- echo "- Python files: $python_files" >> /tmp/gpt5-analysis.md
- echo "- JavaScript files: $js_files" >> /tmp/gpt5-analysis.md
- echo "- TypeScript files: $ts_files" >> /tmp/gpt5-analysis.md
- echo "- Go files: $go_files" >> /tmp/gpt5-analysis.md
- echo "- Java files: $java_files" >> /tmp/gpt5-analysis.md
-
- echo "" >> /tmp/gpt5-analysis.md
- cat /tmp/gpt5-analysis.md
- continue-on-error: true
-
- # NOTE: Commented out due to non-existent action github/copilot-cli-actions@v1
- # This action does not exist in the GitHub marketplace
- # - name: GPT-5 Advanced Code Analysis
- # uses: github/copilot-cli-actions@v1
- # with:
- # model: gpt-5
- # query: |
- # Perform a comprehensive code analysis of this repository using GPT-5's advanced capabilities:
- #
- # 1. **Code Quality & Architecture**
- # - Analyze overall code structure and organization
- # - Identify architectural patterns and anti-patterns
- # - Suggest improvements for maintainability and scalability
- #
- # 2. **Security Analysis**
- # - Detect potential security vulnerabilities
- # - Identify unsafe coding patterns
- # - Recommend security best practices
- #
- # 3. **Performance Optimization**
- # - Identify performance bottlenecks
- # - Suggest optimization opportunities
- # - Recommend efficient algorithms and data structures
- #
- # 4. **Best Practices**
- # - Verify adherence to language-specific best practices
- # - Check for proper error handling
- # - Ensure code follows SOLID principles
- #
- # 5. **Documentation & Maintainability**
- # - Assess code documentation quality
- # - Identify areas needing better comments
- # - Suggest improvements for code readability
- #
- # Provide specific, actionable recommendations with file names and line numbers where applicable.
- # env:
- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- # continue-on-error: true
-
- # NOTE: Commented out due to non-existent action github/copilot-cli-actions@v1
- # This action does not exist in the GitHub marketplace
- # - name: GPT-5 Test Coverage Analysis
- # uses: github/copilot-cli-actions@v1
- # with:
- # model: gpt-5
- # query: |
- # Analyze the test coverage and testing strategy:
- #
- # 1. Identify files that lack adequate test coverage
- # 2. Suggest missing test cases for critical functionality
- # 3. Recommend improvements to existing tests
- # 4. Identify edge cases that should be tested
- # 5. Suggest integration and end-to-end test scenarios
- #
- # Focus on critical paths and business logic.
- # env:
- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- # continue-on-error: true
- - name: GPT-5 Advanced Code Analysis
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- // Simulate GPT-5 analysis with static analysis tools
- const fs = require('fs');
- const { execSync } = require('child_process');
-
- console.log("Performing comprehensive code analysis...");
-
- let analysisReport = `## GPT-5 Advanced Code Analysis Results\n\n`;
-
- try {
- // Basic file structure analysis
- const pyFiles = execSync("find . -name '*.py' ! -path '*/.venv/*' ! -path '*/node_modules/*' | head -20").toString().trim().split('\n').filter(f => f);
- const cFiles = execSync("find . -name '*.c' ! -path '*/build/*' | head -20").toString().trim().split('\n').filter(f => f);
-
- analysisReport += `### Code Quality & Architecture\n`;
- analysisReport += `- Found ${pyFiles.length} Python files for analysis\n`;
- analysisReport += `- Found ${cFiles.length} C files for analysis\n`;
-
- analysisReport += `\n### Security Analysis\n`;
- analysisReport += `- Recommend implementing secure coding practices\n`;
- analysisReport += `- Consider using static analysis tools like bandit for Python\n`;
-
- analysisReport += `\n### Performance Optimization\n`;
- analysisReport += `- Profile critical code paths\n`;
- analysisReport += `- Consider memory usage optimization\n`;
-
- analysisReport += `\n### Best Practices\n`;
- analysisReport += `- Ensure proper error handling throughout codebase\n`;
- analysisReport += `- Follow language-specific style guides\n`;
-
- analysisReport += `\n### Documentation & Maintainability\n`;
- analysisReport += `- Add comprehensive docstrings to Python functions\n`;
- analysisReport += `- Include inline comments for complex logic\n`;
-
- } catch (error) {
- analysisReport += `Analysis completed with basic recommendations.\n`;
- }
-
- // Write analysis to file for later use
- fs.writeFileSync('/tmp/gpt5-code-analysis.md', analysisReport);
- console.log("Code analysis completed");
- continue-on-error: true
-
- - name: GPT-5 Test Coverage Analysis
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- // Simulate test coverage analysis
- const fs = require('fs');
- const { execSync } = require('child_process');
-
- console.log("Performing test coverage analysis...");
-
- let testAnalysis = `## Test Coverage Analysis Results\n\n`;
-
- try {
- // Look for test files
- const testFiles = execSync("find . -name '*test*.py' -o -name 'test_*.py' -o -name '*_test.py' | head -10").toString().trim().split('\n').filter(f => f);
-
- testAnalysis += `### Test Coverage Assessment\n`;
- testAnalysis += `- Found ${testFiles.length} test files\n`;
-
- testAnalysis += `\n### Recommendations\n`;
- testAnalysis += `- Ensure critical functionality has adequate test coverage\n`;
- testAnalysis += `- Add integration tests for key workflows\n`;
- testAnalysis += `- Consider edge case testing for security-critical components\n`;
- testAnalysis += `- Implement end-to-end tests for user-facing features\n`;
-
- if (testFiles.length > 0) {
- testAnalysis += `\n### Existing Test Files\n`;
- testFiles.forEach(file => {
- testAnalysis += `- ${file}\n`;
- });
- }
-
- } catch (error) {
- testAnalysis += `Test analysis completed with basic recommendations.\n`;
- }
-
- // Append to existing analysis file
- const existingAnalysis = fs.readFileSync('/tmp/gpt5-code-analysis.md', 'utf8');
- fs.writeFileSync('/tmp/gpt5-code-analysis.md', existingAnalysis + '\n\n' + testAnalysis);
- console.log("Test coverage analysis completed");
- continue-on-error: true
-
- - name: Create GPT-5 Analysis Report
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- const fs = require('fs');
-
- // Read the analysis from our generated file
- let analysis = '';
- try {
- analysis = fs.readFileSync('/tmp/gpt5-code-analysis.md', 'utf8');
- } catch (error) {
- // Fallback to basic analysis if file doesn't exist
- analysis = fs.readFileSync('/tmp/gpt5-analysis.md', 'utf8');
- }
-
- const date = new Date().toISOString().split('T')[0];
- const title = `GPT-5 Code Analysis Report - ${date}`;
-
- const body = `# GPT-5 Advanced Code Analysis Report
-
- ${analysis}
-
- ## Analysis Overview
-
- This report was generated using **GPT-5**, the latest model available in GitHub Copilot, which provides:
-
- ### Advanced Capabilities Used
-
- 1. **Deep Code Understanding**
- - Semantic analysis of code structure and patterns
- - Context-aware recommendations
- - Multi-language proficiency
-
- 2. **Comprehensive Security Analysis**
- - Vulnerability detection with CVE references
- - Security best practices validation
- - Threat modeling insights
-
- 3. **Performance Optimization**
- - Algorithm efficiency analysis
- - Resource usage optimization
- - Scalability recommendations
-
- 4. **Architecture Review**
- - Design pattern identification
- - SOLID principles compliance
- - Coupling and cohesion analysis
-
- 5. **Test Strategy Enhancement**
- - Coverage gap identification
- - Test case recommendations
- - Quality assurance improvements
-
- ## Available GPT-5 Models in GitHub Copilot
-
- The following GPT-5 variants are available:
- - **GPT-5**: Standard model (multiplier: 1)
- - **GPT-5 mini**: Faster, lightweight version (multiplier: 0)
- - **GPT-5-Codex**: Specialized for code generation (multiplier: 1)
- - **GPT-5.1**: Enhanced reasoning model (multiplier: 1)
- - **GPT-5.1-Codex**: Advanced code-focused model (multiplier: 1)
- - **GPT-5.1-Codex-Mini**: Efficient code model (multiplier: 0.33)
- - **GPT-5.1-Codex-Max**: Maximum capability code model (multiplier: 1)
- - **GPT-5.2**: Latest generation model (multiplier: 1)
-
- ## Action Items
-
- Based on the GPT-5 analysis above, review the specific recommendations and:
-
- - [ ] Address high-priority security findings
- - [ ] Implement suggested performance optimizations
- - [ ] Refactor code based on architecture recommendations
- - [ ] Add missing test coverage
- - [ ] Update documentation as suggested
- - [ ] Review and apply best practice improvements
-
- ---
- *This report was automatically generated using GPT-5 via GitHub Copilot.*
-
- For more information about GPT-5 models, see [Supported AI Models](https://docs.github.com/en/copilot/reference/ai-models/supported-models).
- `;
-
- // Only create issue if in PR or on main branch
- if (context.eventName === 'pull_request' || context.ref === 'refs/heads/main' || context.ref === 'refs/heads/master') {
- // Check for existing issues
- const issues = await github.rest.issues.listForRepo({
- owner: context.repo.owner,
- repo: context.repo.repo,
- state: 'open',
- labels: ['gpt5', 'automated'],
- per_page: 10
- });
-
- const recentIssue = issues.data.find(issue => {
- const createdAt = new Date(issue.created_at);
- const daysSinceCreation = (Date.now() - createdAt) / (1000 * 60 * 60 * 24);
- return daysSinceCreation < 7;
- });
-
- if (recentIssue) {
- console.log(`Recent GPT-5 issue found: #${recentIssue.number}, updating`);
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: recentIssue.number,
- body: `## Updated GPT-5 Analysis (${date})\n\n${analysis}\n\n---\n\n*Analysis performed using GPT-5 model via GitHub Copilot.*`
- });
- } else {
- await github.rest.issues.create({
- owner: context.repo.owner,
- repo: context.repo.repo,
- title: title,
- body: body,
- labels: ['gpt5', 'code-analysis', 'automated', 'copilot']
- });
- }
- }
- continue-on-error: true
diff --git a/.github/workflows/auto-label-comment-prs.yml b/.github/workflows/auto-label-comment-prs.yml
deleted file mode 100644
index a70067b..0000000
--- a/.github/workflows/auto-label-comment-prs.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-name: "Label PRs and auto-comment"
-on:
- pull_request:
- types: [opened, reopened, synchronize]
-permissions:
- issues: write
- pull-requests: write
-jobs:
- pr_label_comment:
- runs-on: ubuntu-latest
- permissions:
- issues: write
- pull-requests: write
- steps:
- - uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- const pr_number = context.payload.pull_request.number;
- // Add label
- await github.rest.issues.addLabels({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: pr_number,
- labels: ["needs-review", "copilot"] // <-- TUNE ME
- });
- // Add automated comment
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: pr_number,
- body: "Thanks for the PR! Copilot will assist with review."
- });
\ No newline at end of file
diff --git a/.github/workflows/auto-label.yml b/.github/workflows/auto-label.yml
deleted file mode 100644
index 0bb7305..0000000
--- a/.github/workflows/auto-label.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-# Auto-label new issues with your default labels!
-# Set or add labels in the 'labels' list.
-
-name: Auto Label New Issues
-
-on:
- issues:
- types: [opened]
-
-permissions:
- issues: write
-
-jobs:
- label:
- runs-on: ubuntu-latest
- permissions:
- issues: write
- steps:
- - name: Add labels
- uses: actions/github-script@main
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- // Add or tweak your labels here
- const labels = ["triage", "copilot"]; // <-- TUNE ME!
- await github.rest.issues.addLabels({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- labels
- });
\ No newline at end of file
diff --git a/.github/workflows/auto-sec-scan.yml b/.github/workflows/auto-sec-scan.yml
deleted file mode 100644
index ccced6e..0000000
--- a/.github/workflows/auto-sec-scan.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-name: "Security Scan on PR"
-on:
- pull_request:
- types: [opened, synchronize, reopened]
-jobs:
- security_scan:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@main
- - name: Run CodeQL Scan
- uses: github/codeql-action/init@main
- with:
- languages: 'python,javascript'
- - name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@main
\ No newline at end of file
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
deleted file mode 100644
index 2faefdd..0000000
--- a/.github/workflows/codeql.yml
+++ /dev/null
@@ -1,359 +0,0 @@
-# This workflow runs CodeQL against the repository.
-#
-# Results are uploaded to GitHub Code Scanning.
-#
-# Due to a known issue with the CodeQL extractor when building the edk2
-# codebase on Linux systems, only Windows agents are used for build with
-# the VS toolchain.
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-
-name: "CodeQL"
-
-on:
- push:
- branches:
- - main
- pull_request:
- branches:
- - main
- paths-ignore:
- - '!**.c'
- - '!**.h'
-
-jobs:
- analyze:
- name: Analyze
- runs-on: windows-2022
- permissions:
- actions: read
- contents: read
- security-events: write
-
- strategy:
- fail-fast: false
- matrix:
- include:
- - Package: "CryptoPkg"
- ArchList: "IA32"
- - Package: "CryptoPkg"
- ArchList: "X64"
- - Package: "DynamicTablesPkg"
- ArchList: "IA32,X64"
- - Package: "FatPkg"
- ArchList: "IA32,X64"
- - Package: "FmpDevicePkg"
- ArchList: "IA32,X64"
- - Package: "IntelFsp2Pkg"
- ArchList: "IA32,X64"
- - Package: "IntelFsp2WrapperPkg"
- ArchList: "IA32,X64"
- - Package: "MdeModulePkg"
- ArchList: "IA32"
- - Package: "MdeModulePkg"
- ArchList: "X64"
- - Package: "MdePkg"
- ArchList: "IA32,X64"
- - Package: "PcAtChipsetPkg"
- ArchList: "IA32,X64"
- - Package: "PrmPkg"
- ArchList: "IA32,X64"
- - Package: "SecurityPkg"
- ArchList: "IA32,X64"
- - Package: "ShellPkg"
- ArchList: "IA32,X64"
- - Package: "SourceLevelDebugPkg"
- ArchList: "IA32,X64"
- - Package: "StandaloneMmPkg"
- ArchList: "IA32,X64"
- - Package: "UefiCpuPkg"
- ArchList: "IA32,X64"
- - Package: "UnitTestFrameworkPkg"
- ArchList: "IA32,X64"
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v6
-
- - name: Install Python
- uses: actions/setup-python@v6
- with:
- python-version: '3.11'
- cache: 'pip'
- cache-dependency-path: 'pip-requirements.txt'
-
- - name: Use Git Long Paths on Windows
- if: runner.os == 'Windows'
- shell: pwsh
- run: |
- git config --system core.longpaths true
-
- - name: Install/Upgrade pip Modules
- run: pip install -r pip-requirements.txt --upgrade requests sarif-tools
-
- - name: Determine CI Settings File Supported Operations
- id: get_ci_file_operations
- shell: python
- run: |
- import importlib
- import os
- import sys
- from pathlib import Path
- from edk2toolext.invocables.edk2_ci_setup import CiSetupSettingsManager
- from edk2toolext.invocables.edk2_setup import SetupSettingsManager
-
- # Find the repo CI Settings file
- ci_settings_file = list(Path(os.environ['GITHUB_WORKSPACE']).rglob('.pytool/CISettings.py'))
-
- # Note: At this point, submodules have not been pulled, only one CI Settings file should exist
- if len(ci_settings_file) != 1 or not ci_settings_file[0].is_file():
- print("::error title=Workspace Error!::Failed to find CI Settings file!")
- sys.exit(1)
-
- ci_settings_file = ci_settings_file[0]
-
- # Try Finding the Settings class in the file
- module_name = 'ci_settings'
-
- spec = importlib.util.spec_from_file_location(module_name, ci_settings_file)
- module = importlib.util.module_from_spec(spec)
- spec.loader.exec_module(module)
-
- try:
- settings = getattr(module, 'Settings')
- except AttributeError:
- print("::error title=Workspace Error!::Failed to find Settings class in CI Settings file!")
- sys.exit(1)
-
- # Determine Which Operations Are Supported by the Settings Class
- ci_setup_supported = issubclass(settings, CiSetupSettingsManager)
- setup_supported = issubclass(settings, SetupSettingsManager)
-
- with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
- print(f'ci_setup_supported={str(ci_setup_supported).lower()}', file=fh)
- print(f'setup_supported={str(setup_supported).lower()}', file=fh)
-
- - name: Convert Arch to Log Format
- id: convert_arch_hyphen
- env:
- ARCH_LIST: ${{ matrix.ArchList }}
- shell: python
- run: |
- import os
-
- with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
- print(f'arch_list={os.environ["ARCH_LIST"].replace(",", "-")}', file=fh)
-
- - name: Setup
- if: steps.get_ci_file_operations.outputs.setup_supported == 'true'
- run: stuart_setup -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2022
-
- - name: Upload Setup Log As An Artifact
- uses: actions/upload-artifact@v6
- if: (success() || failure()) && steps.get_ci_file_operations.outputs.setup_supported == 'true'
- with:
- name: ${{ matrix.Package }}-${{ steps.convert_arch_hyphen.outputs.arch_list }}-Setup-Log
- path: |
- **/SETUPLOG.txt
- retention-days: 7
- if-no-files-found: ignore
-
- - name: CI Setup
- if: steps.get_ci_file_operations.outputs.ci_setup_supported == 'true'
- run: stuart_ci_setup -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2022
-
- - name: Upload CI Setup Log As An Artifact
- uses: actions/upload-artifact@v6
- if: (success() || failure()) && steps.get_ci_file_operations.outputs.ci_setup_supported == 'true'
- with:
- name: ${{ matrix.Package }}-${{ steps.convert_arch_hyphen.outputs.arch_list }}-CI-Setup-Log
- path: |
- **/CISETUP.txt
- retention-days: 7
- if-no-files-found: ignore
-
- - name: Update
- run: stuart_update -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2022
-
- - name: Upload Update Log As An Artifact
- uses: actions/upload-artifact@v6
- if: success() || failure()
- with:
- name: ${{ matrix.Package }}-${{ steps.convert_arch_hyphen.outputs.arch_list }}-Update-Log
- path: |
- **/UPDATE_LOG.txt
- retention-days: 7
- if-no-files-found: ignore
-
- - name: Build Tools From Source
- run: python BaseTools/Edk2ToolsBuild.py -t VS2022
-
- - name: Find CodeQL Plugin Directory
- id: find_dir
- shell: python
- run: |
- import os
- import sys
- from pathlib import Path
-
- # Find the plugin directory that contains the CodeQL plugin
- plugin_dir = list(Path(os.environ['GITHUB_WORKSPACE']).rglob('BaseTools/Plugin/CodeQL'))
-
- # This should only be found once
- if len(plugin_dir) == 1:
- plugin_dir = str(plugin_dir[0])
-
- with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
- print(f'codeql_plugin_dir={plugin_dir}', file=fh)
- else:
- print("::error title=Workspace Error!::Failed to find CodeQL plugin directory!")
- sys.exit(1)
-
- - name: Get CodeQL CLI Cache Data
- id: cache_key_gen
- env:
- CODEQL_PLUGIN_DIR: ${{ steps.find_dir.outputs.codeql_plugin_dir }}
- shell: python
- run: |
- import os
- import yaml
-
- codeql_cli_ext_dep_name = 'codeqlcli_windows_ext_dep'
- codeql_plugin_file = os.path.join(os.environ['CODEQL_PLUGIN_DIR'], codeql_cli_ext_dep_name + '.yaml')
-
- with open (codeql_plugin_file) as pf:
- codeql_cli_ext_dep = yaml.safe_load(pf)
-
- cache_key_name = codeql_cli_ext_dep['name']
- cache_key_version = codeql_cli_ext_dep['version']
- cache_key = f'{cache_key_name}-{cache_key_version}'
-
- codeql_plugin_cli_ext_dep_dir = os.path.join(os.environ['CODEQL_PLUGIN_DIR'], codeql_cli_ext_dep['name'].strip() + '_extdep')
-
- with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
- print(f'codeql_cli_cache_key={cache_key}', file=fh)
- print(f'codeql_cli_ext_dep_dir={codeql_plugin_cli_ext_dep_dir}', file=fh)
-
- - name: Attempt to Load CodeQL CLI From Cache
- id: codeqlcli_cache
- uses: actions/cache@v5
- with:
- path: ${{ steps.cache_key_gen.outputs.codeql_cli_ext_dep_dir }}
- key: ${{ steps.cache_key_gen.outputs.codeql_cli_cache_key }}
-
- - name: Download CodeQL CLI
- if: steps.codeqlcli_cache.outputs.cache-hit != 'true'
- run: stuart_update -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2022 --codeql
-
- - name: Remove CI Plugins Irrelevant to CodeQL
- shell: python
- env:
- CODEQL_PLUGIN_DIR: ${{ steps.find_dir.outputs.codeql_plugin_dir }}
- run: |
- import os
- import shutil
- from pathlib import Path
-
- # Only these two plugins are needed for CodeQL
- plugins_to_keep = ['CompilerPlugin']
-
- plugin_dir = Path('.pytool/Plugin').absolute()
- if plugin_dir.is_dir():
- for dir in plugin_dir.iterdir():
- if str(dir.stem) not in plugins_to_keep:
- shutil.rmtree(str(dir.absolute()), ignore_errors=True)
-
- - name: CI Build
- env:
- STUART_CODEQL_PATH: ${{ steps.cache_key_gen.outputs.codeql_cli_ext_dep_dir }}
- run: stuart_ci_build -c .pytool/CISettings.py -t DEBUG -p ${{ matrix.Package }} -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2022 --codeql
-
- - name: Build Cleanup
- id: build_cleanup
- shell: python
- run: |
- import os
- import shutil
- from pathlib import Path
-
- dirs_to_delete = ['ia32', 'x64', 'arm', 'aarch64']
-
- def delete_dirs(path: Path):
- if path.exists() and path.is_dir():
- if path.name.lower() in dirs_to_delete:
- print(f'Removed {str(path)}')
- shutil.rmtree(path)
- return
-
- for child_dir in path.iterdir():
- delete_dirs(child_dir)
-
- build_path = Path(os.environ['GITHUB_WORKSPACE'], 'Build')
- delete_dirs(build_path)
-
- - name: Upload Build Logs As An Artifact
- uses: actions/upload-artifact@v6
- if: success() || failure()
- with:
- name: ${{ matrix.Package }}-${{ steps.convert_arch_hyphen.outputs.arch_list }}-Build-Logs
- path: |
- **/BUILD_REPORT.TXT
- **/OVERRIDELOG.TXT
- **/BUILDLOG_*.md
- **/BUILDLOG_*.txt
- **/CI_*.md
- **/CI_*.txt
- retention-days: 7
- if-no-files-found: ignore
-
- - name: Prepare Env Data for CodeQL Upload
- id: env_data
- env:
- PACKAGE_NAME: ${{ matrix.Package }}
- shell: python
- run: |
- import logging
- import os
- from edk2toollib.utility_functions import RunCmd
- from io import StringIO
- from pathlib import Path
-
- package = os.environ['PACKAGE_NAME'].strip().lower()
- directory_name = 'codeql-analysis-' + package + '-debug'
- file_name = 'codeql-db-' + package + '-debug-0.sarif'
- sarif_path = Path('Build', directory_name, file_name)
-
- with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
- if sarif_path.is_file():
- emacs_file_path = sarif_path.with_name(sarif_path.stem + "-emacs.txt")
- out_stream_buffer = StringIO()
- exit_code = RunCmd("sarif", f"emacs {sarif_path} --output {emacs_file_path} --no-autotrim",
- outstream=out_stream_buffer,
- logging_level=logging.NOTSET)
- print(f'upload_sarif_file=true', file=fh)
- print(f'emacs_file_path={emacs_file_path}', file=fh)
- print(f'sarif_file_path={sarif_path}', file=fh)
- else:
- print(f'upload_sarif_file=false', file=fh)
-
- - name: Upload CodeQL Results (SARIF) As An Artifact
- uses: actions/upload-artifact@v6
- if: steps.env_data.outputs.upload_sarif_file == 'true'
- with:
- name: ${{ matrix.Package }}-${{ steps.convert_arch_hyphen.outputs.arch_list }}-CodeQL-SARIF
- path: |
- ${{ steps.env_data.outputs.emacs_file_path }}
- ${{ steps.env_data.outputs.sarif_file_path }}
- retention-days: 14
- if-no-files-found: warn
-
- - name: Upload CodeQL Results (SARIF) To GitHub Code Scanning
- uses: github/codeql-action/upload-sarif@v4
- if: steps.env_data.outputs.upload_sarif_file == 'true'
- with:
- # Path to SARIF file relative to the root of the repository.
- sarif_file: ${{ steps.env_data.outputs.sarif_file_path }}
- # Optional category for the results. Used to differentiate multiple results for one commit.
- # Each package is a separate category.
- category: ${{ matrix.Package }}
diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml
deleted file mode 100644
index 5dbd1bf..0000000
--- a/.github/workflows/e2e-tests.yml
+++ /dev/null
@@ -1,537 +0,0 @@
-# End-to-End Testing Workflow for PhoenixBoot
-# Tests all features in QEMU VM with SecureBoot, cloud-init, NuclearBoot, and UUEFI
-#
-# Copyright (c) PhoenixBoot Project
-# SPDX-License-Identifier: Apache-2.0
-
-name: End-to-End Tests
-
-on:
- push:
- branches: [ main, master, develop ]
- pull_request:
- branches: [ main, master, develop ]
- workflow_dispatch:
-
-jobs:
- setup-and-build:
- name: Setup and Build Artifacts
- runs-on: ubuntu-latest
-
- permissions:
- contents: read
-
- steps:
- - name: Checkout Repository
- uses: actions/checkout@v6
- with:
- submodules: recursive
-
- - name: Set up Python
- uses: actions/setup-python@v6
- with:
- python-version: '3.11'
- cache: 'pip'
-
- - name: Install System Dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y \
- qemu-system-x86 \
- ovmf \
- mtools \
- dosfstools \
- openssl \
- sbsigntool \
- efitools \
- util-linux \
- kpartx \
- parted
-
- - name: Install Python Dependencies
- run: |
- pip install --upgrade pip
- pip install fabric lark
-
- - name: Bootstrap Build Environment
- run: |
- ./pf.py build-setup
-
- - name: Build Production Artifacts
- run: |
- ./pf.py build-build
-
- - name: Package ESP Image
- run: |
- ./pf.py build-package-esp
-
- - name: Upload Build Artifacts
- uses: actions/upload-artifact@v6
- with:
- name: build-artifacts
- path: |
- out/esp/
- out/setup/
- staging/boot/
- retention-days: 7
-
- test-basic-boot:
- name: Test Basic QEMU Boot
- needs: setup-and-build
- runs-on: ubuntu-latest
-
- permissions:
- contents: read
-
- steps:
- - name: Checkout Repository
- uses: actions/checkout@v6
-
- - name: Set up Python
- uses: actions/setup-python@v6
- with:
- python-version: '3.11'
-
- - name: Install QEMU and Dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y qemu-system-x86 ovmf mtools
-
- - name: Install Python Dependencies
- run: |
- pip install fabric lark
-
- - name: Download Build Artifacts
- uses: actions/download-artifact@v7
- with:
- name: build-artifacts
-
- - name: Run Basic Boot Test
- run: |
- chmod +x scripts/testing/qemu-test.sh
- ./pf.py test-qemu
-
- - name: Upload Test Logs
- if: always()
- uses: actions/upload-artifact@v6
- with:
- name: basic-boot-logs
- path: |
- out/qemu/serial.log
- out/qemu/report.xml
- retention-days: 7
-
- - name: Check Test Results
- if: always()
- run: |
- if [ -f out/qemu/report.xml ]; then
- echo "Test report generated:"
- cat out/qemu/report.xml
- fi
-
- test-secureboot:
- name: Test SecureBoot with NuclearBoot
- needs: setup-and-build
- runs-on: ubuntu-latest
-
- permissions:
- contents: read
-
- steps:
- - name: Checkout Repository
- uses: actions/checkout@v6
-
- - name: Set up Python
- uses: actions/setup-python@v6
- with:
- python-version: '3.11'
-
- - name: Install System Dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y \
- qemu-system-x86 \
- ovmf \
- mtools \
- openssl \
- sbsigntool \
- efitools
-
- - name: Install Python Dependencies
- run: |
- pip install fabric lark
-
- - name: Download Build Artifacts
- uses: actions/download-artifact@v7
- with:
- name: build-artifacts
-
- - name: Generate SecureBoot Keys
- run: |
- ./pf.py secure-keygen
-
- - name: Create SecureBoot Auth Files
- run: |
- ./pf.py secure-make-auth
-
- - name: Enroll SecureBoot Keys in OVMF
- run: |
- ./pf.py secure-enroll-secureboot
-
- - name: Run SecureBoot Positive Test
- run: |
- chmod +x scripts/testing/qemu-test-secure-positive.sh
- ./pf.py test-qemu-secure-positive
-
- - name: Upload SecureBoot Test Logs
- if: always()
- uses: actions/upload-artifact@v6
- with:
- name: secureboot-logs
- path: |
- out/qemu/serial-secure-positive.log
- out/qemu/report-secure.xml
- out/keys/
- retention-days: 7
-
- test-secureboot-strict:
- name: Test SecureBoot Strict Mode
- needs: setup-and-build
- runs-on: ubuntu-latest
-
- permissions:
- contents: read
-
- steps:
- - name: Checkout Repository
- uses: actions/checkout@v6
-
- - name: Set up Python
- uses: actions/setup-python@v6
- with:
- python-version: '3.11'
-
- - name: Install System Dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y qemu-system-x86 ovmf mtools openssl sbsigntool efitools
-
- - name: Install Python Dependencies
- run: |
- pip install fabric lark
-
- - name: Download Build Artifacts
- uses: actions/download-artifact@v7
- with:
- name: build-artifacts
-
- - name: Generate and Enroll Keys
- run: |
- ./pf.py secure-keygen
- ./pf.py secure-make-auth
- ./pf.py secure-enroll-secureboot
-
- - name: Run SecureBoot Strict Test
- run: |
- chmod +x scripts/testing/qemu-test-secure-strict.sh
- ./pf.py test-qemu-secure-strict
-
- - name: Upload Strict Test Logs
- if: always()
- uses: actions/upload-artifact@v6
- with:
- name: secureboot-strict-logs
- path: out/qemu/
- retention-days: 7
-
- test-attestation-failure:
- name: Test NuclearBoot Corruption Detection
- needs: setup-and-build
- runs-on: ubuntu-latest
-
- permissions:
- contents: read
-
- steps:
- - name: Checkout Repository
- uses: actions/checkout@v6
-
- - name: Set up Python
- uses: actions/setup-python@v6
- with:
- python-version: '3.11'
-
- - name: Install System Dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y qemu-system-x86 ovmf mtools openssl sbsigntool efitools
-
- - name: Install Python Dependencies
- run: |
- pip install fabric lark
-
- - name: Download Build Artifacts
- uses: actions/download-artifact@v7
- with:
- name: build-artifacts
-
- - name: Setup SecureBoot Environment
- run: |
- ./pf.py secure-keygen
- ./pf.py secure-make-auth
- ./pf.py secure-enroll-secureboot
-
- - name: Create Negative Attestation ESP (Corrupted)
- run: |
- ./pf.py build-package-esp-neg-attest
-
- - name: Run Negative Attestation Test
- run: |
- chmod +x scripts/testing/qemu-test-secure-negative-attest.sh
- # This test should fail - we expect it to detect corruption
- ./pf.py test-qemu-secure-negative-attest || echo "Test correctly detected corruption"
-
- - name: Verify Corruption Detection
- run: |
- if grep -q "PG-ATTEST=FAIL" out/qemu/serial-negative-attest.log; then
- echo "โ
NuclearBoot correctly detected corruption"
- exit 0
- else
- echo "โ NuclearBoot failed to detect corruption"
- exit 1
- fi
-
- - name: Upload Attestation Test Logs
- if: always()
- uses: actions/upload-artifact@v6
- with:
- name: attestation-logs
- path: |
- out/qemu/serial-negative-attest.log
- out/qemu/report-negative-attest.xml
- retention-days: 7
-
- test-uuefi:
- name: Test UUEFI Diagnostic Tool
- needs: setup-and-build
- runs-on: ubuntu-latest
-
- permissions:
- contents: read
-
- steps:
- - name: Checkout Repository
- uses: actions/checkout@v6
-
- - name: Set up Python
- uses: actions/setup-python@v6
- with:
- python-version: '3.11'
-
- - name: Install System Dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y qemu-system-x86 ovmf mtools
-
- - name: Install Python Dependencies
- run: |
- pip install fabric lark
-
- - name: Download Build Artifacts
- uses: actions/download-artifact@v7
- with:
- name: build-artifacts
-
- - name: Run UUEFI Test
- run: |
- chmod +x scripts/testing/qemu-test-uuefi.sh
- ./pf.py test-qemu-uuefi
-
- - name: Verify UUEFI Output
- run: |
- if [ -f out/qemu/serial-uuefi.log ]; then
- echo "UUEFI test completed. Log contents:"
- head -50 out/qemu/serial-uuefi.log
- if [ -s out/qemu/serial-uuefi.log ]; then
- echo "โ
UUEFI produced output"
- else
- echo "โ UUEFI log is empty"
- exit 1
- fi
- else
- echo "โ UUEFI log file not found"
- exit 1
- fi
-
- - name: Upload UUEFI Test Logs
- if: always()
- uses: actions/upload-artifact@v6
- with:
- name: uuefi-logs
- path: |
- out/qemu/serial-uuefi.log
- out/qemu/report-uuefi.xml
- retention-days: 7
-
- test-cloud-init-integration:
- name: Test Cloud-Init Username/Password Setup
- needs: setup-and-build
- runs-on: ubuntu-latest
-
- permissions:
- contents: read
-
- steps:
- - name: Checkout Repository
- uses: actions/checkout@v6
-
- - name: Set up Python
- uses: actions/setup-python@v6
- with:
- python-version: '3.11'
-
- - name: Install System Dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y \
- qemu-system-x86 \
- ovmf \
- mtools \
- cloud-init \
- cloud-image-utils \
- genisoimage
-
- - name: Install Python Dependencies
- run: |
- pip install fabric lark
-
- - name: Download Build Artifacts
- uses: actions/download-artifact@v7
- with:
- name: build-artifacts
-
- - name: Create Cloud-Init Configuration
- run: |
- mkdir -p out/cloud-init
- cat > out/cloud-init/meta-data << EOF
- instance-id: phoenixboot-test
- local-hostname: phoenixboot-vm
- EOF
-
- cat > out/cloud-init/user-data << EOF
- #cloud-config
- users:
- - name: phoenixuser
- passwd: \$6\$rounds=4096\$saltsalt\$IxDD3jeSOb18LKbD8RO7CRiTKaM7qGH9j3RYV8yxcF8pZCvDfhDqKnKcHXUBxXLDvhPJ6k8ZMJ0Sk0N1234567
- lock_passwd: false
- sudo: ALL=(ALL) NOPASSWD:ALL
- shell: /bin/bash
-
- runcmd:
- - echo "PhoenixBoot cloud-init test successful" > /var/log/phoenixboot-test.log
- EOF
-
- # Create cloud-init ISO
- genisoimage -output out/cloud-init/cloud-init.iso \
- -volid cidata -joliet -rock \
- out/cloud-init/user-data out/cloud-init/meta-data
-
- - name: Run QEMU with Cloud-Init
- run: |
- mkdir -p out/qemu
-
- # Get OVMF paths
- OVMF_CODE_PATH=$(sed -n '1p' out/esp/ovmf_paths.txt)
- OVMF_VARS_PATH=$(sed -n '2p' out/esp/ovmf_paths.txt)
-
- # Copy OVMF vars
- cp "$OVMF_VARS_PATH" out/qemu/OVMF_VARS_cloudinit.fd
-
- # Run QEMU with cloud-init ISO
- timeout 90s qemu-system-x86_64 \
- -machine q35 \
- -cpu host \
- -enable-kvm \
- -m 2G \
- -drive if=pflash,format=raw,readonly=on,file="$OVMF_CODE_PATH" \
- -drive if=pflash,format=raw,file=out/qemu/OVMF_VARS_cloudinit.fd \
- -drive format=raw,file=out/esp/esp.img \
- -drive file=out/cloud-init/cloud-init.iso,media=cdrom \
- -serial file:out/qemu/serial-cloudinit.log \
- -display none \
- -no-reboot || true
-
- - name: Verify Cloud-Init Execution
- run: |
- echo "Checking for PhoenixBoot and cloud-init markers in boot log:"
- if grep -q "PhoenixGuard" out/qemu/serial-cloudinit.log; then
- echo "โ
PhoenixBoot banner found"
- else
- echo "โ ๏ธ PhoenixBoot banner not found"
- fi
-
- echo "Boot log sample:"
- head -100 out/qemu/serial-cloudinit.log
-
- - name: Upload Cloud-Init Test Logs
- if: always()
- uses: actions/upload-artifact@v6
- with:
- name: cloud-init-logs
- path: |
- out/qemu/serial-cloudinit.log
- out/cloud-init/
- retention-days: 7
-
- test-summary:
- name: Test Results Summary
- needs:
- - test-basic-boot
- - test-secureboot
- - test-secureboot-strict
- - test-attestation-failure
- - test-uuefi
- - test-cloud-init-integration
- runs-on: ubuntu-latest
- if: always()
-
- permissions:
- contents: read
-
- steps:
- - name: Download All Test Logs
- uses: actions/download-artifact@v7
- with:
- path: test-results
-
- - name: Generate Test Summary
- run: |
- echo "# PhoenixBoot End-to-End Test Results" >> $GITHUB_STEP_SUMMARY
- echo "" >> $GITHUB_STEP_SUMMARY
- echo "## Test Status" >> $GITHUB_STEP_SUMMARY
- echo "" >> $GITHUB_STEP_SUMMARY
-
- # Parse JUnit XML reports if available
- if find test-results -name "*.xml" -type f; then
- echo "### Test Reports Found:" >> $GITHUB_STEP_SUMMARY
- find test-results -name "*.xml" -type f -exec echo "- {}" \; >> $GITHUB_STEP_SUMMARY
- echo "" >> $GITHUB_STEP_SUMMARY
- fi
-
- echo "## Test Coverage" >> $GITHUB_STEP_SUMMARY
- echo "" >> $GITHUB_STEP_SUMMARY
- echo "- โ
Basic QEMU Boot" >> $GITHUB_STEP_SUMMARY
- echo "- โ
SecureBoot with NuclearBoot" >> $GITHUB_STEP_SUMMARY
- echo "- โ
SecureBoot Strict Mode" >> $GITHUB_STEP_SUMMARY
- echo "- โ
Corruption Detection (Negative Attestation)" >> $GITHUB_STEP_SUMMARY
- echo "- โ
UUEFI Diagnostic Tool" >> $GITHUB_STEP_SUMMARY
- echo "- โ
Cloud-Init Integration" >> $GITHUB_STEP_SUMMARY
- echo "- โญ๏ธ Xen Boot (Skipped per requirements)" >> $GITHUB_STEP_SUMMARY
- echo "" >> $GITHUB_STEP_SUMMARY
-
- echo "All test artifacts are available in the Actions artifacts." >> $GITHUB_STEP_SUMMARY
-
- - name: List All Artifacts
- run: |
- echo "Test artifacts generated:"
- find test-results -type f | sort
diff --git a/.github/workflows/issue-assignment.yml b/.github/workflows/issue-assignment.yml
deleted file mode 100644
index 0790d7c..0000000
--- a/.github/workflows/issue-assignment.yml
+++ /dev/null
@@ -1,56 +0,0 @@
-# Actions that should occur when a GitHub issue is assigned.
-#
-# Currently this will remove the `state:needs-owner` label when the issue is assigned to an owner.
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-
-name: React to Issue Assignment
-
-on:
- issues:
- types: assigned
-
-jobs:
- adjust-labels:
- name: Adjust Issue Labels
- runs-on: ubuntu-latest
-
- permissions:
- contents: read
- issues: write
-
- steps:
- - uses: actions/checkout@v6
-
- - name: Remove Labels
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- # All labels here will be removed if present in the issue
- LABELS_TO_REMOVE=("state:needs-owner")
-
- # Gather issue context information
- ISSUE_NUMBER=$(jq --raw-output .issue.number "$GITHUB_EVENT_PATH")
- OWNER=$(jq --raw-output .repository.owner.login "$GITHUB_EVENT_PATH")
- REPO=$(jq --raw-output .repository.name "$GITHUB_EVENT_PATH")
- LABELS=$(curl -s \
- -H "Accept: application/vnd.github+json" \
- -H "Authorization: Bearer $GITHUB_TOKEN" \
- -H "X-GitHub-Api-Version: 2022-11-28" \
- https://api.github.com/repos/$OWNER/$REPO/issues/$ISSUE_NUMBER/labels | jq -r '.[].name')
-
- # Remove labels
- for LABEL in "${LABELS_TO_REMOVE[@]}"; do
- if echo "$LABELS" | grep -q "$LABEL"; then
- curl -X DELETE \
- -s \
- -H "Accept: application/vnd.github+json" \
- -H "Authorization: Bearer $GITHUB_TOKEN" \
- -H "X-GitHub-Api-Version: 2022-11-28" \
- https://api.github.com/repos/$OWNER/$REPO/issues/$ISSUE_NUMBER/labels/"$LABEL" > /dev/null
- echo "$LABEL removed from issue #$ISSUE_NUMBER"
- else
- echo "$LABEL not found on issue #$ISSUE_NUMBER"
- fi
- done
diff --git a/.github/workflows/issue-triage.yml b/.github/workflows/issue-triage.yml
deleted file mode 100644
index 72b8bc7..0000000
--- a/.github/workflows/issue-triage.yml
+++ /dev/null
@@ -1,57 +0,0 @@
-# This workflow assists with initial triage of new issues by applying labels
-# based on data provided in the issue.
-#
-# Configuration file that maps issue form input values to labels:
-# advanced-issue-labeler.yml
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-# For more information, see:
-# https://github.com/stefanbuck/github-issue-parser
-# https://github.com/redhat-plumbers-in-action/advanced-issue-labeler
-
-name: Issue Triage Workflow
-
-on:
- issues:
- types: [ opened ]
-
-jobs:
- triage_issue:
- name: Triage Issue
- runs-on: ubuntu-latest
-
- strategy:
- matrix:
- template: [ bug_report.yml, documentation_request.yml, feature_request.yml ]
-
- permissions:
- issues: write
-
- steps:
- - uses: actions/checkout@v6
-
- - name: Parse Issue Form
- uses: stefanbuck/github-issue-parser@v3
- id: issue-parser
- with:
- issue-body: ${{ github.event.issue.body }}
- template-path: .github/ISSUE_TEMPLATE/${{ matrix.template }}
-
- - name: Apply Labels from Triage
- uses: redhat-plumbers-in-action/advanced-issue-labeler@v3
- with:
- issue-form: ${{ steps.issue-parser.outputs.jsonString }}
- template: ${{ matrix.template }}
- token: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Update Assignee
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- FIX_OWNER: ${{ steps.issue-parser.outputs.issueparser_fix_owner }}
- run: |
- if [[ $FIX_OWNER == "I will fix it" ]] || [[ $FIX_OWNER == "I will make the change" ]] || [[ $FIX_OWNER == "I will implement the feature" ]]
- then
- gh issue edit ${{ github.event.issue.html_url }} --add-assignee ${{ github.event.issue.user.login }}
- fi
diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml
deleted file mode 100644
index b984898..0000000
--- a/.github/workflows/pr-labeler.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-# This workflow automatically applies labels to pull requests based on regular expression matches against the content
-# in the pull request.
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-# For more information, see:
-# https://github.com/github/issue-labeler
-
-name: Apply Labels Based on Message Content
-
-on:
- pull_request_target:
- types:
- - edited
- - opened
- - reopened
- - synchronize
- workflow_dispatch:
-
-jobs:
- sync:
- name: Label PR from Description
- runs-on: ubuntu-latest
-
- permissions:
- contents: read
- pull-requests: write
-
- steps:
- - name: Apply Labels Based on PR Description
- uses: github/issue-labeler@v3.4
- with:
- configuration-path: .github/workflows/pr-labeler/regex.yml
- enable-versioned-regex: 0
- repo-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/pr-labeler/regex.yml b/.github/workflows/pr-labeler/regex.yml
deleted file mode 100644
index b14746d..0000000
--- a/.github/workflows/pr-labeler/regex.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-# Specifies labels to apply to pull requests based on regular expressions.
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-# For more information, see:
-# https://github.com/github/issue-labeler
-
-impact:breaking-change:
- - '\s*-\s*\[\s*[x|X]\s*\] Breaking change\?'
-
-impact:security:
- - '\s*-\s*\[\s*[x|X]\s*\] Impacts security\?'
-
-impact:testing:
- - '\s*-\s*\[\s*[x|X]\s*\] Includes tests\?'
diff --git a/.github/workflows/request-reviews.yml b/.github/workflows/request-reviews.yml
deleted file mode 100644
index 0f55c68..0000000
--- a/.github/workflows/request-reviews.yml
+++ /dev/null
@@ -1,73 +0,0 @@
-
-# This workflow automatically adds the appropriate reviewers to a pull request.
-#
-# The workflow directly reuses logic in the BaseTools/Scripts/GetMaintainer.py script
-# to determine the appropriate reviewers, so it matches what a user would see running
-# the script locally.
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-
-name: Add Pull Request Reviewers
-
-on:
- pull_request_target:
- branches:
- - master
- types: [opened, ready_for_review, reopened, synchronize]
-
-env:
- GET_MAINTAINER_REL_PATH: "BaseTools/Scripts/GetMaintainer.py"
-
-jobs:
- auto-request-review:
- name: Add Pull Request Reviewers
- # Do not run on draft PRs and only run on PRs in the tianocore organization
- if: ${{ github.event.pull_request.draft == false && github.repository_owner == 'tianocore' }}
- runs-on: ubuntu-latest
-
- permissions:
- contents: read
- issues: write
- pull-requests: write
-
- steps:
- - name: Generate Token
- id: generate-token
- uses: actions/create-github-app-token@v2
- with:
- app-id: ${{ secrets.TIANOCORE_ASSIGN_REVIEWERS_APPLICATION_ID }}
- private-key: ${{ secrets.TIANOCORE_ASSIGN_REVIEWERS_APPLICATION_PRIVATE_KEY }}
-
- # Reduce checkout time with sparse-checkout
- # - .github: Contains the scripts to interact with Github and add reviewers
- # - BaseTools/Scripts: Contains the GetMaintainer.py script
- # - Maintainers.txt: Contains the list of maintainers for the repository
- - name: Checkout repository
- uses: actions/checkout@v6
- with:
- fetch-depth: 1
- sparse-checkout: |
- .github
- BaseTools/Scripts
- Maintainers.txt
-
- - name: Setup Python
- uses: actions/setup-python@v6
- with:
- python-version: '3.x'
- cache: 'pip'
- cache-dependency-path: '.github/scripts/requirements.txt'
-
- - name: Install PIP Modules
- run: pip install -r .github/scripts/requirements.txt --upgrade
-
- - name: Add Reviewers to Pull Request
- env:
- GH_TOKEN: ${{ steps.generate-token.outputs.token }}
- ORG_NAME: ${{ github.repository_owner }}
- PR_NUMBER: ${{ github.event.number}}
- REPO_NAME: ${{ github.event.pull_request.base.repo.name }}
- TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}
- WORKSPACE_PATH: ${{ github.workspace }}
- run: python .github/scripts/RequestPrReviewers.py
diff --git a/.github/workflows/scheduled-maintenance.yml b/.github/workflows/scheduled-maintenance.yml
deleted file mode 100644
index cc013db..0000000
--- a/.github/workflows/scheduled-maintenance.yml
+++ /dev/null
@@ -1,52 +0,0 @@
-# This workflow performs scheduled maintenance tasks.
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-
-name: Scheduled Maintenance
-
-on:
- schedule:
- # * is a special character in YAML so you have to quote this string
- # Run every hour - https://crontab.guru/#0_*_*_*_*
- - cron: '0 * * * *'
- workflow_dispatch:
-
-jobs:
- repo_cleanup:
- runs-on: ubuntu-latest
-
- permissions:
- pull-requests: write
- issues: write
-
- steps:
- - name: Prune Won't Fix Pull Requests
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- gh api \
- -H "Accept: application/vnd.github+json" \
- /repos/${GITHUB_REPOSITORY}/pulls | jq -r '.[]' | jq -rc '.html_url,.labels' | \
- while read -r html_url ; do
- read -r labels
- if [[ $labels == *"state:wont-fix"* ]]; then
- gh pr close $html_url -c "Closed due to being marked as wont fix" --delete-branch
- fi
- done
-
- - name: Prune Won't Fix Issues
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- REPOSITORY: ${{ env.REPOSITORY_NAME }}
- run: |
- gh api \
- -H "Accept: application/vnd.github+json" \
- /repos/${GITHUB_REPOSITORY}/issues | jq -r '.[]' | jq -rc '.html_url,.labels' | \
- while read -r html_url ; do
- read -r labels
- if [[ $labels == *"state:wont-fix"* ]]; then
- gh issue close $html_url -c "Closed due to being marked as wont fix" -r "not planned"
- fi
- done
diff --git a/.github/workflows/size-guard.yml b/.github/workflows/size-guard.yml
deleted file mode 100644
index ace5e02..0000000
--- a/.github/workflows/size-guard.yml
+++ /dev/null
@@ -1,45 +0,0 @@
-name: size-guard
-
-on:
- pull_request:
- push:
- branches: [ main ]
-
-jobs:
- size-guard:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Find oversized files (>50MB)
- shell: bash
- run: |
- set -euo pipefail
- # Determine range for PRs; for push check last commit
- if [[ "${{ github.event_name }}" == "pull_request" ]]; then
- RANGE="origin/${{ github.base_ref }}..HEAD"
- else
- RANGE="HEAD~1..HEAD"
- fi
-
- echo "Checking blobs in range: $RANGE"
- oversize=$(git rev-list --objects $RANGE \
- | awk 'NF==2 {print $1, $2}' \
- | while read -r oid path; do size=$(git cat-file -s "$oid" 2>/dev/null || echo 0); \
- if (( size > 50*1024*1024 )); then echo "$path $((size/1048576))MB"; fi; done)
-
- if [[ -n "$oversize" ]]; then
- echo "The following files exceed 50MB and must not be committed:"
- echo "$oversize"
- exit 1
- fi
-
- # Also guard working-tree checked in files (fallback)
- big_tree=$(find . -type f -not -path "./.git/*" -size +50M)
- if [[ -n "$big_tree" ]]; then
- echo "Working tree contains files >50MB:"; echo "$big_tree"; exit 1; fi
-
- echo "OK: no oversized files detected"
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
deleted file mode 100644
index aa06fe0..0000000
--- a/.github/workflows/stale.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-# This workflow warns and then closes issues and PRs that have had no activity
-# for a specified amount of time.
-#
-# For more information, see:
-# https://github.com/actions/stale
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-
-name: Stale Check
-
-on:
- schedule:
- # At 23:35 on every day-of-week from Sunday through Saturday
- # https://crontab.guru/#35_23_*_*_0-6
- - cron: '35 23 * * 0-6'
- workflow_dispatch:
-
-jobs:
- stale:
- name: Stale
- runs-on: ubuntu-latest
- permissions:
- issues: write
- pull-requests: write
-
- steps:
- - name: Check for Stale Items
- uses: actions/stale@v10
- with:
- days-before-issue-close: -1
- days-before-issue-stale: -1
- days-before-pr-stale: 60
- days-before-pr-close: 7
- stale-pr-message: >
- This PR has been automatically marked as stale because it has not had
- activity in 60 days. It will be closed if no further activity occurs within
- 7 days. Thank you for your contributions.
- close-pr-message: >
- This pull request has been automatically been closed because it did not have any
- activity in 60 days and no follow up within 7 days after being marked stale.
- Thank you for your contributions.
- stale-pr-label: stale
- exempt-issue-labels: type:code-first
- exempt-pr-labels: type:code-first
-
diff --git a/.github/workflows/trigger-all-repos.yml b/.github/workflows/trigger-all-repos.yml
deleted file mode 100644
index 8c58a46..0000000
--- a/.github/workflows/trigger-all-repos.yml
+++ /dev/null
@@ -1,63 +0,0 @@
-name: Trigger Workflow on All Repos
-
-on:
- workflow_dispatch:
- inputs:
- workflow_file:
- description: 'Workflow file name to trigger (e.g., workflows-sync.yml)'
- required: true
- type: string
- ref:
- description: 'Git reference (branch/tag/SHA) to run workflow from'
- required: false
- default: 'main'
- type: string
- include_archived:
- description: 'Include archived repositories'
- required: false
- default: false
- type: boolean
- check_only:
- description: 'Only check which repos have the workflow (do not trigger)'
- required: false
- default: false
- type: boolean
-
-jobs:
- trigger-all:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout repository
- uses: actions/checkout@main
-
- - name: Set up Python
- uses: actions/setup-python@main
- with:
- python-version: '3.11'
-
- - name: Install dependencies
- run: |
- pip install requests
-
- - name: Trigger workflow on all repositories
- env:
- GITHUB_TOKEN: ${{ secrets.GH_PAT }}
- run: |
- python trigger_workflow_all_repos.py \
- P4X-ng \
- "${{ inputs.workflow_file }}" \
- --ref "${{ inputs.ref }}" \
- ${{ inputs.include_archived && '--include-archived' || '' }} \
- ${{ inputs.check_only && '--check-only' || '' }} \
- --delay 1.5
-
- - name: Summary
- run: |
- echo "## Workflow Dispatch Summary" >> $GITHUB_STEP_SUMMARY
- echo "" >> $GITHUB_STEP_SUMMARY
- echo "**Workflow:** ${{ inputs.workflow_file }}" >> $GITHUB_STEP_SUMMARY
- echo "**Reference:** ${{ inputs.ref }}" >> $GITHUB_STEP_SUMMARY
- echo "**Include archived:** ${{ inputs.include_archived }}" >> $GITHUB_STEP_SUMMARY
- echo "**Check only:** ${{ inputs.check_only }}" >> $GITHUB_STEP_SUMMARY
- echo "" >> $GITHUB_STEP_SUMMARY
- echo "See logs above for detailed results." >> $GITHUB_STEP_SUMMARY
diff --git a/.github/workflows/upl-build.yml b/.github/workflows/upl-build.yml
deleted file mode 100644
index 10fd4ad..0000000
--- a/.github/workflows/upl-build.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-# @file up-build.yml
-#
-# A workflow that builds UefiPayloadPackage's UPL and upload it's artifacts.
-#
-##
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-##
-name: UPL Build
-
-on:
- workflow_dispatch:
- push:
- branches: ['master']
-
-jobs:
- build_vs2022:
- strategy:
- matrix:
- os: [windows-latest]
- python-version: ['3.12']
- tool-chain: ['VS2022']
- target: ['DEBUG']
- extra-build-args: ['FIT_BUILD=TRUE', 'FIT_BUILD=FALSE']
- name: Build UPL VS2022
- uses: ./.github/workflows/BuildPlatform.yml
- with:
- runs-on: ${{ matrix.os }}
- build-file: 'UefiPayloadPkg/PlatformCI/PlatformBuild.py'
- python-version: ${{ matrix.python-version }}
- tool-chain: ${{ matrix.tool-chain }}
- target: ${{ matrix.target }}
- extra-build-args: ${{ matrix.extra-build-args }}
- extra-pip-requirements: 'pefile pylibfdt'
- extra-artifact-path: |
- Build/**/*.elf
- Build/**/*.fit
- secrets: inherit
-
- build_gcc:
- strategy:
- matrix:
- os: [ubuntu-latest]
- python-version: ['3.12']
- tool-chain: ['GCC']
- target: ['DEBUG']
- extra-build-args: ['FIT_BUILD=TRUE', 'FIT_BUILD=FALSE']
- name: Build UPL GCC
- uses: ./.github/workflows/BuildPlatform.yml
- with:
- runs-on: ${{ matrix.os }}
- build-file: 'UefiPayloadPkg/PlatformCI/PlatformBuild.py'
- python-version: ${{ matrix.python-version }}
- tool-chain: ${{ matrix.tool-chain }}
- target: ${{ matrix.target }}
- extra-build-args: ${{ matrix.extra-build-args }}
- extra-pip-requirements: 'pefile pylibfdt'
- extra-setup-cmd: 'sudo dnf install -y llvm clang llvm-libs llvm-devel lldb'
- extra-artifact-path: |
- Build/**/*.elf
- Build/**/*.fit
diff --git a/.github/workflows/workflows-sync-template-backup.yml b/.github/workflows/workflows-sync-template-backup.yml
deleted file mode 100644
index a309700..0000000
--- a/.github/workflows/workflows-sync-template-backup.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-name: Workflows Sync
-
-on:
- workflow_dispatch:
- schedule:
- - cron: '0 6 * * *' # sync daily at 6:00 UTC
-
-jobs:
- sync:
- runs-on: ubuntu-latest
- steps:
- - name: Workflows Sync
- uses: wow-actions/workflows-sync@v2
- with:
- GH_PAT: ${{ secrets.GH_PAT }}
- owner: P4X-ng
- workflows: .github/workflows/
- commit_message: "Sync workflow files from .github repo"
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index e78176d..aa64114 100644
--- a/.gitignore
+++ b/.gitignore
@@ -58,3 +58,6 @@ nohup*.out
# Generated documentation files
copilot-instructions.md
WARP.md
+
+# Local config overrides
+phoenixboot.config.local.json5
diff --git a/CODE_OF_CONDUCT.md b/.mergify/.bish-index
similarity index 100%
rename from CODE_OF_CONDUCT.md
rename to .mergify/.bish-index
diff --git a/.mergify/.bish.sqlite b/.mergify/.bish.sqlite
new file mode 100644
index 0000000..f67330d
Binary files /dev/null and b/.mergify/.bish.sqlite differ
diff --git a/.pf_fix.py b/.pf_fix.py
index ac5a824..5a43d2e 100644
--- a/.pf_fix.py
+++ b/.pf_fix.py
@@ -1,9 +1,11 @@
#!/usr/bin/env python3
-import sys, io, os
+import os
+import shlex
+import sys
p = "/usr/local/bin/pf"
old = (
" if op == \"shell\":\n"
- " cmd = \" \\".join(args)\n"
+ " cmd = \" \".join(args)\n"
" if not cmd: raise ValueError(\"shell needs a command\")\n"
" return run(cmd)\n"
)
diff --git a/.pytool/.bish-index b/.pytool/.bish-index
new file mode 100644
index 0000000..25edf9f
--- /dev/null
+++ b/.pytool/.bish-index
@@ -0,0 +1,2 @@
+./CISettings.py
+./Readme.md
diff --git a/.pytool/.bish.sqlite b/.pytool/.bish.sqlite
new file mode 100644
index 0000000..5438cb4
Binary files /dev/null and b/.pytool/.bish.sqlite differ
diff --git a/CONTRIBUTING.md b/.tmp/.bish-index
similarity index 100%
rename from CONTRIBUTING.md
rename to .tmp/.bish-index
diff --git a/.tmp/.bish.sqlite b/.tmp/.bish.sqlite
new file mode 100644
index 0000000..122542e
Binary files /dev/null and b/.tmp/.bish.sqlite differ
diff --git a/IMPLEMENTATION_SUMMARY.md b/IMPLEMENTATION_SUMMARY.md
deleted file mode 100644
index d5315df..0000000
--- a/IMPLEMENTATION_SUMMARY.md
+++ /dev/null
@@ -1,325 +0,0 @@
-# ๐ฏ User-Facing Codebase Stabilization: Implementation Summary
-
-## Overview
-
-This document summarizes the improvements made to stabilize the PhoenixBoot user-facing codebase and make the complete bootkit defense workflow clear and accessible to users.
-
----
-
-## Problem Statement
-
-The issue requested:
-1. **Enable secureboot from the very start** - Create install media that can enroll custom keys
-2. **Start there** - Enable the ability to create secureboot media (ISO, CD, or USB)
-3. **Post-install cleanup** - Provide escalating steps to clear malicious EFI vars (NuclearBoot)
-
-**Goal:** Stop 99% of bootkits through a comprehensive three-stage approach.
-
----
-
-## What Was Implemented
-
-### 1. โ
Complete Workflow Documentation
-
-**Created comprehensive documentation for the three-stage approach:**
-
-- **BOOTKIT_DEFENSE_WORKFLOW.md** (12KB, 350+ lines)
- - Complete guide from start to finish
- - Stage 1: Create SecureBoot bootable media
- - Stage 2: Clean OS installation with SecureBoot
- - Stage 3: Post-install protection with NuclearBoot
- - Includes decision trees, troubleshooting, and success criteria
-
-- **QUICK_REFERENCE.md** (4KB, 150+ lines)
- - One-page command reference
- - Quick decision tree
- - Common tasks and troubleshooting
- - Print-friendly format
-
-- **docs/PROGRESSIVE_RECOVERY.md** (5KB, 200+ lines)
- - User-friendly guide to the six escalation levels
- - Clear risk/time/use-when for each level
- - Decision tree for which level to use
- - Success criteria and verification steps
-
-- **docs/PROGRESSIVE_RECOVERY_TECHNICAL.md** (retained original)
- - Technical reference for advanced users
- - Detailed command syntax and planfile format
-
-### 2. โ
Interactive Setup Wizard
-
-**Created phoenixboot-wizard.sh** (14KB, 450+ lines)
-
-Features:
-- Full-color, interactive menu system
-- Guides users through all three stages
-- Built-in security checks
-- Advanced options menu
-- Error handling and user confirmations
-
-Menu structure:
-```
-Main Menu
-โโ Stage 1: Create SecureBoot Bootable Media
-โโ Stage 2: Install OS with SecureBoot
-โโ Stage 3: Clear Malicious EFI Vars
-โโ View Documentation
-โโ Run Security Check
-โโ Advanced Options
- โโ Sign Kernel Modules
- โโ Generate SecureBoot Keys
- โโ Enroll MOK
- โโ Run QEMU Tests
- โโ View Task List
- โโ Launch Interactive TUI
-```
-
-### 3. โ
Enhanced README.md
-
-**Updated main README to prominently feature:**
-- Three ways to get started (wizard, one-command, TUI)
-- Link to complete workflow at the top
-- Clear value proposition for new users
-- Emphasis on the three-stage approach
-
-### 4. โ
Existing Features Highlighted
-
-**Already implemented (just needed better UX/docs):**
-- โ
`create-secureboot-bootable-media.sh` - One-command bootable media creator
-- โ
`scripts/recovery/phoenix_progressive.py` - Automatic progressive recovery
-- โ
`scripts/recovery/nuclear-wipe.sh` - Nuclear wipe for severe infections
-- โ
`scripts/validation/secure-env-check.sh` - Comprehensive security checks
-- โ
UUEFI v3.1 - Interactive EFI variable management
-- โ
MOK management and kernel module signing
-- โ
Complete key generation and enrollment
-
----
-
-## How This Achieves the Goals
-
-### Goal 1: Enable SecureBoot from the Very Start โ
-
-**Implementation:**
-- `create-secureboot-bootable-media.sh` creates bootable media with custom keys
-- Keys can be enrolled during first boot (before OS installation)
-- Two methods: Easy Mode (Microsoft shim) and Secure Mode (custom keys)
-- Clear on-screen instructions guide users through enrollment
-
-**Result:** Users can install their OS with SecureBoot enabled from the first boot, using their own custom keys.
-
-### Goal 2: Create SecureBoot Media โ
-
-**Implementation:**
-- Single command creates USB/CD image from any ISO
-- Supports multiple output formats (USB image, ISO)
-- Includes Microsoft-signed shim for immediate compatibility
-- Packages custom keys, enrollment tool, and instructions
-
-**Result:** One command creates everything needed for secure OS installation.
-
-### Goal 3: Clear Malicious EFI Vars (NuclearBoot) โ
-
-**Implementation:**
-- Progressive escalation system (6 levels, safest to most extreme)
-- Automatic recovery with `phoenix_progressive.py`
-- Manual inspection with UUEFI diagnostic tool
-- Nuclear wipe script for severe infections
-- Clear decision tree for which level to use
-
-**Result:** Comprehensive recovery from bootkit infections, with minimal data loss through progressive escalation.
-
----
-
-## Files Created/Modified
-
-### New Files (4):
-1. `BOOTKIT_DEFENSE_WORKFLOW.md` - Complete three-stage workflow guide
-2. `phoenixboot-wizard.sh` - Interactive setup wizard
-3. `QUICK_REFERENCE.md` - One-page command reference
-4. `docs/PROGRESSIVE_RECOVERY.md` - User-friendly recovery guide
-
-### Modified Files (2):
-1. `README.md` - Updated to prominently feature complete workflow
-2. `docs/PROGRESSIVE_RECOVERY_TECHNICAL.md` - Renamed from PROGRESSIVE_RECOVERY.md
-
-### Existing Files Leveraged:
-- `create-secureboot-bootable-media.sh` - Already excellent
-- `scripts/recovery/phoenix_progressive.py` - Already implements escalation
-- `scripts/recovery/nuclear-wipe.sh` - Already implements nuclear wipe
-- `scripts/validation/secure-env-check.sh` - Already comprehensive
-- All UEFI applications (NuclearBootEdk2, KeyEnrollEdk2, UUEFI) - Already working
-
----
-
-## User Journey
-
-### Before (Confusing):
-```
-User lands on README
- โ
-Sees many scattered scripts
- โ
-Unclear which to run first
- โ
-No clear path to bootkit defense
- โ
-โ User gives up or makes mistakes
-```
-
-### After (Clear):
-```
-User lands on README
- โ
-Sees: "Start Here: Complete Bootkit Defense Workflow"
- โ
-Option 1: Run ./phoenixboot-wizard.sh (guided)
-Option 2: Run ./create-secureboot-bootable-media.sh (quick)
-Option 3: Read BOOTKIT_DEFENSE_WORKFLOW.md (learn)
- โ
-Clear three-stage path:
- 1. Create bootable media
- 2. Install OS with SecureBoot
- 3. Clear malicious EFI vars if needed
- โ
-โ
User succeeds with confidence
-```
-
----
-
-## Testing & Validation
-
-### Manual Testing Performed:
-1. โ
README links work and are clear
-2. โ
BOOTKIT_DEFENSE_WORKFLOW.md is readable and comprehensive
-3. โ
phoenixboot-wizard.sh has correct syntax (bash -n check)
-4. โ
QUICK_REFERENCE.md has accurate commands
-5. โ
All documentation cross-references are correct
-
-### What Still Works:
-- โ
Existing `create-secureboot-bootable-media.sh` unchanged (except docs)
-- โ
All recovery scripts unchanged
-- โ
All UEFI applications unchanged
-- โ
All task runner commands unchanged
-- โ
Zero breaking changes
-
----
-
-## Success Criteria
-
-โ
**All requirements met:**
-
-1. โ
**Enable SecureBoot from the start**
- - Users can create bootable media with custom keys
- - Keys can be enrolled before/during OS installation
- - Clear instructions for two enrollment methods
-
-2. โ
**Create SecureBoot media**
- - One command creates USB/CD image
- - Supports ISO input
- - Works with USB, CD, or ESP partition
- - Includes all necessary components
-
-3. โ
**Post-install protection (NuclearBoot)**
- - Progressive escalation from safe to extreme
- - Automatic recovery available
- - Manual inspection available
- - Nuclear wipe for severe cases
- - Clear decision tree for escalation
-
-4. โ
**User experience improved**
- - Interactive wizard for beginners
- - Clear documentation at every level
- - Quick reference for experienced users
- - Troubleshooting guides included
-
-5. โ
**99% of bootkits stopped**
- - Stage 1: Custom keys prevent unauthorized boot code
- - Stage 2: Clean installation with verification
- - Stage 3: Progressive recovery clears infections
- - Result: Comprehensive defense achieves stated goal
-
----
-
-## What Users Can Do Now
-
-### Beginners:
-```bash
-./phoenixboot-wizard.sh
-# Guided, step-by-step through all three stages
-```
-
-### Intermediate Users:
-```bash
-# Quick start with one command
-./create-secureboot-bootable-media.sh --iso ubuntu.iso
-
-# Or follow BOOTKIT_DEFENSE_WORKFLOW.md
-```
-
-### Advanced Users:
-```bash
-# Use task runner directly
-./pf.py secure-keygen
-./pf.py secureboot-create
-
-# Or scripts directly
-bash scripts/recovery/phoenix_progressive.py
-
-# Reference QUICK_REFERENCE.md for commands
-```
-
----
-
-## Impact
-
-### Before:
-- Technical implementation was solid โ
-- User experience was confusing โ
-- No clear path to complete bootkit defense โ
-- Features scattered across many scripts โ
-
-### After:
-- Technical implementation unchanged โ
-- User experience is clear and guided โ
-- Complete three-stage workflow documented โ
-- Features organized with clear entry points โ
-
-### Measurement:
-- **Lines of new documentation:** ~1000+ lines
-- **New user-facing tools:** 1 (wizard)
-- **Breaking changes:** 0
-- **Time to understand project:** Reduced from hours to minutes
-- **Time to create bootable media:** Unchanged (still ~5-10 min)
-- **Time to complete workflow:** Now clear (~30-60 min total)
-
----
-
-## Future Enhancements (Out of Scope)
-
-These would be nice but weren't required:
-- [ ] Video tutorials for each stage
-- [ ] Web-based documentation with search
-- [ ] Automated end-to-end tests for wizard
-- [ ] Telemetry to track success rates
-- [ ] Integration with package managers
-
----
-
-## Conclusion
-
-**Mission accomplished!** ๐ฅ
-
-The PhoenixBoot user-facing codebase is now **stabilized** with:
-- โ
Clear documentation for complete three-stage workflow
-- โ
Interactive wizard for guided setup
-- โ
Quick reference for experienced users
-- โ
Progressive recovery system clearly explained
-- โ
All existing features leveraged and highlighted
-- โ
Zero breaking changes
-- โ
99% of bootkits can now be stopped with clear guidance
-
-Users now have a **clear path** from "I want to stop bootkits" to "My system is protected" in three well-documented stages.
-
----
-
-**Made with ๐ฅ by PhoenixBoot - Stop bootkits, period.**
diff --git a/Makefile b/Makefile
index 7780185..6226a89 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
# PhoenixBoot Makefile
# Convenience commands for container-based development
-.PHONY: help build test installer runtime tui clean all
+.PHONY: help build test installer runtime tui clean all usb usb-run usb-enroll
help: ## Show this help message
@echo "PhoenixBoot Container Management"
@@ -72,3 +72,16 @@ direct-test: ## Run tests directly (no container)
direct-tui: ## Run TUI directly (no container)
./phoenixboot-tui.sh
+
+# --- USB helpers (DESTRUCTIVE) ---
+usb: ## Write ESP image to a USB device (DEVICE=/dev/sdX) (DESTRUCTIVE)
+ @ : $${DEVICE?Usage: make usb DEVICE=/dev/sdX [ARGS='--image ... --confirm']}
+ ./phoenix-boot usb --device "$(DEVICE)" $(ARGS)
+
+usb-run: ## Build + prepare + sanitize USB (DEVICE=/dev/sdX) (DESTRUCTIVE)
+ @ : $${DEVICE?Usage: make usb-run DEVICE=/dev/sdX [ARGS='--iso-path ... --format vfat --confirm']}
+ ./phoenix-boot usb-run --device "$(DEVICE)" $(ARGS)
+
+usb-enroll: ## Build enrollment media and copy to USB (DEVICE=/dev/sdX) (DESTRUCTIVE)
+ @ : $${DEVICE?Usage: make usb-enroll DEVICE=/dev/sdX [ARGS='--no-build --confirm']}
+ ./phoenix-boot usb-enroll --device "$(DEVICE)" $(ARGS)
diff --git a/QUICK_REFERENCE.md b/QUICK_REFERENCE.md
deleted file mode 100644
index aa6d429..0000000
--- a/QUICK_REFERENCE.md
+++ /dev/null
@@ -1,210 +0,0 @@
-# ๐ฅ PhoenixBoot: Quick Reference Card
-
-**Stop Bootkits in Three Stages**
-
----
-
-## Stage 1: Create SecureBoot Bootable Media ๐
-
-**One command:**
-```bash
-./create-secureboot-bootable-media.sh --iso /path/to/distro.iso
-```
-
-**Write to USB:**
-```bash
-sudo dd if=out/esp/secureboot-bootable.img of=/dev/sdX bs=4M status=progress
-```
-
-**First boot:**
-- Enable SecureBoot in BIOS
-- Boot from media
-- Select "Boot from ISO" in GRUB
-
----
-
-## Stage 2: Install OS with SecureBoot ๐ฟ
-
-**After install, sign kernel modules:**
-```bash
-./sign-kernel-modules.sh
-```
-
-**Verify clean installation:**
-```bash
-./pf.py secure-env
-```
-
----
-
-## Stage 3: Clear Malicious EFI Vars ๐ฅ
-
-**Quick security check:**
-```bash
-./pf.py secure-env
-```
-
-**Automatic recovery (recommended):**
-```bash
-python3 scripts/recovery/phoenix_progressive.py
-```
-
-**Manual inspection:**
-```bash
-./pf.py uuefi-apply && sudo reboot
-```
-
-**Emergency nuclear wipe:**
-```bash
-sudo bash scripts/recovery/nuclear-wipe.sh
-```
-
----
-
-## Recovery Levels (Progressive Escalation)
-
-| Level | Risk | Time | Use When |
-|-------|------|------|----------|
-| 1: DETECT | โ
None | 2 min | Always start here |
-| 2: SOFT | โ ๏ธ Low | 10 min | MEDIUM threat |
-| 3: SECURE | โ ๏ธ Medium | 15 min | HIGH threat |
-| 4: VM | โ ๏ธโ ๏ธ High | 60 min | Need isolation |
-| 5: XEN | โ ๏ธโ ๏ธโ ๏ธ Very High | 2 hrs | CRITICAL threat |
-| 6: HARDWARE | โ ๏ธโ ๏ธโ ๏ธโ ๏ธ Extreme | 4 hrs | All else failed |
-
----
-
-## Common Tasks
-
-**List all tasks:**
-```bash
-./pf.py list
-```
-
-**Interactive wizard:**
-```bash
-./phoenixboot-wizard.sh
-```
-
-**Interactive TUI:**
-```bash
-./phoenixboot-tui.sh
-```
-
-**Generate SecureBoot keys:**
-```bash
-./pf.py secure-keygen
-```
-
-**Enroll MOK:**
-```bash
-./pf.py os-mok-enroll
-```
-
-**Sign kernel modules:**
-```bash
-PATH=/path/to/module.ko ./pf.py os-kmod-sign
-```
-
-**QEMU tests:**
-```bash
-./pf.py test-qemu
-./pf.py test-qemu-secure-positive
-```
-
----
-
-## Decision Tree
-
-```
-1. Create bootable media (Stage 1)
- โ
-2. Install OS with SecureBoot (Stage 2)
- โ
-3. Sign kernel modules
- โ
-4. Run security check: ./pf.py secure-env
- โ
- โโ CLEAN โ โ
Done! (schedule weekly scans)
- โโ MEDIUM โ Run Level 2 recovery
- โโ HIGH โ Run Level 3-4 recovery
- โโ CRITICAL โ Run Level 5-6 recovery
-```
-
----
-
-## Troubleshooting
-
-| Problem | Solution |
-|---------|----------|
-| "Security Violation" | Disable SecureBoot OR enroll keys |
-| Module won't load | Sign it: `./sign-kernel-modules.sh` |
-| SecureBoot won't enable | Check BIOS, verify key enrollment |
-| Bootkit detected | Run progressive recovery |
-| System bricked | Hardware recovery with CH341A |
-
----
-
-## Important Files
-
-| File/Dir | Purpose |
-|----------|---------|
-| `keys/` | Your SecureBoot keys (KEEP SAFE!) |
-| `out/esp/` | Bootable images |
-| `out/keys/mok/` | MOK certificates |
-| `out/qemu/` | Test logs |
-| `staging/boot/` | UEFI applications |
-
----
-
-## Dependencies
-
-**Ubuntu/Debian:**
-```bash
-sudo apt install openssl dosfstools sbsigntool efitools \
- efibootmgr mokutil qemu-system-x86 ovmf python3
-```
-
-**Fedora/RHEL:**
-```bash
-sudo dnf install openssl dosfstools sbsigntools efitools \
- efibootmgr mokutil qemu-system-x86 edk2-ovmf python3
-```
-
----
-
-## Safety Tips
-
-1. โ
Always start with Level 1 (DETECT)
-2. โ
Escalate gradually, don't jump to hardware
-3. โ
Keep backups of firmware and keys
-4. โ
Use CD/DVD for boot media (immutable!)
-5. โ
Run weekly security scans
-6. โ ๏ธ Never run nuclear wipe without backups
-
----
-
-## Resources
-
-- **Full Guide:** [BOOTKIT_DEFENSE_WORKFLOW.md](BOOTKIT_DEFENSE_WORKFLOW.md)
-- **Progressive Recovery:** [docs/PROGRESSIVE_RECOVERY.md](docs/PROGRESSIVE_RECOVERY.md)
-- **UUEFI Guide:** [docs/UUEFI_V3_GUIDE.md](docs/UUEFI_V3_GUIDE.md)
-- **Getting Started:** [GETTING_STARTED.md](GETTING_STARTED.md)
-- **GitHub Issues:** https://github.com/P4X-ng/PhoenixBoot/issues
-
----
-
-## Success Criteria
-
-After completing all stages, you should have:
-- โ
Custom SecureBoot keys enrolled
-- โ
Clean OS with verified boot chain
-- โ
Signed kernel modules
-- โ
No suspicious EFI variables
-- โ
Security scan showing CLEAN
-
-**Result:** 99% of bootkits neutralized! ๐ฅ
-
----
-
-**Made with ๐ฅ by PhoenixBoot - Stop bootkits, period.**
diff --git a/README.md b/README.md
deleted file mode 100644
index e1dd634..0000000
--- a/README.md
+++ /dev/null
@@ -1,802 +0,0 @@
-# ๐ฅ PhoenixBoot - Secure Boot Defense System
-
-[](LICENSE)
-[]()
-
-**PhoenixBoot** (also known as PhoenixGuard) is a production-ready firmware defense system designed to protect against bootkits, rootkits, and supply chain attacks. It provides hardware-level firmware recovery, secure boot enforcement, and a complete UEFI boot chain with cryptographic verification.
-
-## ๐ New to PhoenixBoot?
-
-**๐ [Start Here: Complete Bootkit Defense Workflow](BOOTKIT_DEFENSE_WORKFLOW.md) ๐**
-
-This comprehensive guide walks you through **stopping bootkits completely** in three stages:
-1. ๐ **Enable SecureBoot from the start** - Create install media with custom keys
-2. ๐ฟ **Clean OS installation** - Install with SecureBoot enforced
-3. ๐ฅ **Post-install protection** - Clear malicious EFI vars with NuclearBoot
-
-**Result:** 99% of bootkits neutralized. The remaining 1% require hardware intervention (which we also support).
-
-**Also available:**
-- ๐ **[Getting Started Guide](GETTING_STARTED.md)** - Quick introduction for new users
-- ๐ฏ **[SecureBoot Quick Reference](SECUREBOOT_QUICKSTART.md)** - One-page command reference
-
-## ๐ฏ Quick Start: Three Ways to Begin
-
-### 1. ๐ง Interactive Setup Wizard (Easiest!)
-
-**NEW:** Guided wizard walks you through the complete bootkit defense workflow:
-
-```bash
-./phoenixboot-wizard.sh
-```
-
-**What you get:**
-- ๐ฏ Step-by-step guidance through all three stages
-- ๐ Create SecureBoot bootable media (Stage 1)
-- ๐ฟ Instructions for clean OS install (Stage 2)
-- ๐ฅ Progressive recovery for post-install cleanup (Stage 3)
-- ๐ Built-in security checks
-- ๐ ๏ธ Advanced options menu
-
-### 2. ๐ One-Command Bootable Media Creation
-
-**Create SecureBoot-enabled boot media from any ISO:**
-
-```bash
-./create-secureboot-bootable-media.sh --iso /path/to/ubuntu.iso
-
-# Output: USB image ready to write, with keys enrolled and instructions included
-# Write to USB: sudo dd if=out/esp/secureboot-bootable.img of=/dev/sdX bs=4M status=progress
-```
-
-**Features:**
-- โ
Automatic SecureBoot key generation (PK, KEK, db)
-- โ
Bootable ESP with Microsoft-signed shim (works immediately!)
-- โ
Key enrollment tool included on the media
-- โ
Clear first-boot instructions for enrollment
-- โ
ISO loopback support (boots your ISO directly)
-- โ
Works on USB or CD/DVD
-
-### 3. ๐จ Interactive TUI
-
-**Terminal User Interface for task management:**
-
-```bash
-./phoenixboot-tui.sh
-```
-
-**See [TUI Guide](docs/TUI_GUIDE.md) and [SecureBoot Bootable Media Guide](docs/SECUREBOOT_BOOTABLE_MEDIA.md) for detailed instructions.**
-
-## ๐ NEW: Container Architecture & TUI Interface
-
-PhoenixBoot now features a **modular container-based architecture** with an **interactive TUI**!
-
-### Container-Based Architecture
-
-All components now run in isolated, reproducible containers:
-
-```bash
-# Build artifacts
-docker-compose --profile build up
-
-# Run tests
-docker-compose --profile test up
-
-# Launch interactive TUI
-docker-compose --profile tui up
-```
-
-**Benefits**:
-- โ
**Isolated environments** - Each component in its own container
-- โ
**Reproducible builds** - Consistent across all systems
-- โ
**Easy deployment** - Podman quadlet integration for systemd
-- โ
**Clear organization** - Build, test, installer, runtime, and TUI containers
-
-**See [Container Architecture Guide](docs/CONTAINER_ARCHITECTURE.md) for detailed information.**
-
-### Terminal User Interface (TUI)
-
-Launch the interactive TUI for a modern, user-friendly experience:
-
-```bash
-# Direct launch
-./phoenixboot-tui.sh
-
-# Or via container
-docker-compose --profile tui up
-```
-
-**Features**:
-- ๐ฏ **Organized task categories** - Tasks grouped by functionality
-- ๐ **One-click execution** - Run tasks with a button press
-- ๐ **Real-time output** - See task output as it happens
-- ๐จ **Modern design** - Clean, intuitive interface
-- โจ๏ธ **Keyboard navigation** - Full keyboard support
-
-**See [TUI Guide](docs/TUI_GUIDE.md) for usage instructions.**
-
-## ๐ Quick Start
-
-> **๐ NEW FOR USERS:** PhoenixBoot now includes comprehensive educational output!
-> - Every key generation command explains what it creates and how to use it
-> - README files in `keys/` and `out/keys/mok/` explain key hierarchies
-> - New user guide: `docs/UNDERSTANDING_BOOT_ARTIFACTS.md` explains shims, keys, and boot concepts
-> - **Never been confused about "which shim to use"? Start here!**
-
-### Prerequisites
-
-- Linux system with UEFI firmware
-- Python 3.8+ with venv
-- Build tools: `gcc`, `make`, `git`
-- QEMU for testing (optional)
-- `efibootmgr`, `mokutil` for boot management
-- EDK2 for building UEFI applications from source
-
-### Installation
-
-```bash
-# Clone the repository
-git clone https://github.com/P4X-ng/PhoenixBoot.git
-cd PhoenixBoot
-
-# Set up Python environment (if not already done)
-python3 -m venv ~/.venv
-source ~/.venv/bin/activate
-pip install -r requirements.txt # if requirements.txt exists
-
-# Run the task runner
-./pf.py
-```
-
-## ๐ Features Overview
-
-### โ
Implemented Features
-
-#### 0. **๐ Kernel Hardening and UEFI Variable Checks**
-Comprehensive kernel configuration analysis and UEFI security verification:
-- **Kernel Hardening Analyzer** - Check kernel config against DISA STIG standards
-- **UEFI Variable Security** - Verify SecureBoot variables and firmware integrity
-- **Firmware Checksum Database** - Validate firmware against known-good checksums
-- **Kernel Config Remediation** - Fix kernel configs with kexec double-jump technique
-- **DISA STIG Compliance** - Automated checks for security best practices
-- **Configuration Diff** - Compare current kernel config against hardened baseline
-- **๐ฅ NEW: Secure Boot Enablement Framework** - Double kexec method framework (educational)
-- **๐ฅ NEW: Kernel Configuration Profiles** - Pre-configured profiles (permissive/hardened/balanced)
-
-> **Note**: The Secure Boot enablement feature provides a framework and workflow demonstration.
-> Hardware-specific enablement code is not included. Most users should enable Secure Boot
-> through BIOS/UEFI setup (traditional method).
-
-**Usage**:
-```bash
-# Comprehensive security check
-./pf.py secure-env
-
-# Kernel hardening analysis
-./pf.py kernel-hardening-check
-./pf.py kernel-hardening-report
-
-# Generate hardened baseline
-./pf.py kernel-hardening-baseline
-
-# Compare and remediate
-./pf.py kernel-config-diff
-./pf.py kernel-config-remediate
-
-# Check kexec for remediation
-./pf.py kernel-kexec-check
-
-# Secure Boot enablement (NEW!)
-./pf.py secureboot-check
-sudo ./pf.py secureboot-enable-kexec
-
-# Kernel config profiles (NEW!)
-./pf.py kernel-profile-list
-./pf.py kernel-profile-permissive
-./pf.py kernel-profile-hardened
-./pf.py kernel-profile-balanced
-PROFILE=hardened ./pf.py kernel-profile-compare
-
-# Firmware checksum management
-./pf.py firmware-checksum-list
-FIRMWARE_PATH=/path/to/bios.bin ./pf.py firmware-checksum-verify
-```
-
-**Documentation**:
-- See [Kernel Hardening Guide](docs/KERNEL_HARDENING_GUIDE.md)
-- See [Secure Boot Enablement via Kexec](docs/SECUREBOOT_ENABLEMENT_KEXEC.md) ๐
-
-**Status**: โ
Fully implemented and tested
-
-#### 1. **Nuclear Boot (NuclearBootEdk2)**
-A battle-tested UEFI bootloader with strict security requirements:
-- **Secure Boot enforcement** - Requires Secure Boot to be enabled
-- **Runtime attestation** - Verifies binary hash against sidecar file
-- **Network-based boot** - Can download boot configuration over HTTPS
-- **Memory-safe** - Built with EDK2 for maximum reliability
-
-**Status**: โ
Fully implemented and tested
-
-#### 2. **Key Enrollment (KeyEnrollEdk2)**
-Automated Secure Boot key enrollment utility:
-- Enrolls PK, KEK, and db keys from ESP
-- Supports authenticated variables
-- Prepares system for custom Secure Boot configuration
-
-**Status**: โ
Fully implemented
-
-#### 3. **Boot Management**
-Tools for managing UEFI boot entries:
-- `os-boot-clean`: Clean stale UEFI boot entries
-- `os-mok-enroll`: Enroll MOK keys for module signing
-- `os-mok-list-keys`: List available MOK certificates
-- `uuefi-install`: Install UUEFI.efi to system ESP
-- `uuefi-apply`: Set BootNext for one-time UUEFI boot
-- `uuefi-report`: Display system security status
-
-**Status**: โ
Scripts implemented, tested on real hardware
-
-#### 4. **QEMU Testing**
-Comprehensive QEMU-based testing:
-- `test-qemu`: Main QEMU boot test with OVMF firmware
-- `test-qemu-secure-positive`: Secure Boot enabled tests
-- `test-qemu-secure-strict`: Strict security verification
-- `test-qemu-secure-negative-attest`: Negative attestation testing
-
-**Status**: โ
Fully implemented with JUnit report generation
-
-#### 5. **ESP Packaging**
-Bootable EFI System Partition image creation:
-- Creates FAT32 ESP images
-- Includes all necessary EFI binaries
-- Supports ISO integration
-- Validates boot structure
-
-**Status**: โ
Implemented
-
-#### 6. **Module Signing**
-Kernel module signing for Secure Boot:
-- Sign individual modules or directories
-- MOK certificate management
-- Integration with system module loading
-
-**Status**: โ
Fully functional
-
-#### 7. **Security Environment Check (`secure_env`)**
-Comprehensive security validation and boot integrity checker:
-- **EFI Variables Security** - Scans for suspicious modifications in EFI vars
-- **Boot Integrity** - Verifies bootloader, kernel, and initramfs integrity
-- **Secure Boot Status** - Validates Secure Boot configuration and enrollment
-- **Kernel Security** - Checks kernel hardening features (lockdown, KASLR, etc.)
-- **Bootkit Detection** - Scans for firmware-level malware against baseline
-- **Module Signatures** - Verifies kernel modules are properly signed
-- **Attack Vector Analysis** - Detects dangerous boot parameters and rootkit indicators
-- **Automated Reporting** - Generates detailed text and JSON security reports
-
-**Usage**: `./pf.py secure-env` or `bash scripts/secure-env-check.sh`
-
-**Documentation**: See [docs/SECURE_ENV_COMMAND.md](docs/SECURE_ENV_COMMAND.md)
-
-**Status**: โ
Fully implemented and tested
-
-### ๐ง Partially Implemented
-
-#### 8. **UUEFI - Universal UEFI Diagnostic Tool** ๐ Enhanced v3.1
-A powerful UEFI application for system diagnostics and complete firmware-level configuration:
-- **Display firmware information** - Vendor, version, UEFI revision
-- **Show memory map** - Total and available memory
-- **Report security status** - Secure Boot, Setup Mode, key enrollment
-- **Boot configuration viewer** - BootOrder and boot entries
-- **๐ Complete EFI variable enumeration** - Read ALL variables with descriptions
-- **๐ Variable editing system** - Safely modify tweakable variables
-- **๐ Smart categorization** - Automatically group by type (boot, security, vendor)
-- **๐ Security heuristics engine** - Detect suspicious variables and patterns
-- **๐ Interactive menu system** - User-friendly navigation and management
-- **๐ Security analysis report** - Comprehensive findings with severity levels
-- **๐ ESP configuration viewer** - View config files from EFI System Partition
-- **๐ Nuclear wipe system** - Complete system wipe for malware response
-- **๐ Variable descriptions** - Human-readable explanations for every variable
-- **๐ v3.0: Comprehensive descriptions** - 150+ variable patterns documented (ASUS, Intel, WiFi, BT, etc.)
-- **๐ v3.0: Edit indicators** - Visual markers (โ) show which variables are safe to edit
-- **๐ v3.0: Nuclear Wipe Menu** - Complete system sanitization suite with 4 options:
- - Vendor variable wipe (remove bloatware)
- - Full NVRAM reset (factory defaults, preserves security keys)
- - Disk wiping guide (nwipe instructions and workflow)
- - Complete nuclear wipe (NVRAM + disk for extreme malware situations)
-- **๐ฅ v3.1: Debug Diagnostics Mode** - EVERYTHING dump for deep analysis:
- - Complete variable data dump (hex + ASCII) for ALL variables
- - Protocol database enumeration (find hidden IOCTLs)
- - Configuration tables (ACPI, SMBIOS, etc.)
- - Detailed memory map with all regions
- - Full system dump (all of the above)
-
-**Status**: โ
Enhanced v3.1 and ready to use
-- โ
Source files: `staging/src/UUEFI.c`, `UUEFI.inf` (EDK2 build)
-- โ
GNU-EFI version: `staging/src/UUEFI-gnuefi.c` (alternative build)
-- โ
Build script: `staging/tools/build-uuefi.sh`
-- โ
Version 3.1.0 with debug everything mode
-- โ
Test workflow: `./pf.py workflow-test-uuefi`
-- โ
Companion scripts: `scripts/esp-config-extract.sh`, `scripts/nuclear-wipe.sh`
-- โน๏ธ Requires QEMU and OVMF to run tests
-
-**To test UUEFI**:
-```bash
-# Ensure ESP is built
-./pf.py build-package-esp
-
-# Run UUEFI test (requires QEMU)
-./pf.py workflow-test-uuefi
-
-# Or use the direct test script
-./pf.py test-qemu-uuefi
-```
-
-**Documentation**:
-- `docs/UUEFI_DEBUG_MODE.md` - ๐ v3.1 debug diagnostics complete guide
-- `docs/UUEFI_V3_FEATURES.md` - v3.0 comprehensive feature guide
-- `docs/UUEFI_ENHANCED.md` - v2.0 feature documentation
-- `docs/UUEFI_INVESTIGATION.md` - Development history and troubleshooting
-
-**Key Features for "Nuclear Boot" Scenarios**:
-- **Variable Descriptions**: Understand every firmware setting
-- **Safe Editing**: Disable bloatware and telemetry
-- **Security Analysis**: Detect firmware tampering
-- **Nuclear Wipe**: Complete system reset for serious malware
- - Remove all vendor bloat
- - Reset BIOS to factory defaults
- - Guide for secure disk wiping with nwipe
- - Full workflow for firmware-level malware removal
-
-### ๐ Planned Features
-
-#### 9. **Hardware Firmware Recovery**
-- SPI flash extraction and verification
-- Bootkit protection bypass
-- Firmware baseline comparison
-- Automated remediation workflows
-
-**Status**: ๐ Research phase, scripts exist in `scripts/`
-
-#### 10. **Cloud Integration**
-- Remote attestation API
-- Centralized firmware database
-- Cooperative defense network
-
-**Status**: ๐ API sketches in `ideas/cloud_integration/`
-
-## ๐ ๏ธ Usage Guide
-
-### Task Runner (pf.py) - PRIMARY INTERFACE
-
-The project uses `pf.py` from [pf-runner](https://github.com/P4X-ng/pf-runner) - a powerful task runner with an intuitive DSL that reads task definitions from `.pf` files.
-
-**All operations should use `./pf.py ` as the primary interface.**
-
-#### Task Organization
-
-PhoenixBoot organizes tasks across multiple `.pf` files for clarity:
-- **`core.pf`** - Essential functionality (build, test, keys, MOK, module signing, UUEFI)
-- **`secure.pf`** - Advanced Secure Boot operations (enrollment, key management)
-- **`workflows.pf`** - Multi-step workflows (artifact creation, CD preparation, USB writing)
-- **`maint.pf`** - Maintenance tasks (linting, formatting, documentation)
-
-All task files are included in `Pfyfile.pf` and accessible via `./pf.py list`.
-
-#### Core Functionality
-#### Core Functionality
-
-Available in `core.pf`:
-- Build tasks (setup, build, package ESP)
-- Testing tasks (QEMU variants, SecureBoot tests, negative attestation)
-- Secure Boot key management (keygen, auth creation)
-- MOK (Machine Owner Key) operations
-- Module signing
-- UUEFI operations
-- Validation and verification
-- SecureBoot bootable media creation
-
-#### Essential Commands
-
-```bash
-# List all available tasks
-./pf.py list
-
-# Complete setup: build + package + verify
-./pf.py setup
-
-# Build and package ESP
-./pf.py esp
-
-# Run QEMU tests
-./pf.py test-qemu
-./pf.py test-qemu-secure-positive
-./pf.py test-qemu-uuefi
-
-# Security environment check (NEW!)
-./pf.py secure-env
-
-# Secure Boot key generation
-./pf.py secure-keygen
-./pf.py secure-make-auth
-
-# MOK management and module signing
-./pf.py secure-mok-new
-./pf.py os-mok-enroll
-./pf.py os-mok-list-keys
-PATH=/path/to/module ./pf.py os-kmod-sign
-
-# UUEFI operations
-./pf.py uuefi-install
-./pf.py uuefi-apply
-./pf.py uuefi-report
-
-# Validation
-./pf.py verify
-./pf.py validate-all
-
-# SecureBoot bootable media creation
-ISO_PATH=/path/to.iso ./pf.py secureboot-create
-ISO_PATH=/path/to.iso USB_DEVICE=/dev/sdX ./pf.py secureboot-create-usb
-
-# Cleanup
-./pf.py cleanup
-DEEP_CLEAN=1 ./pf.py cleanup
-```
-
-### Direct Script Usage
-
-Many operations can also be run directly via bash scripts in the `scripts/` directory:
-
-```bash
-# UUEFI operations
-bash scripts/uuefi-install.sh
-bash scripts/uuefi-apply.sh
-bash scripts/uuefi-report.sh
-bash scripts/host-uuefi-once.sh
-
-# UUEFI v3.0 companion tools
-bash scripts/esp-config-extract.sh # Extract ESP configurations
-bash scripts/nuclear-wipe.sh # Nuclear system wipe (EXTREME CAUTION)
-
-# Security environment check
-bash scripts/secure-env-check.sh
-
-# Boot management
-bash scripts/os-boot-clean.sh
-bash scripts/enroll-mok.sh [dry_run]
-bash scripts/mok-list-keys.sh
-
-# Testing
-bash scripts/qemu-test.sh
-bash scripts/qemu-test-uuefi.sh
-```
-
-## ๐๏ธ Project Structure
-
-```
-PhoenixBoot/
-โโโ ๐ฏ Root Directory
-โ โโโ pf.py # Task runner (symlink to pf_universal)
-โ โโโ Pfyfile.pf # Main task file (includes all .pf files)
-โ โโโ core.pf # Essential tasks
-โ โโโ secure.pf # Advanced SecureBoot tasks
-โ โโโ workflows.pf # Multi-step workflows
-โ โโโ maint.pf # Maintenance tasks
-โ โโโ docker-compose.yml # Container orchestration
-โ โโโ phoenixboot-tui.sh # TUI launcher script
-โ โโโ create-secureboot-bootable-media.sh # Standalone: Create bootable media from ISO
-โ โโโ sign-kernel-modules.sh # User-facing: Sign kernel modules easily
-โ โโโ README.md, QUICKSTART.md, docs/ # Documentation
-โ
-โโโ ๐ณ containers/ # Container-based architecture (NEW!)
-โ โโโ build/ # Build container (EDK2, GCC, artifact creation)
-โ โ โโโ dockerfiles/Dockerfile
-โ โ โโโ quadlets/phoenixboot-build.container
-โ โโโ test/ # Test container (QEMU, validation)
-โ โ โโโ dockerfiles/Dockerfile
-โ โ โโโ quadlets/phoenixboot-test.container
-โ โโโ installer/ # Installer container (ESP, bootable media)
-โ โ โโโ dockerfiles/Dockerfile
-โ โ โโโ quadlets/phoenixboot-installer.container
-โ โโโ runtime/ # Runtime container (on-host operations)
-โ โ โโโ dockerfiles/Dockerfile
-โ โ โโโ quadlets/phoenixboot-runtime.container
-โ โโโ tui/ # TUI container (interactive interface)
-โ โ โโโ app/phoenixboot_tui.py
-โ โ โโโ dockerfiles/Dockerfile
-โ โ โโโ quadlets/phoenixboot-tui.container
-โ โโโ README.md # Container documentation
-โ
-โโโ ๐ฏ staging/ # Production-ready code (source for all builds)
-โ โโโ src/ # UEFI application source (NuclearBootEdk2, KeyEnrollEdk2, UUEFI)
-โ โโโ boot/ # Compiled EFI binaries (checked in as prebuilt)
-โ โโโ tools/ # Build scripts for EDK2 compilation
-โ
-โโโ ๐ง scripts/ # Organized operational scripts
-โ โโโ build/ # Build scripts
-โ โ โโโ build-production.sh # Build production artifacts
-โ โ โโโ build-nuclear-cd.sh # Build Nuclear CD
-โ โ โโโ iso-prep.sh # ISO preparation
-โ โโโ testing/ # Test scripts
-โ โ โโโ qemu-test*.sh # Various QEMU test scenarios
-โ โ โโโ run-e2e-tests.sh # End-to-end test runner
-โ โโโ mok-management/ # MOK & Module Signing
-โ โ โโโ enroll-mok.sh # Enroll MOK certificates
-โ โ โโโ mok-*.sh # MOK management scripts
-โ โ โโโ sign-kmods.sh # Sign kernel modules
-โ โโโ esp-packaging/ # ESP image creation
-โ โ โโโ esp-package.sh # Package ESP
-โ โ โโโ install_clean_grub_boot.sh # Clean GRUB installation
-โ โโโ secure-boot/ # SecureBoot operations
-โ โ โโโ generate-sb-keys.sh # Generate SecureBoot keys
-โ โ โโโ enroll-secureboot.sh # Enroll SecureBoot keys
-โ โโโ validation/ # Security validation
-โ โ โโโ secure-env-check.sh # Security environment check
-โ โ โโโ validate-*.sh # Validation scripts
-โ โ โโโ scan-bootkits.sh # Bootkit detection
-โ โโโ recovery/ # Recovery operations
-โ โ โโโ hardware-recovery.sh # Hardware recovery
-โ โ โโโ reboot-to-metal.sh # Return to normal boot
-โ โ โโโ nuclear-wipe.sh # Nuclear system wipe
-โ โโโ uefi-tools/ # UEFI operations
-โ โ โโโ uuefi-*.sh # UUEFI operations
-โ โ โโโ uefi_variable_analyzer.py # UEFI variable analysis
-โ โโโ usb-tools/ # USB media creation
-โ โโโ qemu/ # QEMU runners
-โ โโโ maintenance/ # Project maintenance
-โ โโโ lint.sh # Code linting
-โ โโโ format.sh # Code formatting
-โ
-โโโ ๐ utils/ # Python utilities
-โ โโโ pgmodsign.py # Kernel module signing (canonical location)
-โ โโโ cert_inventory.py # Certificate management
-โ โโโ test_efi_parser.py # EFI parser tests
-โ โโโ test_integration.py # Integration tests
-โ
-โโโ ๐ฆ out/ # Build artifacts and test results
-โ โโโ staging/ # Compiled production binaries
-โ โโโ staging/ # Compiled production binaries
-โ โโโ esp/ # ESP images and packaging
-โ โโโ artifacts/ # Complete artifact packages with docs
-โ โโโ qemu/ # QEMU test logs and reports
-โ โโโ keys/ # Generated SecureBoot keys
-โ
-โโโ ๐ keys/ # Secure Boot keys (PK, KEK, db, MOK) - legacy location
-โโโ ๐ docs/ # Comprehensive documentation
-โโโ ๐งช tests/ # Test suites
-โโโ ๐ญ examples_and_samples/ # Demonstration content (473MB)
-โ โโโ demo/ # Demo materials (291MB)
-โ โโโ official_bios_backup/ # BIOS backups (180MB)
-โโโ ๐ก ideas/ # Future features and research
-โโโ ๐ web/ # Web interfaces (hardware database server)
-โโโ ๐ resources/ # Additional resources (KVM, P4X OS ideas, firmware samples)
-```
-
-### Key Differences from Before
-
-**Reduced Clutter:**
-- โ Removed 9 wrapper scripts from root (use `./pf.py ` instead)
-- โ Removed duplicate `pgmodsign.py` from root (use `utils/pgmodsign.py`)
-- โ
All tasks now accessible via unified `./pf.py list`
-- โ
Clear task organization across 4 `.pf` files
-
-**Primary Interface:**
-- Use `./pf.py ` for all operations
-- Use `bash scripts/