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

feat: make dynamic parameters opt-in by default for new templates#19006

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

Merged
Emyrk merged 35 commits intomainfromjaaydenh/dynamic-params-default-optin
Jul 29, 2025

Conversation

jaaydenh
Copy link
Contributor

@jaaydenhjaaydenh commentedJul 22, 2025
edited by Emyrk
Loading

resolves#18975

Follow ups

#19065
#19064

@jaaydenhjaaydenh self-assigned thisJul 22, 2025
@jaaydenh
Copy link
ContributorAuthor

@CodeRabbit review

coderabbitai[bot] reacted with eyes emoji

@coderabbitaicoderabbitai
Copy link

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitaicoderabbitai
Copy link

📝 Walkthrough

Walkthrough

The changes update the default value of theUseClassicParameterFlow flag for templates fromtrue tofalse across backend logic, API handlers, and test data. Frontend updates introduce a new deprecation warning component for the classic parameter flow, integrate permission checks for updating templates, and propagate these permissions through relevant components. Several documentation links are updated, and associated tests and stories are adjusted accordingly.

Changes

File(s)Change Summary
coderd/database/dbgen/dbgen.go, coderd/templates.goChanged default value ofUseClassicParameterFlow fromtrue tofalse in backend template logic and API handler.
coderd/insights_test.go, coderd/templates_test.goUpdated tests to expect or setUseClassicParameterFlow: true only when required; default expectation is nowfalse.
site/src/testHelpers/entities.tsChanged mock data:use_classic_parameter_flow andtemplate_use_classic_parameter_flow fromtrue tofalse.
site/src/modules/workspaces/ClassicParameterFlowDeprecationWarning/ClassicParameterFlowDeprecationWarning.tsxAdded new React component to display a deprecation warning for classic parameter flow.
site/src/modules/workspaces/ClassicParameterFlowDeprecationWarning/ClassicParameterFlowDeprecationWarning.test.tsxAdded tests for the new deprecation warning component.
site/src/pages/CreateWorkspacePage/CreateWorkspacePage.tsxAdded React Query hook to fetch template update permissions; passed permissions to child component.
site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsxAdded new proptemplatePermissions and rendered the deprecation warning component.
site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsxAddedtemplatePermissions prop to Storybook default args.
site/src/pages/CreateWorkspacePage/CreateWorkspacePageViewExperimental.tsx, site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersPageExperimental.tsx, site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersPageViewExperimental.tsxUpdated documentation links to new dynamic parameters path.
site/src/pages/TemplateSettingsPage/TemplateGeneralSettingsPage/TemplateSettingsForm.tsxUpdated label and helper text for dynamic parameters checkbox; updated documentation link.
site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersPage.tsxAdded React Query hook for template update permissions; passed permissions through component hierarchy.
site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersForm.tsxAddedtemplatePermissions prop and rendered deprecation warning component.

Sequence Diagram(s)

sequenceDiagram    participant User    participant CreateWorkspacePage    participant TemplatePermissionsQuery    participant CreateWorkspacePageView    participant ClassicParameterFlowDeprecationWarning    User->>CreateWorkspacePage: Load page    CreateWorkspacePage->>TemplatePermissionsQuery: Fetch canUpdateTemplate    TemplatePermissionsQuery-->>CreateWorkspacePage: Return permission data    CreateWorkspacePage->>CreateWorkspacePageView: Render with templatePermissions    CreateWorkspacePageView->>ClassicParameterFlowDeprecationWarning: Render warning if enabled and canUpdateTemplate
Loading
sequenceDiagram    participant User    participant WorkspaceParametersPage    participant TemplatePermissionsQuery    participant WorkspaceParametersPageView    participant WorkspaceParametersForm    participant ClassicParameterFlowDeprecationWarning    User->>WorkspaceParametersPage: Load page    WorkspaceParametersPage->>TemplatePermissionsQuery: Fetch canUpdateTemplate    TemplatePermissionsQuery-->>WorkspaceParametersPage: Return permission data    WorkspaceParametersPage->>WorkspaceParametersPageView: Render with templatePermissions    WorkspaceParametersPageView->>WorkspaceParametersForm: Pass templatePermissions    WorkspaceParametersForm->>ClassicParameterFlowDeprecationWarning: Render warning if enabled and canUpdateTemplate
Loading

Estimated code review effort

3 (~45 minutes)

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat withCodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag@coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag@coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on oursupport page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings togenerate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add@coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add@coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add@coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit ourDocumentation for detailed information on how to use CodeRabbit.
  • Join ourDiscord Community to get help, request features, and share feedback.
  • Follow us onX/Twitter for updates and announcements.

Copy link

@coderabbitaicoderabbitaibot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
site/src/pages/CreateWorkspacePage/CreateWorkspacePageViewExperimental.tsx (1)

545-548:Same duplication as above

Refer to the previous comment – same literal, same recommendation.

🧹 Nitpick comments (6)
site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersPageViewExperimental.tsx (1)

213-214:Centralise docs URL to avoid future drift

The same/admin/templates/extending-templates/dynamic-parameters slug is now hard-coded here and in several other files. Expose it via a shared constant (e.g.DOCS_DYNAMIC_PARAMETERS) or extend thedocs() helper to accept a well-named key.
This prevents silent divergence if the path changes again.

site/src/pages/CreateWorkspacePage/CreateWorkspacePageViewExperimental.tsx (1)

396-399:Duplicate literal docs path – extract to constant

Two identical string literals were introduced in this component (see also the Parameters section below). Moving the slug to a shared constant keeps the UI and docs in sync and avoids scattered hot-fixes next time the URL changes.

coderd/insights_test.go (1)

668-672:Consider adding a clarifying comment for consistency.

For better maintainability and consistency with the similar change at line 1564, consider adding a comment explaining whyUseClassicParameterFlow: true is explicitly set here.

 createdTemplate := dbgen.Template(t, db, database.Template{ ID:                      template.id, ActiveVersionID:         version.ID, OrganizationID:          firstUser.OrganizationID, CreatedBy:               firstUser.UserID,-UseClassicParameterFlow: true,+UseClassicParameterFlow: true, // Required for testing legacy parameter flow behavior GroupACL: database.TemplateACL{
site/src/pages/TemplateSettingsPage/TemplateGeneralSettingsPage/TemplateSettingsForm.tsx (1)

1-1:Note: MUI components present - consider migration.

This file uses deprecated MUI components (Checkbox, FormControlLabel, TextField, etc.). While not introduced by this PR, consider migrating these to newer component alternatives in future work.

site/src/testHelpers/entities.ts (1)

829-829:Avoid hard-coded duplicate default – reuse a shared constant

The literalfalse is now duplicated across mocks. Extracting aDEFAULT_USE_CLASSIC_PARAMETER_FLOW constant (or deriving the value from the template when constructing the workspace) will keep test helpers in sync the next time this default changes.

-use_classic_parameter_flow: false,+use_classic_parameter_flow: DEFAULT_USE_CLASSIC_PARAMETER_FLOW,
site/src/modules/workspaces/ClassicParameterFlowDeprecationWarning/ClassicParameterFlowDeprecationWarning.tsx (1)

28-30:Improve the deprecation message clarity.

The phrase "dynamic improved functionality" is awkward and unclear. Consider rephrasing for better user experience.

 This template is using the classic parameter flow, which will be{" "} <strong>deprecated</strong> in a future release. Please migrate to-dynamic improved functionality.+the improved dynamic parameter flow.
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and betweenf41275e anda62ba63.

📒 Files selected for processing (16)
  • coderd/database/dbgen/dbgen.go (1 hunks)
  • coderd/insights_test.go (2 hunks)
  • coderd/templates.go (1 hunks)
  • coderd/templates_test.go (2 hunks)
  • site/src/modules/workspaces/ClassicParameterFlowDeprecationWarning/ClassicParameterFlowDeprecationWarning.test.tsx (1 hunks)
  • site/src/modules/workspaces/ClassicParameterFlowDeprecationWarning/ClassicParameterFlowDeprecationWarning.tsx (1 hunks)
  • site/src/pages/CreateWorkspacePage/CreateWorkspacePage.tsx (3 hunks)
  • site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx (1 hunks)
  • site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx (4 hunks)
  • site/src/pages/CreateWorkspacePage/CreateWorkspacePageViewExperimental.tsx (2 hunks)
  • site/src/pages/TemplateSettingsPage/TemplateGeneralSettingsPage/TemplateSettingsForm.tsx (1 hunks)
  • site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersForm.tsx (4 hunks)
  • site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersPage.tsx (5 hunks)
  • site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersPageExperimental.tsx (2 hunks)
  • site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersPageViewExperimental.tsx (1 hunks)
  • site/src/testHelpers/entities.ts (2 hunks)
🧠 Learnings (9)
site/src/pages/CreateWorkspacePage/CreateWorkspacePageViewExperimental.tsx (3)

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : MUI components are deprecated - migrate away from these when encountered

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Use functional updates (setX(prev ⇒ …)) whenever next state depends on previous state.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Leverage custom color tokens: content-primary, surface-secondary, etc.

site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersPageExperimental.tsx (2)

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : MUI components are deprecated - migrate away from these when encountered

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Use functional updates (setX(prev ⇒ …)) whenever next state depends on previous state.

site/src/modules/workspaces/ClassicParameterFlowDeprecationWarning/ClassicParameterFlowDeprecationWarning.test.tsx (4)

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : MUI components are deprecated - migrate away from these when encountered

Learnt from: CR
PR: coder/coder#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T14:32:43.035Z
Learning: Applies to site/src/**/*.test.{ts,tsx,js,jsx} : React components and pages are organized in thesite/src/ directory, with Jest used for testing.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Emotion CSS is deprecated. Use Tailwind CSS instead.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Components and custom Hooks must be pure and idempotent—same inputs → same output; move side-effects to event handlers or Effects.

site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx (9)

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : MUI components are deprecated - migrate away from these when encountered

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Emotion CSS is deprecated. Use Tailwind CSS instead.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Never mutate props, state, or values returned by Hooks. Always create new objects or use the setter from useState.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Use shadcn/ui components first - check site/src/components for existing implementations

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Components and custom Hooks must be pure and idempotent—same inputs → same output; move side-effects to event handlers or Effects.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Never pass Hooks around as values or mutate them dynamically. Keep Hook usage static and local to each component.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Don’t call Hooks (including useRef) inside loops, conditions, or map(). Extract a child component instead.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Use functional updates (setX(prev ⇒ …)) whenever next state depends on previous state.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Only call Hooks from React functions. Regular JS functions, classes, event handlers, useMemo, etc. are off-limits.

site/src/pages/CreateWorkspacePage/CreateWorkspacePage.tsx (1)

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Never mutate props, state, or values returned by Hooks. Always create new objects or use the setter from useState.

site/src/modules/workspaces/ClassicParameterFlowDeprecationWarning/ClassicParameterFlowDeprecationWarning.tsx (6)

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : MUI components are deprecated - migrate away from these when encountered

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Emotion CSS is deprecated. Use Tailwind CSS instead.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Components and custom Hooks must be pure and idempotent—same inputs → same output; move side-effects to event handlers or Effects.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Never mutate props, state, or values returned by Hooks. Always create new objects or use the setter from useState.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Replace Emotioncss prop with Tailwind classes

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Never pass Hooks around as values or mutate them dynamically. Keep Hook usage static and local to each component.

site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersForm.tsx (4)

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : MUI components are deprecated - migrate away from these when encountered

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Emotion CSS is deprecated. Use Tailwind CSS instead.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Components and custom Hooks must be pure and idempotent—same inputs → same output; move side-effects to event handlers or Effects.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Use shadcn/ui components first - check site/src/components for existing implementations

site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersPage.tsx (1)

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Never mutate props, state, or values returned by Hooks. Always create new objects or use the setter from useState.

coderd/templates_test.go (2)

Learnt from: CR
PR: coder/coder#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:32:56.474Z
Learning: Applies to **/*_test.go : Never use hardcoded names in concurrent Go tests

Learnt from: CR
PR: coder/coder#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T14:32:43.035Z
Learning: Applies to **/*_test.go : All tests must uset.Parallel() to run concurrently, which improves test suite performance and helps identify race conditions.

🧰 Additional context used
🧠 Learnings (9)
site/src/pages/CreateWorkspacePage/CreateWorkspacePageViewExperimental.tsx (3)

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : MUI components are deprecated - migrate away from these when encountered

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Use functional updates (setX(prev ⇒ …)) whenever next state depends on previous state.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Leverage custom color tokens: content-primary, surface-secondary, etc.

site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersPageExperimental.tsx (2)

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : MUI components are deprecated - migrate away from these when encountered

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Use functional updates (setX(prev ⇒ …)) whenever next state depends on previous state.

site/src/modules/workspaces/ClassicParameterFlowDeprecationWarning/ClassicParameterFlowDeprecationWarning.test.tsx (4)

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : MUI components are deprecated - migrate away from these when encountered

Learnt from: CR
PR: coder/coder#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T14:32:43.035Z
Learning: Applies to site/src/**/*.test.{ts,tsx,js,jsx} : React components and pages are organized in thesite/src/ directory, with Jest used for testing.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Emotion CSS is deprecated. Use Tailwind CSS instead.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Components and custom Hooks must be pure and idempotent—same inputs → same output; move side-effects to event handlers or Effects.

site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx (9)

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : MUI components are deprecated - migrate away from these when encountered

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Emotion CSS is deprecated. Use Tailwind CSS instead.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Never mutate props, state, or values returned by Hooks. Always create new objects or use the setter from useState.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Use shadcn/ui components first - check site/src/components for existing implementations

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Components and custom Hooks must be pure and idempotent—same inputs → same output; move side-effects to event handlers or Effects.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Never pass Hooks around as values or mutate them dynamically. Keep Hook usage static and local to each component.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Don’t call Hooks (including useRef) inside loops, conditions, or map(). Extract a child component instead.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Use functional updates (setX(prev ⇒ …)) whenever next state depends on previous state.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Only call Hooks from React functions. Regular JS functions, classes, event handlers, useMemo, etc. are off-limits.

site/src/pages/CreateWorkspacePage/CreateWorkspacePage.tsx (1)

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Never mutate props, state, or values returned by Hooks. Always create new objects or use the setter from useState.

site/src/modules/workspaces/ClassicParameterFlowDeprecationWarning/ClassicParameterFlowDeprecationWarning.tsx (6)

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : MUI components are deprecated - migrate away from these when encountered

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Emotion CSS is deprecated. Use Tailwind CSS instead.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Components and custom Hooks must be pure and idempotent—same inputs → same output; move side-effects to event handlers or Effects.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Never mutate props, state, or values returned by Hooks. Always create new objects or use the setter from useState.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Replace Emotioncss prop with Tailwind classes

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Never pass Hooks around as values or mutate them dynamically. Keep Hook usage static and local to each component.

site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersForm.tsx (4)

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : MUI components are deprecated - migrate away from these when encountered

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Emotion CSS is deprecated. Use Tailwind CSS instead.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Components and custom Hooks must be pure and idempotent—same inputs → same output; move side-effects to event handlers or Effects.

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.tsx : Use shadcn/ui components first - check site/src/components for existing implementations

site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersPage.tsx (1)

Learnt from: CR
PR: coder/coder#0
File: site/CLAUDE.md:0-0
Timestamp: 2025-07-21T14:33:50.919Z
Learning: Applies to site/src/**/*.{ts,tsx} : Never mutate props, state, or values returned by Hooks. Always create new objects or use the setter from useState.

coderd/templates_test.go (2)

Learnt from: CR
PR: coder/coder#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:32:56.474Z
Learning: Applies to **/*_test.go : Never use hardcoded names in concurrent Go tests

Learnt from: CR
PR: coder/coder#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T14:32:43.035Z
Learning: Applies to **/*_test.go : All tests must uset.Parallel() to run concurrently, which improves test suite performance and helps identify race conditions.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: test-e2e
  • GitHub Check: test-go-race-pg
  • GitHub Check: build-dylib
  • GitHub Check: test-go-pg-17
  • GitHub Check: test-go-pg (windows-2022)
  • GitHub Check: test-go-pg (macos-latest)
  • GitHub Check: test-go-pg (ubuntu-latest)
  • GitHub Check: chromatic
  • GitHub Check: gen
🔇 Additional comments (33)
coderd/database/dbgen/dbgen.go (1)

150-151:Auditdbgen.Template calls for missingUseClassicParameterFlow
The previous script misparsed file paths (it included the code line in the filename). Please use the following to correctly extractfile:line and then scan the next ~20 lines forUseClassicParameterFlow:

#!/usr/bin/env bash# Find dbgen.Template invocations without UseClassicParameterFlow configured.rg --type go -n'dbgen\.Template'|while IFS=":"read -r file line _;doif! sed -n"${line},$((line+20))p""$file"| grep -q'UseClassicParameterFlow';thenecho"$file:$line"fidone| head

Rerun this and audit any test that now depends on the flipped default.

site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx (1)

33-34:Storybook arg looks good

AddingtemplatePermissions keeps the stories compiling with the new prop signature – no issues spotted.

coderd/insights_test.go (1)

1560-1564:Good practice with explanatory comment.

Excellent approach to explicitly setUseClassicParameterFlow: true with a clear comment explaining why this override is necessary for the test's parameter usage tracking functionality. This ensures the test remains functional despite the default value change.

coderd/templates_test.go (2)

80-80:LGTM: Test assertion correctly updated for new default.

The test assertion has been properly updated to expectfalse forUseClassicParameterFlow, which aligns with the PR objective of making dynamic parameters the default for new templates.


1554-1554:LGTM: Default expectation correctly updated.

The assertion correctly expectsfalse as the default value forUseClassicParameterFlow, confirming that dynamic parameters are now enabled by default for new templates. The comment clearly documents this behavior change.

site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersPageExperimental.tsx (2)

229-229:LGTM: Documentation link updated to canonical path.

The documentation link has been cleanly updated from a fragment-based URL to a dedicated dynamic parameters path, improving maintainability and user experience.


264-266:LGTM: Consistent documentation link update.

The EmptyState documentation link has been updated to match the same canonical dynamic parameters path, maintaining consistency across the component.

site/src/pages/TemplateSettingsPage/TemplateGeneralSettingsPage/TemplateSettingsForm.tsx (3)

248-248:LGTM: UI label appropriately updated to reflect recommended option.

The addition of "(recommended)" to the dynamic parameters label clearly communicates the preferred choice to users, aligning with the PR's objective of making dynamic parameters the default.


252-256:LGTM: Helper text updated to reflect new default behavior.

The updated helper text effectively communicates:

  • Dynamic parameters as the default for new templates
  • Additional capabilities (form types, conditional parameters)
  • Future deprecation of classic flow

This provides clear guidance to users about the direction of the platform.


261-261:LGTM: Documentation link updated to canonical path.

The documentation link has been updated to the cleaner, dedicated dynamic parameters path, improving consistency across the application.

site/src/testHelpers/entities.ts (1)

1392-1392:LGTM – flag value updated to reflect new default
The workspace mock correctly mirrors the template’s default (false). ✅

site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx (4)

30-30:LGTM: Clean import of the new deprecation warning component.

The import is properly structured and follows the project's naming conventions.


70-70:LGTM: Proper TypeScript interface extension.

The newtemplatePermissions prop is correctly typed with the expected structure.


96-96:LGTM: Consistent prop destructuring.

The new prop is properly destructured in the component signature.


251-255:LGTM: Proper component integration with correct props.

The deprecation warning component is well-positioned between the header and main form, and receives the appropriate props from the template and permissions data.

site/src/pages/CreateWorkspacePage/CreateWorkspacePage.tsx (4)

72-85:LGTM: Well-structured authorization query for template permissions.

The query follows the established pattern for permission checks and correctly uses the template ID as the resource identifier. The enablement condition ensures the query only runs when template data is available.


107-107:LGTM: Proper integration of new query into loading state.

The loading state correctly includes the new permissions query alongside existing queries.


110-113:LGTM: Consistent error handling pattern.

The error handling follows the existing pattern of using nullish coalescing to check multiple query errors.


229-231:LGTM: Type-safe prop passing with proper assertion.

The template permissions data is correctly passed to the view component with appropriate type assertion, following the same pattern as other permission data.

site/src/modules/workspaces/ClassicParameterFlowDeprecationWarning/ClassicParameterFlowDeprecationWarning.test.tsx (3)

4-7:LGTM: Appropriate mocking of navigation dependencies.

The navigation modules are properly mocked with consistent return values for testing.


17-27:Good test coverage for enabled state.

The test properly verifies that the warning text and action link are rendered when the component is enabled.


29-38:LGTM: Proper test for disabled state.

The test correctly verifies that nothing is rendered when the component is disabled.

site/src/modules/workspaces/ClassicParameterFlowDeprecationWarning/ClassicParameterFlowDeprecationWarning.tsx (4)

6-10:LGTM: Well-defined TypeScript interface.

The props interface is clear and uses appropriate types for the component's requirements.


15-19:LGTM: Proper conditional rendering pattern.

The early return for disabled state is clean and follows React best practices.


21-23:LGTM: Clean link generation logic.

The template settings URL is constructed properly using the navigation utilities.


26-35:LGTM: Proper use of modern styling and component structure.

The component correctly uses Tailwind CSS classes (following the learning about avoiding Emotion) and maintains a clean Alert + Link structure.

site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersForm.tsx (4)

17-17:LGTM: Consistent import of deprecation warning component.

The import follows the same pattern used in other files.


37-37:LGTM: Proper optional prop typing.

The templatePermissions prop is correctly typed as optional with undefined, allowing for graceful handling when permissions aren't available.


51-51:LGTM: Consistent prop destructuring.

The templatePermissions prop is properly added to the destructuring pattern.


87-91:LGTM: Well-positioned deprecation warning with proper fallback.

The warning component is appropriately placed after the workspace disabled alert and uses nullish coalescing to provide a safe fallback when templatePermissions is undefined.

Also applies to: 92-96

site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersPage.tsx (3)

54-67:LGTM! Well-structured permission query implementation.

The template permissions query follows the established pattern used for workspace permissions and correctly implements conditional enabling. The authorization check structure is appropriate for template update permissions.


69-71:LGTM! Consistent type casting pattern.

The type assertion follows the same pattern used for the existingpermissions variable and correctly handles the potential undefined state.


82-82:LGTM! Proper prop threading implementation.

ThetemplatePermissions prop is correctly added to the type definitions, component signatures, and passed through the component hierarchy without any mutations. This follows React best practices and maintains type safety throughout.

Also applies to: 117-117, 130-130, 154-154

@jaaydenhjaaydenhforce-pushed thejaaydenh/dynamic-params-default-optin branch from6624768 to7144f4fCompareJuly 28, 2025 16:59
jaaydenhand others added20 commitsJuly 28, 2025 18:15
Emyrkand others added3 commitsJuly 28, 2025 16:00
The updateWorkspace tests were written for the classic parameter flow.With dynamic parameters now being the default, these tests need toexplicitly disable dynamic parameters via the template settings pageto continue working as expected.This fix:1. Adds a disableDynamicParameters helper function2. Modifies all updateWorkspace tests to disable dynamic parameters   after template creation3. Ensures tests use the classic parameter flow they were designed forFixes the failing e2e test 'update workspace with ephemeral parameter enabled'.
@blink-soblink-sobotforce-pushed thejaaydenh/dynamic-params-default-optin branch frome246925 to95f53fdCompareJuly 28, 2025 21:13
@EmyrkEmyrk merged commit1320b8d intomainJul 29, 2025
67 of 71 checks passed
@EmyrkEmyrk deleted the jaaydenh/dynamic-params-default-optin branchJuly 29, 2025 01:41
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJul 29, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@EmyrkEmyrkEmyrk approved these changes

+1 more reviewer

@coderabbitaicoderabbitai[bot]coderabbitai[bot] left review comments

Reviewers whose approvals may not affect merge requirements
Assignees

@jaaydenhjaaydenh

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Default to dynamic parameters
2 participants
@jaaydenh@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp