-
Notifications
You must be signed in to change notification settings - Fork 34
Add typed RuntimesConfig and PermissionsConfig to FrontmatterConfig #8403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add RuntimesConfig struct for typed runtime configurations (node, python, go, uv, bun, deno) - Add PermissionsConfig struct for typed permissions (shorthand and detailed scopes) - Add RuntimesTyped and PermissionsTyped fields to FrontmatterConfig - Update ParseFrontmatterConfig to populate typed fields - Update ToMap() to prefer typed fields over legacy map fields - Add helper functions: parseRuntimesConfig, parsePermissionsConfig, runtimesConfigToMap, permissionsConfigToMap - Add comprehensive tests for new typed fields - Maintain backward compatibility with existing map[string]any fields - All tests pass (20.492s) Co-authored-by: mnkiefer <[email protected]>
- Add section on Frontmatter Configuration Types - Document RuntimesTyped and PermissionsTyped fields - Explain legacy map fields and backward compatibility - Provide examples of using typed fields vs legacy fields - Note which fields remain as map[string]any and why Co-authored-by: mnkiefer <[email protected]>
Copilot
AI
changed the title
[WIP] Update FrontmatterConfig to typed alternatives
Add typed RuntimesConfig and PermissionsConfig to FrontmatterConfig
Jan 1, 2026
Contributor
|
@copilot lint go |
- Remove unnecessary nil checks before len() (staticcheck S1009) - Fix formatting with gofmt - All linting issues resolved (0 issues) - All tests still pass Co-authored-by: pelikhan <[email protected]>
Contributor
Author
Contributor
|
@copilot merge main, recompile, |
…terconfig-fields Co-authored-by: pelikhan <[email protected]>
Contributor
Author
Completed all requested actions in commit 81e8e8b:
No changes were needed after recompilation - all workflows are already up to date. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Completed: Type remaining FrontmatterConfig map[string]any fields
Successfully completed migration of
RuntimesandPermissionsfields frommap[string]anyto strongly-typed alternatives.What Was Changed
New Types Added:
RuntimeConfig- Single runtime configuration with version fieldRuntimesConfig- Typed config for all runtime environmentsNode,Python,Go,UV,Bun,Deno(all with version)PermissionsConfig- Typed config for GitHub Actions permissionsread-all,write-all,nonecontents,issues,pull-requests, etc.Fields Added to FrontmatterConfig:
RuntimesTyped *RuntimesConfig- New typed runtime configurationPermissionsTyped *PermissionsConfig- New typed permissions configurationRuntimes map[string]any- Deprecated but still supportedPermissions map[string]any- Deprecated but still supportedImplementation:
parseRuntimesConfig()- Converts map to typed configparsePermissionsConfig()- Converts map to typed configruntimesConfigToMap()- Converts typed config back to mappermissionsConfigToMap()- Converts typed config back to mapParseFrontmatterConfig()- Updated to populate both typed and legacy fieldsToMap()- Updated to prefer typed fields when converting backTesting:
Documentation:
Linting:
Merged main branch:
What Was NOT Changed
Deliberately left as
map[string]any(with rationale):ToolsBackward Compatibility
✅ 100% backward compatible:
ToMap()prefers typed fields for round-trip conversionBenefits
Type Safety:
Developer Experience:
Example Usage:
Validation
Ready for Review
This PR completes the typed configuration migration started with
ToolsConfigand continues the pattern of gradually replacingmap[string]anywith strongly-typed alternatives where appropriate.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.