Skip to content

Conversation

@Zacgoose
Copy link
Contributor

@Zacgoose Zacgoose commented Dec 18, 2025

This pull request introduces significant improvements to the build pipeline and optimizes how function metadata and permissions are loaded and used within the PowerShell modules. The main focus is on leveraging a pre-built metadata cache for function permissions and descriptions, which enhances performance and maintainability. Additionally, the CI workflow is updated to automate the build and caching of this metadata, and detailed timing/debug information is added for access checks.

The most important changes are:

CI/CD Pipeline Enhancements:

  • The .github/workflows/dev_api.yml workflow now builds and caches PowerShell modules, generates permission and function metadata caches, and replaces source modules with their built versions as part of the CI process. This ensures that up-to-date metadata is always available and modules are consistently built.

Performance and Metadata Loading Improvements:

  • Test-CIPPAccess.ps1 and Get-CIPPHttpFunctions.ps1 are updated to load function permissions and metadata from the new Config/function-metadata.json cache instead of querying each function individually. This reduces runtime overhead and improves reliability. [1] [2]

Debugging and Timing Instrumentation:

  • Detailed timing information is now captured and output as debug logs during access checks in Test-CIPPAccess.ps1, making it easier to diagnose performance bottlenecks and understand the flow of permission checks. [1] [2] [3]

Fallbacks and Robustness:

  • If the metadata cache is missing or a function is not found in the cache, the code gracefully falls back to using Get-Help to retrieve function information, ensuring continued reliability. [1] [2]

@Zacgoose Zacgoose marked this pull request as draft December 18, 2025 17:21
@Zacgoose Zacgoose changed the title Feeling Brave? [WIP] Feeling Brave? Dec 18, 2025
@Zacgoose Zacgoose force-pushed the module-loading branch 2 times, most recently from b7ad029 to 539f061 Compare December 20, 2025 04:31
@Zacgoose Zacgoose changed the title [WIP] Feeling Brave? Feeling Brave? Dec 20, 2025
@Zacgoose Zacgoose marked this pull request as ready for review December 20, 2025 05:10
@Zacgoose
Copy link
Contributor Author

Zacgoose commented Jan 2, 2026

I have had some new thoughts on this one, I will tweak and see how it goes

@Zacgoose Zacgoose marked this pull request as draft January 2, 2026 02:04
@Zacgoose
Copy link
Contributor Author

Re-worked this a bunch as to not play with the current file structure while also ensuring that the tests folder is excluded from the built module but instead just copied to the same location for existing functions to continue working

@Zacgoose Zacgoose marked this pull request as ready for review January 25, 2026 14:53
@Zacgoose Zacgoose marked this pull request as draft January 25, 2026 15:17
@Zacgoose
Copy link
Contributor Author

Just need to go over the description section for listing the api endpoints for RBAC stuff and then it’ll be good to go.

@Zacgoose Zacgoose marked this pull request as ready for review January 26, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant