Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit 74f1b42

Browse files
committed
alice: please: contribute: Successful creation of meta issue linking readme issue
Signed-off-by: John Andersen <[email protected]>
1 parent 15edb72 commit 74f1b42

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

entities/alice/alice/cli.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,7 @@ async def contribute_readme_md(
214214
self,
215215
repo: AliceGitRepo,
216216
base: "BaseBranch",
217-
commit_message: Optional[
218-
"ReadmeCommitMessage"
219-
] = "Recommended Community Standard: Add README",
217+
commit_message: "ReadmeCommitMessage",
220218
) -> "ReadmeBranch":
221219
# Attempt multiple commands
222220
async for event, result in dffml.run_command_events(
@@ -379,10 +377,11 @@ async def readme_issue(
379377
body,
380378
],
381379
logger=self.logger,
380+
events=[dffml.Subprocess.STDOUT],
382381
):
383-
if event is Subprocess.STDOUT:
382+
if event is dffml.Subprocess.STDOUT:
384383
# The URL of the issue created
385-
return result.strip()
384+
return result.strip().decode()
386385

387386
@staticmethod
388387
def readme_commit_message(
@@ -392,7 +391,7 @@ def readme_commit_message(
392391
f"""
393392
Recommended Community Standard: README
394393
395-
Closes: #{issue_url}
394+
Closes: {issue_url}
396395
"""
397396
).lstrip()
398397

@@ -402,7 +401,7 @@ def meta_issue_body(
402401
repo: AliceGitRepo,
403402
base: AlicePleaseContributeRecommendedCommunityStandardsOverlayGit.BaseBranch,
404403
readme_path: AlicePleaseContributeRecommendedCommunityStandards.ReadmePath,
405-
readme_issue: Optional["ReadmeIssue"] = None,
404+
readme_issue: ReadmeIssue,
406405
) -> "MetaIssueBody":
407406
"""
408407
>>> AlicePleaseContributeRecommendedCommunityStandardsGitHubIssueOverlay.meta_issue_body(
@@ -417,9 +416,14 @@ def meta_issue_body(
417416
"""
418417
return "\n".join(
419418
[
420-
f"- [x] [README]({repo.URL}/blob/{base}/{readme_path.relative_to(repo.directory).as_posix()})"
421-
if readme_issue is None
422-
else f"- [ ] {readme_issue}",
419+
"- ["
420+
+ ("x" if readme_issue is None else " ")
421+
+ "] "
422+
+ (
423+
"README: " + readme_issue
424+
if readme_issue is not None
425+
else f"[README]({repo.URL}/blob/{base}/{readme_path.relative_to(repo.directory).as_posix()})"
426+
),
423427
]
424428
)
425429

@@ -442,10 +446,11 @@ async def create_meta_issue(
442446
body,
443447
],
444448
logger=self.logger,
449+
events=[dffml.Subprocess.STDOUT],
445450
):
446-
if event is Subprocess.STDOUT:
451+
if event is dffml.Subprocess.STDOUT:
447452
# The URL of the issue created
448-
return result.strip()
453+
return result.strip().decode()
449454

450455

451456
# TODO Spawn background task (could use an orchestrator which creates a

0 commit comments

Comments
 (0)