Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): new updater with stable and nightly channels #590

Merged
merged 1 commit into from Jun 6, 2022
Merged

Conversation

mehalter
Copy link
Member

@mehalter mehalter commented Jun 3, 2022

This PR adds a fully fledged updater that will handle stable vs. nightly updates.

  • If you follow stable then AstroNvim will only update to tagged versions and will also use provided Packer snapshots to automatically manage the versions of the core provided plugins. This will guarantee that while on the stable channel these plugins don't provide breaking updates that break the core AstroNvim functionality.
  • If you follow nightly this will update to the latest commits on the specified branch

This will have a new configuration section in the user/init.lua file that looks something like the following:

return {
  updater = {
    remote = "origin", -- remote to use
    channel = "nightly", -- "stable" or "nightly"
    version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY)
    branch = "main", -- branch name (NIGHTLY ONLY)
    commit = nil, -- commit hash (NIGHTLY ONLY)
    pin_plugins = true, -- true, false, or a string for a specific AstroNvim snapshot to use (true will only track the current version if channel is "stable")
    skip_prompts = false, -- skip prompts about breaking changes
    show_changelog = true, -- show the changelog after performing an update
    remotes = { -- easily add new remotes to track
      ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url
      ["remote2"] = "github_user/repo" -- GitHub user/repo shortcut,
      ["remote3"] = "github_user", -- GitHub user assume AstroNvim fork
    },
  },
}

This will allow users to also pin to a specific stable version and on nightly pin to a specific branch and/or commit. We are also planning on providing automatic checking if there are breaking changes and prompt the user if they want to continue and also have the option to print the changelog after an update is successfully performed.

TODO

  • Calculate update path for both stable or nightly paths with possible specified version/branch/commit
  • Check for breaking changes and prompt user if they want to abort
  • Check for conflicting user modifications to the base installation and prompt if they want to abort before we reset
  • Perform update
  • Use checkout when user specifies commit on nightly
  • Load Packer snapshot if on stable
  • Display commit log and prompt to restart
  • Add custom remotes + remote specification to make testing PRs or forks easier
  • Make everything prettier with the vim.api.nvim_echo API

@mehalter mehalter added the enhancement New feature or request label Jun 3, 2022
@mehalter mehalter requested a review from kabinspace June 3, 2022 17:37
@mehalter mehalter self-assigned this Jun 3, 2022
@mehalter mehalter removed the request for review from kabinspace June 3, 2022 17:37
@mehalter mehalter force-pushed the updater branch 7 times, most recently from 9346436 to 95aaf8d Compare June 3, 2022 18:39
@mehalter mehalter force-pushed the updater branch 18 times, most recently from 8a15cc8 to c65a361 Compare June 6, 2022 13:06
@mehalter mehalter marked this pull request as ready for review June 6, 2022 13:08
@mehalter mehalter requested a review from kabinspace June 6, 2022 13:08
@mehalter mehalter force-pushed the updater branch 5 times, most recently from 759bb6f to 8e31e2a Compare June 6, 2022 13:44
@mehalter mehalter force-pushed the updater branch 7 times, most recently from 86f5b4c to 184a141 Compare June 6, 2022 15:53
Signed-off-by: Micah Halter <micah@balena.io>
@mehalter mehalter merged commit b5267b1 into main Jun 6, 2022
@mehalter mehalter deleted the updater branch June 6, 2022 15:58
@mehalter mehalter mentioned this pull request Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants