Skip to content

Conversation

@ChrisMcD1
Copy link
Contributor

  • PR Description

This is a spinoff from discussion in #4318, and the solution works quite well.
The decoding now happens in 2 steps so that in theory if there is a fully invalid YAML document in some way, we don't even attempt the migration.

This PR ended up being pretty simple, and worked smoothly!

  • Please check if the PR fulfills these requirements
  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

}

content, err = migrateUserConfig(path, content)
existingCustomCommands := base.CustomCommands
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line needs to be before we make any potential modifications to base , so I have just moved it fully before the parsing.

This means that we can make the migration step as expensive as
necessary, since we will no longer run it on every app startup.
@ChrisMcD1 ChrisMcD1 force-pushed the check-configuration-prior-to-migration branch from 508d2fd to 7154cda Compare February 27, 2025 04:27
@ChrisMcD1
Copy link
Contributor Author

Closing for reasons stated in #4318 (comment)

@ChrisMcD1 ChrisMcD1 closed this Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant