Exemplo n.º 1
0
    def check_pre_conditions_for_publish(self) -> None:
        if self.details.push_to_production:
            repo = Repo(release_constants.main_project_dir)
            assert_step(not repo.bare)

            assert_step((repo.active_branch.name == 'master'))

            GitUtilities.check_no_uncommitted_changes(repo)

            # From https://stackoverflow.com/questions/15849640/how-to-get-count-of-unpublished-commit-with-gitpython
            assert_step(len(
                list(repo.iter_commits('master@{u}..master'))) == 0, "there are un-pushed changes in ApprovalTests.cpp")

            run(["open", "https://github.com/approvals/ApprovalTests.cpp/commits/master"])
            check_step("the builds are passing")

            run(["open", "https://github.com/approvals/ApprovalTests.cpp/blob/master/build/relnotes_x.y.z.md"])
            run(["open", F"https://github.com/approvals/ApprovalTests.cpp/compare/{self.details.old_version.get_version_text()}...master"])
            check_step("the release notes are ready")

            run(["open", "https://github.com/approvals/ApprovalTests.cpp/issues"])
            check_step("any issues resolved in this release are closed")

            run(["open", "https://github.com/approvals/ApprovalTests.cpp/milestones"])
            check_step("the milestone (if any) is up to date, including actual version number of release")
Exemplo n.º 2
0
def check_repo() -> None:
    # check we are on a master branch that is in sync
    repo = Repo(".")
    assert_step((repo.active_branch.name == 'master'))
    GitUtilities.check_no_uncommitted_changes(repo)
    assert_step(len(
        list(repo.iter_commits('master@{u}..master'))) == 0,
                f"there are un-pushed changes in approvaltests")
    GitUtilities.pull_active_branch_origin(".")
Exemplo n.º 3
0
    def check_pre_conditions_for_main_repo(self) -> None:
        repo = Repo(self.details.locations.main_project_dir)
        assert_step(not repo.bare)
        GitUtilities.check_branch_name(repo, 'master')
        GitUtilities.check_no_uncommitted_changes(repo)

        # From https://stackoverflow.com/questions/15849640/how-to-get-count-of-unpublished-commit-with-gitpython
        assert_step(len(
            list(repo.iter_commits('master@{u}..master'))) == 0,
                    f"there are un-pushed changes in {self.details.project_details.github_project_name}")
 def disabled_test_entry_point_for_uncommitted_changes(self) -> None:
     set_home_directory()
     repo = Repo(ConanReleaseDetails().conan_repo_dir)
     GitUtilities.check_no_uncommitted_changes(repo)