Closed BenSurgisonGDS closed 1 year ago
Update
@joelanman have you designed for the following scenarios?
hmrc-frontend
start using govuk-frontend@5.0.0
the first day it comes out, then a user clicks to install HMRC Frontend and their kit breaks. To try to fix this they uninstall HMRC Frontend, should govuk-frontend
be downgraded? If not their kit is still broken.1(a). If we do downgrade to solve point 1 - a user creates a new kit, they install HMRC Frontend which bumps the govuk-frontend
version, they build some pages and then realise they don't need HMRC Frontend. They uninstall HMRC frontend and their govuk-frontend
is downgraded breaking their pages.
(suggestion: Do we need to keep track of the historic state of plugins and offer an undo/revert option)
govuk-frontend
max version of 5.0.0
, then they try to install a plugin which specifies "min-version": "5.0.0"
. (technically this ticket is written with just minVersion
but I think that creates a strange paradigm that we should avoid)@BenSurgisonGDS Until we've got a clear approach for the above (and I'm sure there are other scenarios that need to be considered) could you focus on the upgrade working the same as install please?
So if a user upgrades to a new version which now specifies a dependent plugin they get the same behaviour as if they were installing that plugin for the first time. I think it might be worth separating into two tickets (one for upgrade, one for minVersion
and maxVersion
) but that depends on how the conversation goes with the wider team. For now I'd suggest just starting with the upgrade.
Having chatted with Natalie, if there's new UX to be designed as per her questions above, I'd prefer to push this back because we're redesigning all the plugin UI anyway, so keep this work as simple as possible
The functionality looks ready. I'm expecting to approve the PR when we've released the fixes for the two production bugs.
What
This is a part 2 of the required functionality in the ticket:
If a plugin has dependencies (defined in
pluginDependencies
in thegovuk-prototype-kit.config.json
the user should have the chance to either cancel the upgrade or continue the upgrade and install the dependency.Current behaviour vs expected behaviour
Context
govuk-frontend
(with a minimum version of `4.4.0)Setup for testing
npx govuk-prototype-kit create demo-kit_2242 && cd demo-kit_2242 && npm install @govuk-prototype-kit/common-templates@1.1.1 && echo '{"serviceName": "Service name goes here", "allowGovukFrontendUninstall": true}' > app/config.json && npm run dev
This starts a kit with an older version of Common Templates and with the ability to uninstall GOV.UK Frontend through the UI.
Install (currently working, should be maintained)
Here the user is warned that a GOV.UK Frontend will also be installed.
Update (not currently working, should be implemented)
Here the user should be warned that a GOV.UK Frontend will also be installed. If they proceed then both Common Templates and GOV.UK Frontend should be installed, if not nothing should be installed.
Design
Done when
Who needs to work on this
Who needs to review this