Skip to content

fix: allow fixing stale parameters when the active version is required - #30660

Merged
aslilac merged 4 commits into
mainfrom
lilac/fix-stale-parameter-update
Oct 13, 2026
Merged

aslilac merged 4 commits into
mainfrom
lilac/fix-stale-parameter-update

Conversation

@aslilac

@aslilac aslilac commented Oct 13, 2026

Copy link
Copy Markdown
Member

Fixes CLIENT-697.

When a template requires the active version, users without permission to change versions get sent to the parameters page to fix a parameter value the new version no longer accepts, but the form was fully disabled. The form now stays editable when it targets the active version, since submitting it is the update the template requires. The build error dialog also now links these users to the active version's parameters instead of the old version's.

Decisions
  • Frontend only. The backend keeps rejecting stale values rather than falling back to defaults; silently switching a value like a region can destroy data (see review on fix: remove stale coder_parameter selectable options from workflow display #29575).
  • Opening the parameters page without ?templateVersionId=<active version> is still read-only for these users, and immutable parameters with errors still block the update.

Generated by Coder Agents.

@linear-code

linear-code Bot commented Oct 13, 2026

Copy link
Copy Markdown

CLIENT-697

workspace.template_require_active_version &&
!canChangeVersions;
!canChangeVersions &&
templateVersionId !== workspace.template_active_version_id;

@untra untra Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

okay so AI recommended this as well, but then is it too wide of a cut?
with this it should not be disabled if the workspace template version does not match the template version.

https://github.com/coder/coder/pull/30660/changes#diff-f7160cacfd14d3c29d467648092ca6a5d386c917c9cdaae69ca20891a3da7bb3L282-L294

the presence of errors will still correctly disable the update button 👍

@aslilac aslilac Oct 13, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

imagine it like this:

// Disable the form if...
const disabled =
	// ...the workspace is outdated
	workspace.outdated &&
	// ...and the template requires auto-updates
	workspace.template_require_active_version &&
	// ...and the user cannot choose arbitrary versions anyway (ie. admin)
	!canChangeVersions &&
	// ...and they are attempting to use a template version which is *NOT* the
	// latest version, as required by auto-updates.
	templateVersionId !== workspace.template_active_version_id;

without this new part of the condition, we previously had...

// Disable the form if...
const disabled =
	// ...the workspace is outdated
	workspace.outdated &&
	// ...and the template requires auto-updates
	workspace.template_require_active_version &&
	// ...and the user cannot choose arbitrary versions anyway (ie. admin)
	!canChangeVersions;

...which would mean that a user with an outdated workspace with auto-updates enabled would be entirely unable to use this page unless they're an admin. this change makes it so that they're not locked out as long as we got sent to this page to update the workspace to the latest version.

@aslilac
aslilac merged commit 893461a into main Oct 13, 2026
58 of 59 checks passed
@aslilac
aslilac deleted the lilac/fix-stale-parameter-update branch October 13, 2026 23:25
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants