Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: refactor dynamic parameters into dedicated package#18420

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Emyrk wants to merge15 commits intomain
base:main
Choose a base branch
Loading
fromstevenmasley/dynamic_param_pkg

Conversation

Emyrk
Copy link
Member

@EmyrkEmyrk commentedJun 17, 2025
edited
Loading

Refactor dynamic parameters into dedicated package

This PR extracts dynamic parameter rendering logic from coderd/parameters.go into a new coderd/dynamicparameters package. Partly for organization and maintainability, but primarily to be reused inwsbuilder to be leveraged as validation.

Key changes:

  • Created new dynamicparameters package to handle dynamic parameterpreview
  • Added support for both static and dynamic parameter rendering through unified interface
    • Older versions do not have the db state required for dynamic params. So it loads static params, and serves them through the same interface.
  • Added test utilities for testing dynamic parameters
    • Added more comprehensive tests for dynamic params.

The refactoring maintains backward compatibility while creating a cleaner separation of concerns for parameter handling logic. The next step is to use this logic in wsbuilder for validation purposes.

@EmyrkEmyrk changed the titleStevenmasley/dynamic param pkgchore: refactor dynamic parameters into dedicated packageJun 18, 2025
@EmyrkEmyrk marked this pull request as ready for reviewJune 18, 2025 18:42
@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_param_pkg branch from37bfb5c to758cd26CompareJune 18, 2025 19:09
@EmyrkEmyrk requested a review fromSasSwartJune 18, 2025 19:20

// TestDynamicParameterTemplate uses a template with some dynamic elements, and
// tests the parameters, values, etc are all as expected.
func TestDynamicParameterTemplate(t *testing.T) {
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This test is actually kinda dope. I like the resulting syntax

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@SasSwartSasSwartAwaiting requested review from SasSwart

At least 1 approving review is required to merge this pull request.

Assignees

@EmyrkEmyrk

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp