Skip to content

Lock and unlock branch as part of the release process #2145

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hadley
Copy link
Member

@hadley hadley commented Jul 28, 2025

This ensures that there's no way to accidentally forget that you're in the middle of the release process and make a change to the repo.

Part of #1946

@DavisVaughan it's been a long time since we discussed this, but does this make sense to you?

@jennybc mostly opening to start discussion; not planning to merge just yet.

hadley added 2 commits July 28, 2025 16:05
This ensures that there's no way to accidentally forget that you're in the middle of the release process and make a change to the repo.

Part of #1946
Copy link
Member

@DavisVaughan DavisVaughan left a comment

Choose a reason for hiding this comment

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

I think the positioning makes sense based on what I remember about this

Comment on lines +302 to +305
#' These functions lock and unlock a branch on GitHub so that it's not possible
#' for anyone to make any changes. This is used as part of the release process
#' to ensure that you don't accidentally merge any pull requests or push any
#' commits while you are waiting for CRAN to get back to you.
Copy link
Member

Choose a reason for hiding this comment

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

Anything about permissions required to perform this action?

#'
#' @export
#' @param branch The branch to lock/unlock. If not supplied, uses the
#' default branch with is usually "main" or "master".
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#' default branch with is usually "main" or "master".
#' default branch which is usually "main" or "master".

repo <- target_repo(cfg)
branch <- branch %||% git_default_branch_(cfg)

invisible(gh::gh(
Copy link
Member

Choose a reason for hiding this comment

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

What happens if you lock an already locked branch?

@@ -137,13 +138,15 @@ release_checklist <- function(version, on_cran, target_repo = NULL) {
"",
"Submit to CRAN:",
"",
todo("`usethis::gh_lock_branch()"),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
todo("`usethis::gh_lock_branch()"),
todo("`usethis::gh_lock_branch()`"),

todo("`usethis::use_version('{type}')`"),
todo("`devtools::submit_cran()`"),
todo("Approve email"),
"",
"Wait for CRAN...",
"",
todo("Accepted :tada:"),
todo("`usethis::gh_unlock_branch()"),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
todo("`usethis::gh_unlock_branch()"),
todo("`usethis::gh_unlock_branch()`"),

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.

2 participants