diff --git a/entities/alice/alice/please/contribute/recommended_community_standards/cli.py b/entities/alice/alice/please/contribute/recommended_community_standards/cli.py index 1341a1a562..cfb2b658d6 100644 --- a/entities/alice/alice/please/contribute/recommended_community_standards/cli.py +++ b/entities/alice/alice/please/contribute/recommended_community_standards/cli.py @@ -14,7 +14,9 @@ import dffml -from .recommended_community_standards import AlicePleaseContributeRecommendedCommunityStandards +from .recommended_community_standards import ( + AlicePleaseContributeRecommendedCommunityStandards, +) DFFMLCLICMD = NewType("dffml.util.cli.CMD", object) @@ -23,7 +25,7 @@ ) # TODO A way to deactivate installed overlays so they are not merged or applied. -class AlicePleaseContributeRecommendedCommunityStandardsOverlayCLI: +class OverlayCLI: CLIRunOnRepo = NewType("CLIRunOnRepo", str) @staticmethod @@ -66,7 +68,9 @@ async def cli_has_repos( for repo in cmd.repos: yield repo - async def cli_run_on_repo(self, repo: "CLIRunOnRepo"): + async def cli_run_on_repo( + self, repo: "CLIRunOnRepo" + ) -> AlicePleaseContributeRecommendedCommunityStandards.RepoString: # TODO Similar to Expand being an alias of Union # # async def cli_run_on_repo(self, repo: 'CLIRunOnRepo') -> SystemContext[StringInputSetContext[AliceGitRepo]]: @@ -75,19 +79,81 @@ async def cli_run_on_repo(self, repo: "CLIRunOnRepo"): # Or ideally at class scope # # 'CLIRunOnRepo' -> SystemContext[StringInputSetContext[AliceGitRepo]] - async with self.parent.__class__(self.parent.config) as custom_run_dataflow: + """ + async with dffml.run_dataflow.imp( + dataflow=self.octx.config.dataflow, + ) as custom_run_dataflow: async with custom_run_dataflow( self.ctx, self.octx ) as custom_run_dataflow_ctx: # This is the type cast - custom_run_dataflow.op = self.parent.op._replace( + custom_run_dataflow.op = custom_run_dataflow.op._replace( inputs={ "repo": AlicePleaseContributeRecommendedCommunityStandards.RepoString - } + }, + outputs={}, ) # Set the dataflow to be the same flow - # TODO Reuse ictx? Is that applicable? - custom_run_dataflow.config.dataflow = self.octx.config.dataflow await dffml.run_dataflow.run_custom( custom_run_dataflow_ctx, {"repo": repo}, ) + """ + # TODO Clean this up once SystemContext refactor complete + # This is used to ensure we don't add any inputs that would retrigger + # any operations within this overlay when calling the subflow. + overlay_cli_dataflow = dffml.DataFlow( + *itertools.chain( + *[ + dffml.object_to_operations(cls) + for cls in [ + OverlayCLI, + *dffml.Overlay.load( + entrypoint="dffml.overlays.alice.please.contribute.recommended_community_standards.overlay.cli" + ), + ] + ] + ) + ) + async with dffml.run_dataflow.imp( + dataflow=self.octx.config.dataflow, + ) as custom_run_dataflow: + # Copy all inputs from parent context into child. We eventually + # should have InputNetworks which support acting as generic Copy on + # Write over an underlying InputNetwork. + async with custom_run_dataflow( + self.ctx, self.octx + ) as custom_run_dataflow_ctx: + async with self.octx.ictx.definitions(self.ctx) as definitions: + custom_run_dataflow.config.dataflow.seed = ( + custom_run_dataflow.config.dataflow.seed + + [ + item + async for item in definitions.inputs() + if ( + item.definition + in custom_run_dataflow.config.dataflow.definitions.values() + and item.definition + not in overlay_cli_dataflow.definitions.values() + ) + ] + ) + input_key = list(self.parent.op.inputs.keys())[0] + key, definition = list(self.parent.op.outputs.items())[0] + # This is the type cast + custom_run_dataflow.op = custom_run_dataflow.op._replace( + # TODO Debug why the commented out version doesn't work + # Likely due to re-auto-definition + inputs={input_key: definition}, + outputs={}, + ) + await dffml.run_dataflow.run_custom( + custom_run_dataflow_ctx, + { + input_key: dffml.Input( + value=repo, + definition=definition, + parents=None, + origin=(self.parent.op.instance_name, key), + ) + }, + ) diff --git a/entities/alice/alice/please/contribute/recommended_community_standards/recommended_community_standards.py b/entities/alice/alice/please/contribute/recommended_community_standards/recommended_community_standards.py index 460bdd1537..dc156b0c7f 100644 --- a/entities/alice/alice/please/contribute/recommended_community_standards/recommended_community_standards.py +++ b/entities/alice/alice/please/contribute/recommended_community_standards/recommended_community_standards.py @@ -1,5 +1,6 @@ import pathlib import textwrap +import itertools from typing import NamedTuple, NewType, Optional @@ -12,11 +13,27 @@ class AliceGitRepo(NamedTuple): URL: str +class AliceGitRepoInputSetContextHandle(dffml.BaseContextHandle): + def as_string(self) -> str: + return str(self.ctx.repo) + + +class AliceGitRepoInputSetContext(dffml.BaseInputSetContext): + def __init__(self, repo: AliceGitRepo): + self.repo = repo + + async def handle(self) -> AliceGitRepoInputSetContextHandle: + return AliceGitRepoInputSetContextHandle(self) + + def __repr__(self): + return repr(self.repo) + + def __str__(self): + return str(self.repo) + + class AlicePleaseContributeRecommendedCommunityStandards: - ReadmePath = NewType("ReadmePath", object) RepoString = NewType("repo.string", str) - ReadmeContents = NewType("repo.directory.readme.contents", str) - HasReadme = NewType("repo.directory.readme.exists", bool) async def guess_repo_string_is_directory( repo_string: "RepoString", @@ -26,38 +43,85 @@ async def guess_repo_string_is_directory( return return AliceGitRepo(directory=repo_string, URL=None) - # TODO Run this system context where readme contexts is given on CLI or - # overriden via disabling of static overlay and application of overlay to - # generate contents dynamiclly. - # aka, test with `-inputs` option - def create_readme_file_if_not_exists( + +# An overlay which could be installed if you have dffml-feature-git +# (aka dffml-operations-git) installed. +class OverlayGit: + GuessedGitURL = NewType("guessed.git.url", bool) + DefaultBranchName = NewType("default.branch.name", str) + BaseBranch = NewType("repo.git.base.branch", str) + WriteableGitRemoteOrigin = NewType("writable.github.remote.origin", str) + + # The operations we use defined elsewhere + check_if_valid_git_repository_URL = ( + dffml_feature_git.feature.operations.check_if_valid_git_repository_URL + ) + clone_git_repo = dffml_feature_git.feature.operations.clone_git_repo + git_repo_default_branch = ( + dffml_feature_git.feature.operations.git_repo_default_branch + ) + + def guess_repo_string_is_url( self, - repo: AliceGitRepo, - readme_contents: Optional["ReadmeContents"] = "# My Awesome Project's README", - ) -> "ReadmePath": - # Do not create readme if it already exists - path = pathlib.Path(repo.directory, "README.md") - if path.exists(): - return path - path.write_text(readme_contents) - return path + repo_string: AlicePleaseContributeRecommendedCommunityStandards.RepoString, + ) -> GuessedGitURL: + if "://" not in repo_string: + return + return repo_string + def guessed_repo_string_means_no_git_branch_given( + repo_url: GuessedGitURL, + ) -> dffml_feature_git.feature.definitions.NoGitBranchGivenType: + # TODO Support _ prefixed unused variables (repo_url used to trigger, + # always true on trigger). + return True -class AlicePleaseContributeRecommendedCommunityStandardsOverlayAliceOperationsGit: + # If you think you have a URL to a git repo, convert it so it will be + # cloned. + def guessed_repo_string_is_operations_git_url( + repo_url: GuessedGitURL, + ) -> dffml_feature_git.feature.definitions.URLType: + return repo_url + + # If a Git repo was cloned, convert it to an AliceGitRepo so that Alice + # know's she should be dealing with it. def git_repo_to_alice_git_repo( repo: dffml_feature_git.feature.definitions.git_repository, ) -> AliceGitRepo: return repo - -# This overlay has a suggested companion overlay of -# AlicePleaseContributeRecommendedCommunityStandardsOverlayOperationsGit due to -# it providing inputs this overlay needs, could suggest to use overlays together -# based of this info. -class AlicePleaseContributeRecommendedCommunityStandardsOverlayGit: - ReadmeCommitMessage = NewType("repo.readme.git.commit.message", str) - ReadmeBranch = NewType("repo.readme.git.branch", str) - BaseBranch = NewType("repo.git.base.branch", str) + async def create_branch_if_none_exists( + self, repo: AliceGitRepo, name: Optional["DefaultBranchName"] = "main", + ) -> dffml_feature_git.feature.definitions.GitBranchType: + """ + If there are no branches, the git_repo_default_branch operation will + return None, aka there si no default branch. Therefore, in this + operation, we check if there are any branches at all, and if there are + not we create a new branch. We could optionally facilitate interaction + of multiple similar operations which wish to create a default branch if + none exist by creating a new defintion which is locked which could be + used to synchronise communication aka request for lock from some service + which has no native locking (transmistion of NFT via DIDs over abitrary + channels for example). + """ + branches = ( + await dffml_feature_git.feature.operations.check_output( + "git", "branch", "-r", cwd=repo.directory + ) + ).split("\n") + # If there's branches then bail out + if list(filter(bool, branches)): + return + await dffml.run_command( + ["git", "branch", "-M", name], + cwd=repo.directory, + logger=self.logger, + ) + await dffml.run_command( + ["git", "commit", "-m", "Created branch", "--allow-empty"], + logger=self.logger, + ) + return name @staticmethod def determin_base_branch( @@ -69,10 +133,165 @@ def determin_base_branch( # Later do NLP on contributing docs to determine return default_branch - async def contribute_readme_md( + +async def github_owns_remote( + self, directory: str, check_remote: str, *, logger=None, +) -> bool: + remotes = {} + async for event, result in dffml.run_command_events( + ["git", "remote", "-v"], + cwd=directory, + logger=logger, + events=[dffml.Subprocess.STDOUT_READLINE], + ): + if event is dffml.Subprocess.STDOUT_READLINE: + remote, url_and_usages = ( + result.decode().strip().split("\t", maxsplit=2) + ) + if remote != check_remote: + continue + url = url_and_usages.split()[0] + async for event, result in dffml.run_command_events( + [ + "gh", + "repo", + "view", + url, + "--json", + "viewerPermission", + "-q", + ".viewerPermission", + ], + logger=logger, + events=[dffml.Subprocess.STDOUT], + ): + result = result.strip().decode() + if event is dffml.Subprocess.STDOUT and result in ( + "ADMIN", + "MAINTAIN", + ): + return True + return False + + +class OverlayGitHub: + async def github_owns_remote( self, repo: AliceGitRepo, - base: "BaseBranch", + remote: dffml_feature_git.feature.definitions.git_remote, + ) -> OverlayGit.WriteableGitRemoteOrigin: + if repo.URL is None or not await github_owns_remote( + self, repo.directory, remote, logger=self.logger + ): + return + return remote + + +# NOTE Not sure if the orchestrator will know what to do if we do this +# ReadmeGitRepo = AliceGitRepo +class ReadmeGitRepo(NamedTuple): + directory: str + URL: str + + +class OverlayREADME: + ReadmePath = NewType("ReadmePath", object) + ReadmeContents = NewType("repo.directory.readme.contents", str) + ReadmeCommitMessage = NewType("repo.readme.git.commit.message", str) + ReadmeBranch = NewType("repo.readme.git.branch", str) + ReadmePR = NewType("ReadmePR", str) + ReadmeIssue = NewType("ReadmeIssue", str) + ReadmeIssueBody = NewType("ReadmeIssueBody", str) + ReadmeIssueTitle = NewType("ReadmeIssueTitle", str) + ReadmePRTitle = NewType("github.pr.title", str) + ReadmePRBody = NewType("github.pr.body", str) + + # async def cli_run_on_repo(self, repo: "CLIRunOnRepo"): + async def alice_contribute_readme( + self, repo: AliceGitRepo + ) -> ReadmeGitRepo: + # TODO Clean this up once SystemContext refactor complete + overlay_readme_dataflow = dffml.DataFlow( + *itertools.chain( + *[ + dffml.object_to_operations(cls) + for cls in [ + OverlayREADME, + *dffml.Overlay.load( + entrypoint="dffml.overlays.alice.please.contribute.recommended_community_standards.overlay.readme" + ), + ] + ] + ) + ) + async with dffml.run_dataflow.imp( + # dataflow=self.octx.config.dataflow, + dataflow=overlay_readme_dataflow, + input_set_context_cls=AliceGitRepoInputSetContext, + ) as custom_run_dataflow: + # Copy all inputs from parent context into child. We eventually + # should have InputNetworks which support acting as generic Copy on + # Write over an underlying InputNetwork. + async with custom_run_dataflow( + self.ctx, self.octx + ) as custom_run_dataflow_ctx: + async with self.octx.ictx.definitions(self.ctx) as definitions: + custom_run_dataflow.config.dataflow.seed = ( + custom_run_dataflow.config.dataflow.seed + + [ + item + async for item in definitions.inputs() + if ( + item.definition + in custom_run_dataflow.config.dataflow.definitions.values() + and item.definition + not in self.parent.op.inputs.values() + ) + ] + ) + input_key = list(self.parent.op.inputs.keys())[0] + key, definition = list(self.parent.op.outputs.items())[0] + # This is the type cast + custom_run_dataflow.op = custom_run_dataflow.op._replace( + # TODO Debug why the commented out version doesn't work + # Likely due to re-auto-definition + inputs={input_key: definition}, + outputs={}, + ) + await dffml.run_dataflow.run_custom( + custom_run_dataflow_ctx, + { + input_key: dffml.Input( + value=repo, + definition=definition, + parents=None, + origin=(self.parent.op.instance_name, key), + ) + }, + ) + + # TODO Run this system context where readme contexts is given on CLI or + # overriden via disabling of static overlay and application of overlay to + # generate contents dynamiclly. + # aka, test with `-inputs` option + def create_readme_file_if_not_exists( + self, + repo: ReadmeGitRepo, + readme_contents: Optional[ + "ReadmeContents" + ] = "# My Awesome Project's README", + ) -> "ReadmePath": + # Do not create readme if it already exists + path = pathlib.Path(repo.directory, "README.md") + if path.exists(): + return path + path.write_text(readme_contents) + return path + + async def contribute_readme_md( + self, + repo: ReadmeGitRepo, + base: OverlayGit.BaseBranch, commit_message: "ReadmeCommitMessage", ) -> "ReadmeBranch": branch_name: str = "alice-contribute-recommended-community-standards-readme" @@ -94,9 +313,13 @@ async def contribute_readme_md( ) elif event is dffml.Subprocess.COMPLETED: if result != 0: - raise RuntimeError("Failed to create branch for contribution") + raise RuntimeError( + "Failed to create branch for contribution" + ) await dffml.run_command( - ["git", "add", "README.md"], cwd=repo.directory, logger=self.logger, + ["git", "add", "README.md"], + cwd=repo.directory, + logger=self.logger, ) await dffml.run_command( ["git", "commit", "-sm", commit_message], @@ -105,23 +328,14 @@ async def contribute_readme_md( ) return branch_name - -# TODO Spawn background task (could use an orchestrator which creates a -# GitHub Actions cron job to execute later). set_close_meta_issue_trigger -class AlicePleaseContributeRecommendedCommunityStandardsOverlayGitHubPullRequest: - ReadmePR = NewType("ReadmePR", str) - Title = NewType("github.pr.title", str) - Body = NewType("github.pr.body", str) - WriteableGitRemoteOrigin = NewType("writable.github.remote.origin", str) - async def readme_pr( self, - repo: AliceGitRepo, - base: AlicePleaseContributeRecommendedCommunityStandardsOverlayGit.BaseBranch, - origin: "WriteableGitRemoteOrigin", - head: AlicePleaseContributeRecommendedCommunityStandardsOverlayGit.ReadmeBranch, - title: "Title", - body: "Body", + repo: ReadmeGitRepo, + base: OverlayGit.BaseBranch, + origin: OverlayGit.WriteableGitRemoteOrigin, + head: "ReadmeBranch", + title: "ReadmePRTitle", + body: "ReadmePRBody", ) -> "ReadmePR": """ @@ -160,80 +374,13 @@ async def readme_pr( logger=self.logger, ) - -async def github_owns_remote( - self, directory: str, check_remote: str, *, logger=None, -) -> bool: - remotes = {} - async for event, result in dffml.run_command_events( - ["git", "remote", "-v"], - cwd=directory, - logger=logger, - events=[dffml.Subprocess.STDOUT_READLINE], - ): - if event is dffml.Subprocess.STDOUT_READLINE: - remote, url_and_usages = result.decode().strip().split("\t", maxsplit=2) - if remote != check_remote: - continue - url = url_and_usages.split()[0] - async for event, result in dffml.run_command_events( - [ - "gh", - "repo", - "view", - url, - "--json", - "viewerPermission", - "-q", - ".viewerPermission", - ], - logger=logger, - events=[dffml.Subprocess.STDOUT], - ): - result = result.strip().decode() - if event is dffml.Subprocess.STDOUT and result in ("ADMIN", "MAINTAIN"): - return True - return False - - -class AlicePleaseContributeRecommendedCommunityStandardsOverlayGitHubWritableRemotesFromPermissions: - async def github_owns_remote( - self, - repo: AliceGitRepo, - remote: dffml_feature_git.feature.definitions.git_remote, - ) -> AlicePleaseContributeRecommendedCommunityStandardsOverlayGitHubPullRequest.WriteableGitRemoteOrigin: - if repo.URL is None or not await github_owns_remote( - self, repo.directory, remote, logger=self.logger - ): - return - return remote - - -class AlicePleaseContributeRecommendedCommunityStandardsOverlayGitHubIssue: - """ - - Check if we have any other issues open for the repo - - .. code-block:: console - :test: - - $ gh issue -R "${GITHUB_REPO}" list --search "Recommended Community Standard" - no issues match your search in intel/dffml - - """ - - ReadmeIssue = NewType("ReadmeIssue", str) - ReadmeIssueTitle = NewType("ReadmeIssueTitle", str) - ReadmeIssueBody = NewType("ReadmeIssueBody", str) - MetaIssue = NewType("MetaIssue", str) - MetaIssueTitle = NewType("MetaIssueTitle", str) - MetaIssueBody = NewType("MetaIssueBody", str) - # body: Optional['ContributingIssueBody'] = "References:\n- https://docs.github.com/articles/setting-guidelines-for-repository-contributors/", async def readme_issue( self, - repo: AliceGitRepo, - title: Optional["ReadmeIssueTitle"] = "Recommended Community Standard: README", + repo: ReadmeGitRepo, + title: Optional[ + "ReadmeIssueTitle" + ] = "Recommended Community Standard: README", body: Optional[ "ReadmeIssueBody" ] = "References:\n- https://docs.github.com/articles/about-readmes/", @@ -260,7 +407,7 @@ async def readme_issue( @staticmethod def readme_commit_message( issue_url: "ReadmeIssue", - ) -> AlicePleaseContributeRecommendedCommunityStandardsOverlayGit.ReadmeCommitMessage: + ) -> "ReadmeCommitMessage": return textwrap.dedent( f""" Recommended Community Standard: README @@ -269,13 +416,58 @@ def readme_commit_message( """ ).lstrip() + @staticmethod + async def readme_pr_body(readme_issue: "ReadmeIssue",) -> "ReadmePRBody": + return f"Closes: {readme_issue}" + + async def readme_pr_title( + self, readme_issue: "ReadmeIssue", + ) -> "ReadmePRTitle": + """ + Use the issue title as the pull request title + """ + async for event, result in dffml.run_command_events( + [ + "gh", + "issue", + "view", + "--json", + "title", + "-q", + ".title", + readme_issue, + ], + logger=self.logger, + events=[dffml.Subprocess.STDOUT], + ): + if event is dffml.Subprocess.STDOUT: + return result.strip().decode() + + +class OverlayMetaIssue: + """ + + Check if we have any other issues open for the repo + + .. code-block:: console + :test: + + $ gh issue -R "${GITHUB_REPO}" list --search "Recommended Community Standard" + no issues match your search in intel/dffml + + """ + + MetaIssue = NewType("MetaIssue", str) + MetaIssueTitle = NewType("MetaIssueTitle", str) + MetaIssueBody = NewType("MetaIssueBody", str) + # TODO(alice) There is a bug with Optional which can be revield by use here @staticmethod def meta_issue_body( repo: AliceGitRepo, - base: AlicePleaseContributeRecommendedCommunityStandardsOverlayGit.BaseBranch, - readme_path: AlicePleaseContributeRecommendedCommunityStandards.ReadmePath, - readme_issue: ReadmeIssue, + base: OverlayGit.BaseBranch, + readme_path: OverlayREADME.ReadmePath, + readme_issue: OverlayREADME.ReadmeIssue, ) -> "MetaIssueBody": """ >>> AlicePleaseContributeRecommendedCommunityStandardsGitHubIssueOverlay.meta_issue_body( @@ -307,6 +499,9 @@ async def create_meta_issue( body: "MetaIssueBody", title: Optional["MetaIssueTitle"] = "Recommended Community Standards", ) -> "MetaIssue": + # TODO Spawn background task (could use an orchestrator which creates a + # GitHub Actions cron job to execute later). + # set_close_meta_issue_trigger. async for event, result in dffml.run_command_events( [ "gh", @@ -325,93 +520,3 @@ async def create_meta_issue( if event is dffml.Subprocess.STDOUT: # The URL of the issue created return result.strip().decode() - - -class AlicePleaseContributeRecommendedCommunityStandardsOverlayGitHubPullRequestReferenceIssue: - @staticmethod - async def readme_pr_body( - readme_issue: AlicePleaseContributeRecommendedCommunityStandardsOverlayGitHubIssue.ReadmeIssue, - ) -> AlicePleaseContributeRecommendedCommunityStandardsOverlayGitHubPullRequest.Body: - return f"Closes: {readme_issue}" - - async def readme_pr_title( - self, - readme_issue: AlicePleaseContributeRecommendedCommunityStandardsOverlayGitHubIssue.ReadmeIssue, - ) -> AlicePleaseContributeRecommendedCommunityStandardsOverlayGitHubPullRequest.Title: - """ - Use the issue title as the pull request title - """ - async for event, result in dffml.run_command_events( - ["gh", "issue", "view", "--json", "title", "-q", ".title", readme_issue,], - logger=self.logger, - events=[dffml.Subprocess.STDOUT], - ): - if event is dffml.Subprocess.STDOUT: - return result.strip().decode() - - -# An overlay which could be installed if you have dffml-feature-git -# (aka dffml-operations-git) installed. -class AlicePleaseContributeRecommendedCommunityStandardsOverlayOperationsGit: - GuessedGitURL = NewType("guessed.git.url", bool) - DefaultBranchName = NewType("default.branch.name", str) - - # The operations we use defined elsewhere - check_if_valid_git_repository_URL = ( - dffml_feature_git.feature.operations.check_if_valid_git_repository_URL - ) - clone_git_repo = dffml_feature_git.feature.operations.clone_git_repo - git_repo_default_branch = ( - dffml_feature_git.feature.operations.git_repo_default_branch - ) - - def guess_repo_string_is_url( - self, - repo_string: AlicePleaseContributeRecommendedCommunityStandards.RepoString, - ) -> GuessedGitURL: - if "://" not in repo_string: - return - return repo_string - - def guessed_repo_string_means_no_git_branch_given( - repo_url: GuessedGitURL, - ) -> dffml_feature_git.feature.definitions.NoGitBranchGivenType: - # TODO Support _ prefixed unused variables (repo_url used to trigger, - # always true on trigger). - return True - - def guessed_repo_string_is_operations_git_url( - repo_url: GuessedGitURL, - ) -> dffml_feature_git.feature.definitions.URLType: - return repo_url - - async def create_branch_if_none_exists( - self, repo: AliceGitRepo, name: Optional["DefaultBranchName"] = "main", - ) -> dffml_feature_git.feature.definitions.GitBranchType: - """ - If there are no branches, the git_repo_default_branch operation will - return None, aka there si no default branch. Therefore, in this - operation, we check if there are any branches at all, and if there are - not we create a new branch. We could optionally facilitate interaction - of multiple similar operations which wish to create a default branch if - none exist by creating a new defintion which is locked which could be - used to synchronise communication aka request for lock from some service - which has no native locking (transmistion of NFT via DIDs over abitrary - channels for example). - """ - branches = ( - await dffml_feature_git.feature.operations.check_output( - "git", "branch", "-r", cwd=repo.directory - ) - ).split("\n") - # If there's branches then bail out - if list(filter(bool, branches)): - return - await dffml.run_command( - ["git", "branch", "-M", name], cwd=repo.directory, logger=self.logger, - ) - await dffml.run_command( - ["git", "commit", "-m", "Created branch", "--allow-empty"], - logger=self.logger, - ) - return name diff --git a/entities/alice/entry_points.txt b/entities/alice/entry_points.txt index 7ad41c6f25..625f4f89cf 100644 --- a/entities/alice/entry_points.txt +++ b/entities/alice/entry_points.txt @@ -5,11 +5,8 @@ alice = alice.cli:AliceCLI.main Alice = alice.system_context:Alice [dffml.overlays.alice.please.contribute.recommended_community_standards] -CLI = alice.please.contribute.recommended_community_standards.cli:AlicePleaseContributeRecommendedCommunityStandardsOverlayCLI -Git = alice.please.contribute.recommended_community_standards.recommended_community_standards:AlicePleaseContributeRecommendedCommunityStandardsOverlayGit -GitHubIssue = alice.please.contribute.recommended_community_standards.recommended_community_standards:AlicePleaseContributeRecommendedCommunityStandardsOverlayGitHubIssue -GitHubWritableRemotesFromPermissions = alice.please.contribute.recommended_community_standards.recommended_community_standards:AlicePleaseContributeRecommendedCommunityStandardsOverlayGitHubWritableRemotesFromPermissions -GitHubPullRequest = alice.please.contribute.recommended_community_standards.recommended_community_standards:AlicePleaseContributeRecommendedCommunityStandardsOverlayGitHubPullRequest -GitHubPullRequestReferenceIssue = alice.please.contribute.recommended_community_standards.recommended_community_standards:AlicePleaseContributeRecommendedCommunityStandardsOverlayGitHubPullRequestReferenceIssue -AliceOperationsGit = alice.please.contribute.recommended_community_standards.recommended_community_standards:AlicePleaseContributeRecommendedCommunityStandardsOverlayAliceOperationsGit -OperationsGit = alice.please.contribute.recommended_community_standards.recommended_community_standards:AlicePleaseContributeRecommendedCommunityStandardsOverlayOperationsGit +CLI = alice.please.contribute.recommended_community_standards.cli:OverlayCLI +OverlayGit = alice.please.contribute.recommended_community_standards.recommended_community_standards:OverlayGit +OverlayGitHub = alice.please.contribute.recommended_community_standards.recommended_community_standards:OverlayGitHub +OverlayREADME = alice.please.contribute.recommended_community_standards.recommended_community_standards:OverlayREADME +OverlayMetaIssue = alice.please.contribute.recommended_community_standards.recommended_community_standards:OverlayMetaIssue