diff --git a/R/auto.R b/R/auto.R index 15f08fb71..2e4f52b8e 100644 --- a/R/auto.R +++ b/R/auto.R @@ -18,8 +18,8 @@ #' @param which Component of the version number to update. Supported #' values are #' * `"next"` (`"major"` if the current version is `x.99.99.9yz`, -#' `"minor"` if the current version is `x.y.99.za`, -#' `"patch"` otherwise), +#' `"minor"` if the current version is `x.y.99.za`, +#' `"patch"` otherwise), #' * `"patch"` #' * `"minor"`, #' * `"major"`. @@ -472,31 +472,14 @@ post_release <- function() { post_release_impl <- function() { check_only_modified(c(".Rbuildignore")) - - check_post_release() + # Need PAT for creating GitHub release + check_gh_pat("repo") # Begin extension points # End extension points create_github_release() - merge_main_into_post_release() - - # FIXME: Check if PR open, if yes merge PR instead - release_branch <- get_branch_name() - switch_branch(get_main_branch()) - pull_head() - merge_branch(release_branch) - - bump_version_impl( - read_fledgling(), - "dev", - no_change_behavior = "bump", - edit = FALSE, - no_change_message = "- Resume development after CRAN release." - ) - push_head() - # Begin extension points # End extension points } diff --git a/tests/testthat/_snaps/auto.md b/tests/testthat/_snaps/auto.md index 012a81b72..d0aa72da6 100644 --- a/tests/testthat/_snaps/auto.md +++ b/tests/testthat/_snaps/auto.md @@ -187,31 +187,8 @@ Code post_release() Message - > Checking presence and scope of `GITHUB_PAT`. - > Creating GitHub release "v0.0.1". + > Creating GitHub release "v". > Omitting in test. - > Switching to branch main. - > Pulling main. - Resetting main to origin/main - > Merging release branch. - i If this fails, resolve the conflict manually and push. - > Digesting messages from 2 commits. - v Found 1 NEWS-worthy entry. - - -- Updating NEWS -- - - > Adding new entries to 'NEWS.md'. - - -- Updating Version -- - - v Package version bumped to 0.0.1.9000. - > Added header to 'NEWS.md'. - > Committing changes. - - -- Tagging Version -- - - > Creating tag v0.0.1.9000 with tag message derived from 'NEWS.md'. - > Pushing main. # full cycle pre-minor @@ -288,31 +265,8 @@ Code post_release() Message - > Checking presence and scope of `GITHUB_PAT`. - > Creating GitHub release "v0.1.0". + > Creating GitHub release "v". > Omitting in test. - > Switching to branch main. - > Pulling main. - Resetting main to origin/main - > Merging release branch. - i If this fails, resolve the conflict manually and push. - > Digesting messages from 2 commits. - v Found 1 NEWS-worthy entry. - - -- Updating NEWS -- - - > Adding new entries to 'NEWS.md'. - - -- Updating Version -- - - v Package version bumped to 0.1.0.9000. - > Added header to 'NEWS.md'. - > Committing changes. - - -- Tagging Version -- - - > Creating tag v0.1.0.9000 with tag message derived from 'NEWS.md'. - > Pushing main. # release abandon @@ -394,10 +348,8 @@ Code post_release() - Condition - Error in `check_post_release()`: - ! The main branch contains newsworthy commits. - i Run `fledge::bump_version()` on the main branch. + Message + > Omitting in test. --- @@ -405,10 +357,6 @@ post_release() Message > Omitting in test. - Condition - Error in `merge_main_into_post_release()`: - ! Merging the main branch into the release branch failed. - i Resolve the conflict manually and push. # full cycle, add more to main NO PUSH @@ -436,7 +384,6 @@ Code post_release() - Condition - Error in `check_post_release()`: - ! Local main branch ahead by 1 commit. + Message + > Omitting in test. diff --git a/tests/testthat/test-auto.R b/tests/testthat/test-auto.R index 542be43d9..5add1b80b 100644 --- a/tests/testthat/test-auto.R +++ b/tests/testthat/test-auto.R @@ -167,14 +167,16 @@ test_that("full cycle", { ) expect_equal(nrow(gert::git_status()), 0) + gert::git_branch_checkout("main") + expect_equal(nrow(gert::git_status()), 0) + ## post release ---- withr::local_envvar("FLEDGE_TEST_NOGH" = "no-github-no-mocking-needed-yay") expect_snapshot(post_release()) expect_equal(nrow(gert::git_status()), 0) - expect_equal(gert::git_branch(), "main") expect_setequal( gert::git_tag_list()[["name"]], - c("v0.0.0.9001", "v0.0.1", "v0.0.1.9000") + c("v0.0.0.9001", "v0.0.1") ) }) @@ -232,14 +234,16 @@ test_that("full cycle pre-minor", { ) expect_equal(nrow(gert::git_status()), 0) + gert::git_branch_checkout("main") + expect_equal(nrow(gert::git_status()), 0) + ## post release ---- withr::local_envvar("FLEDGE_TEST_NOGH" = "no-github-no-mocking-needed-yay") expect_snapshot(post_release()) expect_equal(nrow(gert::git_status()), 0) - expect_equal(gert::git_branch(), "main") expect_setequal( gert::git_tag_list()[["name"]], - c("v0.0.99.9000", "v0.1.0", "v0.1.0.9000") + c("v0.0.99.9000", "v0.1.0") ) }) @@ -334,14 +338,14 @@ test_that("full cycle, add more to main", { ## post release ---- withr::local_envvar("FLEDGE_TEST_NOGH" = "no-github-no-mocking-needed-yay") - expect_snapshot(error = TRUE, post_release()) + expect_snapshot(post_release()) gert::git_branch_checkout("main") shut_up_fledge(fledge::bump_version()) gert::git_push() gert::git_branch_checkout("cran-0.0.1") - expect_snapshot(error = TRUE, post_release()) + expect_snapshot(post_release()) }) test_that("full cycle, add more to main NO PUSH", { @@ -398,5 +402,5 @@ test_that("full cycle, add more to main NO PUSH", { ## post release ---- withr::local_envvar("FLEDGE_TEST_NOGH" = "no-github-no-mocking-needed-yay") - expect_snapshot(error = TRUE, post_release()) + expect_snapshot(post_release()) })