Skip to content
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# FU-P9-T4-1 — Align publish_helper output with protected main branch workflow

**Priority:** P1
**Dependencies:** P9-T4
**Phase:** Phase 9 Follow-up Backlog

## Objective
Ensure release guidance emitted by `scripts/publish_helper.py` is safe for repositories where `main` is protected and direct push is disallowed.

## Deliverables
1. Update the helper summary command block to a PR-first flow:
- create release branch
- commit and push release branch
- open/merge PR into `main`
- pull `main`, then create and push tag
2. Update unit tests in `tests/unit/test_publish_helper.py` to assert protected-branch-safe guidance is printed.
3. Keep current helper behavior unchanged for version updates themselves (only guidance text/commands should change).
4. Produce validation evidence in `SPECS/INPROGRESS/FU-P9-T4-1_Validation_Report.md`.

## Acceptance Criteria
1. Running `python scripts/publish_helper.py <version>` does not suggest direct push-to-main flow.
2. Printed commands include branch creation/push and explicit PR-merge step before tagging.
3. Guidance still includes tag creation/push after merge to trigger publish workflow.
4. `pytest tests/unit/test_publish_helper.py` passes.

## Execution Plan
1. Modify `print_summary()` command output in `scripts/publish_helper.py`.
2. Update test assertions to match new guidance text.
3. Run required quality gates per FLOW:
- `pytest`
- `ruff check src/`
- `mypy src/`
- `pytest --cov` (>= 90%)
4. Write validation report with acceptance criteria and gate outputs.

---
**Archived:** 2026-02-13
**Verdict:** PASS
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# FU-P9-T4-1 Validation Report

**Task:** Align publish_helper output with protected main branch workflow
**Date:** 2026-02-13
**Verdict:** PASS

## Changes Implemented

1. Updated `scripts/publish_helper.py` release guidance output to protected-branch-safe flow:
- create release branch
- commit and push release branch
- open PR and merge into `main`
- pull `main`, then create/push tag
2. Updated `tests/unit/test_publish_helper.py` assertions to validate:
- protected-branch guidance label
- release branch creation command
- explicit PR merge step before tagging
3. Added `FU-P9-T4-1` follow-up task entry in `SPECS/Workplan.md` under Phase 9 follow-up backlog.

## Acceptance Criteria Check

| Criteria | Status | Evidence |
|---|---|---|
| `publish_helper.py` no longer suggests direct push-to-main flow | PASS | Output now prints `Next release commands (protected main branch flow)` and branch/PR steps |
| Printed commands include branch creation/push and PR-to-main before tagging | PASS | Output includes `git checkout -b release/v<version>`, `git push -u origin release/v<version>`, and `Open a PR ...` |
| Tag creation/push remains in guidance after merge | PASS | Output still includes `git tag v<version>` and `git push origin v<version>` after main sync steps |
| `pytest tests/unit/test_publish_helper.py` passes | PASS | 17 passed |

## Quality Gates (FLOW)

- `pytest` -> **345 passed, 5 skipped**
- `ruff check src/` -> **All checks passed**
- `mypy src/` -> **Success: no issues found in 12 source files**
- `pytest --cov` -> **96.62% total coverage** (>= 90%)

## Notes

- Test suite emitted existing non-blocking warnings related to deprecated WebSocket APIs and occasional port `8080` bind contention in a background test thread.
- These warnings did not affect pass/fail status.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## REVIEW REPORT — FU-P9-T4-1 publish_helper protected-main guidance

**Scope:** `origin/main..HEAD`
**Files:** 7

### Summary Verdict
- [x] Approve
- [ ] Approve with comments
- [ ] Request changes
- [ ] Block

### Critical Issues
- None.

### Secondary Issues
- None.

### Architectural Notes
- The release-helper guidance now matches protected-branch workflows and no longer implies direct commits/tags from `main`.
- Changes are appropriately scoped to command guidance text, unit coverage, and workflow artifacts.

### Tests
- `pytest` passed (`345 passed, 5 skipped`).
- `ruff check src/` passed.
- `mypy src/` passed.
- `pytest --cov` passed with **96.62%** total coverage (>= 90%).

### Next Steps
- No actionable findings.
- FOLLOW-UP step is skipped.
4 changes: 4 additions & 0 deletions SPECS/ARCHIVE/INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
| FU-P9-T2-1 | [FU-P9-T2-1_Fix_uvx_Web_UI_examples_to_include_webui_extras/](FU-P9-T2-1_Fix_uvx_Web_UI_examples_to_include_webui_extras/) | 2026-02-13 | PASS |
| BUG-T0 | [BUG-T0_Uptime_Widget_Fix/](BUG-T0_Uptime_Widget_Fix/) | 2026-02-13 | PASS |
| P9-T4 | [P9-T4_Create_the_publishing_helper/](P9-T4_Create_the_publishing_helper/) | 2026-02-13 | PASS |
| FU-P9-T4-1 | [FU-P9-T4-1_Align_publish_helper_output_with_protected_main_branch_workflow/](FU-P9-T4-1_Align_publish_helper_output_with_protected_main_branch_workflow/) | 2026-02-13 | PASS |

## Historical Artifacts

Expand Down Expand Up @@ -127,6 +128,7 @@
| [REVIEW_fu_p9_t2_1_uvx_webui_extras.md](FU-P9-T2-1_Fix_uvx_Web_UI_examples_to_include_webui_extras/REVIEW_fu_p9_t2_1_uvx_webui_extras.md) | Review report for FU-P9-T2-1 |
| [REVIEW_BUG-T0_Uptime_Widget.md](BUG-T0_Uptime_Widget_Fix/REVIEW_BUG-T0_Uptime_Widget.md) | Review report for BUG-T0 |
| [REVIEW_p9_t4_publishing_helper.md](P9-T4_Create_the_publishing_helper/REVIEW_p9_t4_publishing_helper.md) | Review report for P9-T4 |
| [REVIEW_fu_p9_t4_1_publish_helper_protected_main.md](FU-P9-T4-1_Align_publish_helper_output_with_protected_main_branch_workflow/REVIEW_fu_p9_t4_1_publish_helper_protected_main.md) | Review report for FU-P9-T4-1 |

## Archive Log

Expand Down Expand Up @@ -208,3 +210,5 @@
| 2026-02-13 | BUG-T0 | Archived REVIEW_BUG-T0_Uptime_Widget report |
| 2026-02-13 | P9-T4 | Archived Create_the_publishing_helper (PASS) |
| 2026-02-13 | P9-T4 | Archived REVIEW_p9_t4_publishing_helper report |
| 2026-02-13 | FU-P9-T4-1 | Archived Align_publish_helper_output_with_protected_main_branch_workflow (PASS) |
| 2026-02-13 | FU-P9-T4-1 | Archived REVIEW_fu_p9_t4_1_publish_helper_protected_main report |
2 changes: 1 addition & 1 deletion SPECS/INPROGRESS/next.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ The previously selected task has been archived.

## Recently Archived

- 2026-02-13 — FU-P9-T4-1: Align publish_helper output with protected main branch workflow (PASS)
- 2026-02-13 — P9-T4: Create the publishing helper (PASS)
- 2026-02-13 — BUG-T0: Uptime widget on Web UI always shows 1h 0m 0s (PASS)
- 2026-02-13 — FU-P9-T2-1: Fix uvx Web UI examples to include `webui` extras (PASS)
- 2026-02-13 — FU-REBUILD-P10-T1-7: Include Web UI static assets in published package artifacts (PASS)
- 2026-02-13 — P9-T3: Release version 0.3.0 (Web UI Feature Release) (PASS)

## Suggested Next Tasks

Expand Down
18 changes: 18 additions & 0 deletions SPECS/Workplan.md
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,7 @@ Main branch is currently unstable after an accidental merge of the Phase 10 Web

Phase 9 Follow-up Backlog
- [x] FU-P9-T2-1: Fix uvx Web UI examples to include `webui` extras (P1)
- [x] FU-P9-T4-1: Align publish_helper output with protected main branch workflow (P1)

#### ✅ FU-P9-T2-1: Fix uvx Web UI examples to include `webui` extras
- **Description:** Resolve documentation/config mismatch where examples use `uvx --from mcpbridge-wrapper ... --web-ui` without optional dependencies. Update all uvx Web UI examples to install extras via `--from mcpbridge-wrapper[webui]`, and align troubleshooting/runtime guidance with the correct uvx command.
Expand All @@ -1236,6 +1237,23 @@ Phase 9 Follow-up Backlog

---

#### ✅ FU-P9-T4-1: Align publish_helper output with protected main branch workflow
- **Description:** Update `scripts/publish_helper.py` release guidance so it does not instruct direct commits/tags from `main` in repositories where `main` is protected. Guidance should explicitly recommend creating a release branch, pushing branch commits, opening a PR into `main`, and only tagging after merge.
- **Priority:** P1
- **Dependencies:** P9-T4
- **Parallelizable:** yes
- **Outputs/Artifacts:**
- Updated `scripts/publish_helper.py` summary text and command block
- Updated tests in `tests/unit/test_publish_helper.py` validating protected-branch-safe guidance
- Optional alignment update in `PUBLISHING.md` if command sequence is duplicated there
- **Acceptance Criteria:**
- [x] Running `python scripts/publish_helper.py <version>` no longer suggests direct push-to-main flow
- [x] Printed commands include branch creation + push + PR-to-main step before tagging
- [x] Guidance still includes tag creation/push after merge so GitHub publish workflow is triggered
- [x] `pytest tests/unit/test_publish_helper.py` passes

---

### Phase 11: Web UI UX Improvements

**Intent:** Enhance the dashboard with better debugging tools, session awareness, theming, and keyboard-driven workflows.
Expand Down
10 changes: 8 additions & 2 deletions scripts/publish_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,23 @@ def update_files(pyproject_path: Path, server_json_path: Path, target_version: s


def print_summary(changes: list[FileChange], dry_run: bool, target_version: str) -> None:
"""Print deterministic operation summary and next release commands."""
"""Print deterministic operation summary and protected-branch-safe commands."""
action = "Dry-run planned" if dry_run else "Applied"
print(f"{action} version changes:")
for change in changes:
print(f"- {change.path}: {change.field} {change.old} -> {change.new}")

print()
print("Next release commands:")
release_branch = f"release/v{target_version}"
print("Next release commands (protected main branch flow):")
print("```bash")
print(f"git checkout -b {release_branch}")
print("git add pyproject.toml server.json")
print(f'git commit -m "Bump version to {target_version}"')
print(f"git push -u origin {release_branch}")
print("# Open a PR from release branch into main and merge it")
print("git checkout main")
print("git pull origin main")
print(f"git tag v{target_version}")
print(f"git push origin v{target_version}")
print("```")
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/test_publish_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def test_main_dry_run_prints_next_commands(
sample_files: tuple[Path, Path],
capsys: pytest.CaptureFixture[str],
) -> None:
"""CLI prints publish guidance commands after successful dry-run."""
"""CLI prints protected-branch-safe publish guidance after dry-run."""
pyproject, server_json = sample_files
code = main(
[
Expand All @@ -148,5 +148,8 @@ def test_main_dry_run_prints_next_commands(
captured = capsys.readouterr()
assert code == 0
assert "Dry-run planned version changes" in captured.out
assert "protected main branch flow" in captured.out
assert "git checkout -b release/v0.4.0" in captured.out
assert "Open a PR from release branch into main and merge it" in captured.out
assert "git tag v0.4.0" in captured.out
assert pyproject.read_text(encoding="utf-8").find('version = "0.3.2"') != -1