Skip to content

Commit 5ada255

Browse files
committed
wip
1 parent a4b67a0 commit 5ada255

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

src/release_tool/commands/push.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ def _display_draft_releases(draft_files: list[Path], title: str = "Draft Release
374374
@click.option('--notes-file', '-f', type=click.Path(), help='Path to release notes file (markdown, optional - will auto-find if not specified)')
375375
@click.option('--release/--no-release', 'create_release', default=None, help='Create GitHub release (default: from config)')
376376
@click.option('--pr/--no-pr', 'create_pr', default=None, help='Create PR with release notes (default: from config)')
377-
@click.option('--release-mode', type=click.Choice(['draft', 'published', 'just-push'], case_sensitive=False), default=None, help='Release mode: draft, published, or just-push (mark existing as pushed without recreating)')
377+
@click.option('--release-mode', type=click.Choice(['draft', 'published', 'mark-published'], case_sensitive=False), default=None, help='Release mode: draft, published, or mark-published (mark existing draft release as published without recreating)')
378378
@click.option('--prerelease', type=click.Choice(['auto', 'true', 'false'], case_sensitive=False), default=None,
379379
help='Mark as prerelease: auto (detect from version), true, or false (default: from config)')
380380
@click.option('--force', type=click.Choice(['none', 'draft', 'published'], case_sensitive=False), default='none', help='Force overwrite existing release (default: none)')
@@ -494,8 +494,8 @@ def push(ctx, version: Optional[str], list_drafts: bool, delete_drafts: bool, no
494494
else:
495495
mode = release_mode if release_mode is not None else config.output.release_mode
496496

497-
# Handle just-push mode: only mark existing release as published
498-
is_just_push = (mode == 'just-push')
497+
# Handle mark-published mode: only mark existing draft release as published
498+
is_mark_published = (mode == 'mark-published')
499499
is_draft = (mode == 'draft')
500500

501501
# Handle tri-state prerelease: "auto", "true", "false"
@@ -777,8 +777,8 @@ def push(ctx, version: Optional[str], list_drafts: bool, delete_drafts: bool, no
777777
if create_release:
778778
tag_name = f"v{version}"
779779

780-
# Handle just-push mode: only update existing release to published
781-
if is_just_push:
780+
# Handle mark-published mode: only update existing draft release to published
781+
if is_mark_published:
782782
if dry_run:
783783
console.print(f"[yellow]Would mark existing GitHub release as published:[/yellow]")
784784
console.print(f"[yellow] Repository: {repo_name}[/yellow]")
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: MIT
44

5-
"""Tests for push command just-push mode functionality."""
5+
"""Tests for push command mark-published mode functionality."""
66

77
import pytest
88
from pathlib import Path
@@ -52,7 +52,7 @@ def test_notes_file(tmp_path):
5252
@patch("release_tool.commands.push.determine_release_branch_strategy")
5353
@patch("release_tool.commands.push.GitHubClient")
5454
def test_just_push_mode_dry_run(mock_gh_client, mock_strategy, mock_git_ops, mock_db, test_config, test_notes_file):
55-
"""Test just-push mode in dry-run shows expected output."""
55+
"""Test mark-published mode in dry-run shows expected output."""
5656
runner = CliRunner()
5757

5858
# Mock database
@@ -74,11 +74,11 @@ def test_just_push_mode_dry_run(mock_gh_client, mock_strategy, mock_git_ops, moc
7474

7575
result = runner.invoke(
7676
push,
77-
['1.0.0', '-f', str(test_notes_file), '--dry-run', '--release', '--release-mode', 'just-push'],
77+
['1.0.0', '-f', str(test_notes_file), '--dry-run', '--release', '--release-mode', 'mark-published'],
7878
obj={'config': test_config}
7979
)
80-
81-
# Should show dry-run output for just-push mode
80+
81+
# Should show dry-run output for mark-published mode
8282
assert result.exit_code == 0
8383
assert 'DRY RUN' in result.output
8484
assert 'Would mark existing GitHub release as published' in result.output
@@ -94,7 +94,7 @@ def test_just_push_mode_dry_run(mock_gh_client, mock_strategy, mock_git_ops, moc
9494
@patch("release_tool.commands.push.determine_release_branch_strategy")
9595
@patch("release_tool.commands.push.GitHubClient")
9696
def test_just_push_mode_no_existing_release(mock_gh_client, mock_strategy, mock_git_ops, mock_db, test_config, test_notes_file):
97-
"""Test just-push mode fails when no existing release found."""
97+
"""Test mark-published mode fails when no existing release found."""
9898
runner = CliRunner()
9999

100100
# Mock database
@@ -121,10 +121,10 @@ def test_just_push_mode_no_existing_release(mock_gh_client, mock_strategy, mock_
121121

122122
result = runner.invoke(
123123
push,
124-
['1.0.0', '-f', str(test_notes_file), '--release', '--release-mode', 'just-push'],
124+
['1.0.0', '-f', str(test_notes_file), '--release', '--release-mode', 'mark-published'],
125125
obj={'config': test_config}
126126
)
127-
127+
128128
# Should fail with error
129129
assert result.exit_code == 1
130130
assert 'No existing GitHub release found' in result.output
@@ -139,7 +139,7 @@ def test_just_push_mode_no_existing_release(mock_gh_client, mock_strategy, mock_
139139
@patch("release_tool.commands.push.determine_release_branch_strategy")
140140
@patch("release_tool.commands.push.GitHubClient")
141141
def test_just_push_mode_marks_existing_release_as_published(mock_gh_client, mock_strategy, mock_git_ops, mock_db, test_config, test_notes_file):
142-
"""Test just-push mode successfully marks existing release as published."""
142+
"""Test mark-published mode successfully marks existing release as published."""
143143
runner = CliRunner()
144144

145145
# Mock database
@@ -176,7 +176,7 @@ def test_just_push_mode_marks_existing_release_as_published(mock_gh_client, mock
176176

177177
result = runner.invoke(
178178
push,
179-
['1.0.0', '-f', str(test_notes_file), '--release', '--release-mode', 'just-push'],
179+
['1.0.0', '-f', str(test_notes_file), '--release', '--release-mode', 'mark-published'],
180180
obj={'config': test_config}
181181
)
182182

@@ -200,7 +200,7 @@ def test_just_push_mode_marks_existing_release_as_published(mock_gh_client, mock
200200
@patch("release_tool.commands.push.determine_release_branch_strategy")
201201
@patch("release_tool.commands.push.GitHubClient")
202202
def test_just_push_mode_preserves_release_properties(mock_gh_client, mock_strategy, mock_git_ops, mock_db, test_config, test_notes_file):
203-
"""Test just-push mode preserves all existing release properties."""
203+
"""Test mark-published mode preserves all existing release properties."""
204204
runner = CliRunner()
205205

206206
# Mock database
@@ -237,7 +237,7 @@ def test_just_push_mode_preserves_release_properties(mock_gh_client, mock_strate
237237

238238
result = runner.invoke(
239239
push,
240-
['1.0.0-beta.1', '-f', str(test_notes_file), '--release', '--release-mode', 'just-push'],
240+
['1.0.0-beta.1', '-f', str(test_notes_file), '--release', '--release-mode', 'mark-published'],
241241
obj={'config': test_config}
242242
)
243243

@@ -259,7 +259,7 @@ def test_just_push_mode_preserves_release_properties(mock_gh_client, mock_strate
259259
@patch("release_tool.commands.push.determine_release_branch_strategy")
260260
@patch("release_tool.commands.push.GitHubClient")
261261
def test_just_push_mode_skips_tag_creation(mock_gh_client, mock_strategy, mock_git_ops, mock_db, test_config, test_notes_file):
262-
"""Test just-push mode does not create or push tags."""
262+
"""Test mark-published mode does not create or push tags."""
263263
runner = CliRunner()
264264

265265
# Mock database
@@ -296,7 +296,7 @@ def test_just_push_mode_skips_tag_creation(mock_gh_client, mock_strategy, mock_g
296296

297297
result = runner.invoke(
298298
push,
299-
['1.0.0', '-f', str(test_notes_file), '--release', '--release-mode', 'just-push'],
299+
['1.0.0', '-f', str(test_notes_file), '--release', '--release-mode', 'mark-published'],
300300
obj={'config': test_config}
301301
)
302302

@@ -314,7 +314,7 @@ def test_just_push_mode_skips_tag_creation(mock_gh_client, mock_strategy, mock_g
314314
@patch("release_tool.commands.push.determine_release_branch_strategy")
315315
@patch("release_tool.commands.push.GitHubClient")
316316
def test_just_push_mode_with_debug_output(mock_gh_client, mock_strategy, mock_git_ops, mock_db, test_config, test_notes_file):
317-
"""Test just-push mode shows debug output when enabled."""
317+
"""Test mark-published mode shows debug output when enabled."""
318318
runner = CliRunner()
319319

320320
# Mock database
@@ -351,7 +351,7 @@ def test_just_push_mode_with_debug_output(mock_gh_client, mock_strategy, mock_gi
351351

352352
result = runner.invoke(
353353
push,
354-
['1.0.0', '-f', str(test_notes_file), '--release', '--release-mode', 'just-push'],
354+
['1.0.0', '-f', str(test_notes_file), '--release', '--release-mode', 'mark-published'],
355355
obj={'config': test_config, 'debug': True}
356356
)
357357

@@ -366,7 +366,7 @@ def test_just_push_mode_with_debug_output(mock_gh_client, mock_strategy, mock_gi
366366
@patch("release_tool.commands.push.determine_release_branch_strategy")
367367
@patch("release_tool.commands.push.GitHubClient")
368368
def test_just_push_mode_fails_when_update_fails(mock_gh_client, mock_strategy, mock_git_ops, mock_db, test_config, test_notes_file):
369-
"""Test just-push mode fails gracefully when GitHub update fails."""
369+
"""Test mark-published mode fails gracefully when GitHub update fails."""
370370
runner = CliRunner()
371371

372372
# Mock database
@@ -403,7 +403,7 @@ def test_just_push_mode_fails_when_update_fails(mock_gh_client, mock_strategy, m
403403

404404
result = runner.invoke(
405405
push,
406-
['1.0.0', '-f', str(test_notes_file), '--release', '--release-mode', 'just-push'],
406+
['1.0.0', '-f', str(test_notes_file), '--release', '--release-mode', 'mark-published'],
407407
obj={'config': test_config}
408408
)
409409

0 commit comments

Comments
 (0)